Skip to content

Merge from develop #342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/dependency-deprecation-reminder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
with:
ref: develop
ref: master

- name: Get deprecations
id: deprecations
Expand Down
101 changes: 0 additions & 101 deletions .github/workflows/release-reminder.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/synchronize-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Synchronize Labels
on:
push:
branches:
- develop
- master
paths:
- .github/labels.yml
workflow_dispatch: {}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Test Pull Request
on:
pull_request:
branches:
- develop
- master

jobs:
unit:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-github-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@v4
with:
token: ${{ secrets.CF_BOT_GITHUB_TOKEN }}
ref: develop
ref: master

- name: Checkout github-config
uses: actions/checkout@v4
Expand Down Expand Up @@ -61,4 +61,4 @@ jobs:
token: ${{ secrets.CF_BOT_GITHUB_TOKEN }}
title: "Updates github-config"
branch: automation/github-config/update
base: develop
base: master
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ See the [Cutlass](https://github.com/cloudfoundry/libbuildpack/cutlass) CF build

Please include integration tests (in `src/apt/integration`) and corresponding fixtures (in `fixtures`) where necessary to cover any functionality that is introduced.

**NOTE:** When submitting a pull request, *please make sure to target the `develop` branch*, so that your changes are up-to-date and easy to integrate with the most recent work on the buildpack. Thanks!
**NOTE:** When submitting a pull request, *please make sure to target the `master` branch*, so that your changes are up-to-date and easy to integrate with the most recent work on the buildpack. Thanks!
2 changes: 1 addition & 1 deletion PULL_REQUEST_TEMPLATE
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Thanks for contributing to the buildpack. To speed up the process of reviewing y

* [ ] I have viewed signed and have submitted the Contributor License Agreement

* [ ] I have made this pull request to the `develop` branch
* [ ] I have made this pull request to the `master` branch

* [ ] I have added an integration test
14 changes: 10 additions & 4 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
{
"stack": "cflinuxfs3",
"stack": "cflinuxfs4",
"oses": [
"linux"
],
"integration": {
"harness": "ginkgo",
"harness": "switchblade",
"matrix": [
{ "cached": false, "parallel": true },
{ "cached": true, "parallel": true }
{
"cached": false,
"parallel": true
},
{
"cached": true,
"parallel": true
}
]
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions fixtures/util/dynatrace/fake_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"revision":1234567890,
"properties":
[
{
"section":"fakesection",
"key":"fakekey",
"value":"fakevalue"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module myapp

go 1.13
go 1.17
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
Expand All @@ -12,46 +11,35 @@ import (
)

func main() {
var application struct {
ApplicationURIs []string `json:"application_uris"`
}

err := json.Unmarshal([]byte(os.Getenv("VCAP_APPLICATION")), &application)
if err != nil {
log.Fatalf("failed to parse VCAP_APPLICATION: %s", err)
}

http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
var withoutAgentPath bool
path := req.URL.Path

uri := application.ApplicationURIs[0]

if strings.HasPrefix(path, "/without-agent-path") {
uri = fmt.Sprintf("%s/without-agent-path", uri)
path = strings.TrimPrefix(path, "/without-agent-path")
withoutAgentPath = true
}

switch path {
case "/v1/deployment/installer/agent/unix/paas-sh/latest":
context := struct{ URI string }{URI: uri}
context := struct{ URI string }{URI: req.Host}
t := template.Must(template.New("install.sh").ParseFiles("install.sh"))
err := t.Execute(w, context)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte(err.Error()))
fmt.Fprint(w, err.Error())
return
}

case "/dynatrace-env.sh", "/liboneagentproc.so", "/ruxitagentproc.conf":
contents, err := ioutil.ReadFile(strings.TrimPrefix(req.URL.Path, "/"))
contents, err := os.ReadFile(strings.TrimPrefix(req.URL.Path, "/"))
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte(err.Error()))
fmt.Fprint(w, err.Error())
return
}
w.Write(contents)

fmt.Fprintf(w, "%s", contents)

case "/manifest.json":
var payload map[string]interface{}
Expand Down Expand Up @@ -80,7 +68,7 @@ func main() {
json.NewEncoder(w).Encode(payload)

case "/v1/deployment/installer/agent/processmoduleconfig":
fakeConfig, err := ioutil.ReadFile("fake_config.json")
fakeConfig, err := os.ReadFile("fake_config.json")
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte(err.Error()))
Expand Down
19 changes: 17 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,38 +1,53 @@
module github.com/cloudfoundry/nginx-buildpack

go 1.22.5
go 1.23.0

toolchain go1.24.0

require (
github.com/Dynatrace/libbuildpack-dynatrace v1.8.0
github.com/cloudfoundry/libbuildpack v0.0.0-20240717165421-f2ae8069fcba
github.com/cloudfoundry/switchblade v0.9.0
github.com/golang/mock v1.6.0
github.com/miekg/dns v1.1.62
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.36.2
github.com/sclevine/spec v1.4.0
gopkg.in/yaml.v2 v2.4.0
)

require (
code.cloudfoundry.org/lager v2.0.0+incompatible // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/docker v24.0.9+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/elazarl/goproxy v1.2.8 // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.6 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/nxadm/tail v1.4.11 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/paketo-buildpacks/packit v1.3.1 // indirect
github.com/paketo-buildpacks/packit/v2 v2.16.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/teris-io/shortid v0.0.0-20220617161101-71ec9f2aa569 // indirect
github.com/tidwall/gjson v1.18.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/ulikunitz/xz v0.5.12 // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/tools v0.29.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading