diff --git a/.github/pipeline-descriptor.yml b/.github/pipeline-descriptor.yml index 37e8f01..3a427a8 100644 --- a/.github/pipeline-descriptor.yml +++ b/.github/pipeline-descriptor.yml @@ -20,17 +20,6 @@ docker_credentials: password: ${{ secrets.PAKETO_BUILDPACKS_DOCKERHUB_PASSWORD }} dependencies: -- id: google-stackdriver-debugger-java - uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main - with: - glob: cdbg_java_agent_gce\.tar\.gz - owner: GoogleCloudPlatform - repository: cloud-debug-java - token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} -- id: google-stackdriver-debugger-nodejs - uses: docker://ghcr.io/paketo-buildpacks/actions/npm-dependency:main - with: - package: "@google-cloud/debug-agent" - id: google-stackdriver-profiler-java uses: docker://ghcr.io/paketo-buildpacks/actions/google-stackdriver-profiler-dependency:main - id: google-stackdriver-profiler-nodejs diff --git a/.github/workflows/pb-update-google-stackdriver-debugger-java.yml b/.github/workflows/pb-update-google-stackdriver-debugger-java.yml deleted file mode 100644 index 6dc15a8..0000000 --- a/.github/workflows/pb-update-google-stackdriver-debugger-java.yml +++ /dev/null @@ -1,122 +0,0 @@ -name: Update google-stackdriver-debugger-java -"on": - schedule: - - cron: 0 5 * * 1-5 - workflow_dispatch: {} -jobs: - update: - name: Update Buildpack Dependency - runs-on: - - ubuntu-latest - steps: - - uses: actions/setup-go@v5 - with: - go-version: "1.20" - - name: Install update-buildpack-dependency - run: | - #!/usr/bin/env bash - - set -euo pipefail - - go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency@latest - - name: Install yj - run: | - #!/usr/bin/env bash - - set -euo pipefail - - echo "Installing yj ${YJ_VERSION}" - - mkdir -p "${HOME}"/bin - echo "${HOME}/bin" >> "${GITHUB_PATH}" - - curl \ - --location \ - --show-error \ - --silent \ - --output "${HOME}"/bin/yj \ - "https://github.com/sclevine/yj/releases/download/v${YJ_VERSION}/yj-linux-amd64" - - chmod +x "${HOME}"/bin/yj - env: - YJ_VERSION: 5.1.0 - - uses: actions/checkout@v4 - - id: dependency - uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main - with: - glob: cdbg_java_agent_gce\.tar\.gz - owner: GoogleCloudPlatform - repository: cloud-debug-java - token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} - - name: Update Buildpack Dependency - id: buildpack - run: | - #!/usr/bin/env bash - - set -euo pipefail - - VERSION_DEPS=$(yj -tj < buildpack.toml | jq -r ".metadata.dependencies[] | select( .id == env.ID ) | select( .version | test( env.VERSION_PATTERN ) )") - ARCH=${ARCH:-amd64} - OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r 'select( .purl | contains( env.ARCH ) ) | .version') - - if [ -z "$OLD_VERSION" ]; then - ARCH="" # empty means noarch - OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r ".version") - fi - - update-buildpack-dependency \ - --buildpack-toml buildpack.toml \ - --id "${ID}" \ - --arch "${ARCH}" \ - --version-pattern "${VERSION_PATTERN}" \ - --version "${VERSION}" \ - --cpe-pattern "${CPE_PATTERN:-}" \ - --cpe "${CPE:-}" \ - --purl-pattern "${PURL_PATTERN:-}" \ - --purl "${PURL:-}" \ - --uri "${URI}" \ - --sha256 "${SHA256}" \ - --source "${SOURCE_URI}" \ - --source-sha256 "${SOURCE_SHA256}" - - git add buildpack.toml - git checkout -- . - - if [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $1}')" != "$(echo "$VERSION" | awk -F '.' '{print $1}')" ]; then - LABEL="semver:major" - elif [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $2}')" != "$(echo "$VERSION" | awk -F '.' '{print $2}')" ]; then - LABEL="semver:minor" - else - LABEL="semver:patch" - fi - - echo "old-version=${OLD_VERSION}" >> "$GITHUB_OUTPUT" - echo "new-version=${VERSION}" >> "$GITHUB_OUTPUT" - echo "version-label=${LABEL}" >> "$GITHUB_OUTPUT" - env: - ARCH: "" - CPE: ${{ steps.dependency.outputs.cpe }} - CPE_PATTERN: "" - ID: google-stackdriver-debugger-java - PURL: ${{ steps.dependency.outputs.purl }} - PURL_PATTERN: "" - SHA256: ${{ steps.dependency.outputs.sha256 }} - SOURCE_SHA256: ${{ steps.dependency.outputs.source_sha256 }} - SOURCE_URI: ${{ steps.dependency.outputs.source }} - URI: ${{ steps.dependency.outputs.uri }} - VERSION: ${{ steps.dependency.outputs.version }} - VERSION_PATTERN: '[\d]+\.[\d]+\.[\d]+' - - uses: peter-evans/create-pull-request@v5 - with: - author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> - body: Bumps `google-stackdriver-debugger-java` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. - branch: update/buildpack/google-stackdriver-debugger-java - commit-message: |- - Bump google-stackdriver-debugger-java from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} - - Bumps google-stackdriver-debugger-java from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}. - delete-branch: true - labels: ${{ steps.buildpack.outputs.version-label }}, type:dependency-upgrade - signoff: true - title: Bump google-stackdriver-debugger-java from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} - token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/pb-update-google-stackdriver-debugger-nodejs.yml b/.github/workflows/pb-update-google-stackdriver-debugger-nodejs.yml deleted file mode 100644 index 348cc4f..0000000 --- a/.github/workflows/pb-update-google-stackdriver-debugger-nodejs.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: Update google-stackdriver-debugger-nodejs -"on": - schedule: - - cron: 0 5 * * 1-5 - workflow_dispatch: {} -jobs: - update: - name: Update Buildpack Dependency - runs-on: - - ubuntu-latest - steps: - - uses: actions/setup-go@v5 - with: - go-version: "1.20" - - name: Install update-buildpack-dependency - run: | - #!/usr/bin/env bash - - set -euo pipefail - - go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency@latest - - name: Install yj - run: | - #!/usr/bin/env bash - - set -euo pipefail - - echo "Installing yj ${YJ_VERSION}" - - mkdir -p "${HOME}"/bin - echo "${HOME}/bin" >> "${GITHUB_PATH}" - - curl \ - --location \ - --show-error \ - --silent \ - --output "${HOME}"/bin/yj \ - "https://github.com/sclevine/yj/releases/download/v${YJ_VERSION}/yj-linux-amd64" - - chmod +x "${HOME}"/bin/yj - env: - YJ_VERSION: 5.1.0 - - uses: actions/checkout@v4 - - id: dependency - uses: docker://ghcr.io/paketo-buildpacks/actions/npm-dependency:main - with: - package: '@google-cloud/debug-agent' - - name: Update Buildpack Dependency - id: buildpack - run: | - #!/usr/bin/env bash - - set -euo pipefail - - VERSION_DEPS=$(yj -tj < buildpack.toml | jq -r ".metadata.dependencies[] | select( .id == env.ID ) | select( .version | test( env.VERSION_PATTERN ) )") - ARCH=${ARCH:-amd64} - OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r 'select( .purl | contains( env.ARCH ) ) | .version') - - if [ -z "$OLD_VERSION" ]; then - ARCH="" # empty means noarch - OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r ".version") - fi - - update-buildpack-dependency \ - --buildpack-toml buildpack.toml \ - --id "${ID}" \ - --arch "${ARCH}" \ - --version-pattern "${VERSION_PATTERN}" \ - --version "${VERSION}" \ - --cpe-pattern "${CPE_PATTERN:-}" \ - --cpe "${CPE:-}" \ - --purl-pattern "${PURL_PATTERN:-}" \ - --purl "${PURL:-}" \ - --uri "${URI}" \ - --sha256 "${SHA256}" \ - --source "${SOURCE_URI}" \ - --source-sha256 "${SOURCE_SHA256}" - - git add buildpack.toml - git checkout -- . - - if [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $1}')" != "$(echo "$VERSION" | awk -F '.' '{print $1}')" ]; then - LABEL="semver:major" - elif [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $2}')" != "$(echo "$VERSION" | awk -F '.' '{print $2}')" ]; then - LABEL="semver:minor" - else - LABEL="semver:patch" - fi - - echo "old-version=${OLD_VERSION}" >> "$GITHUB_OUTPUT" - echo "new-version=${VERSION}" >> "$GITHUB_OUTPUT" - echo "version-label=${LABEL}" >> "$GITHUB_OUTPUT" - env: - ARCH: "" - CPE: ${{ steps.dependency.outputs.cpe }} - CPE_PATTERN: "" - ID: google-stackdriver-debugger-nodejs - PURL: ${{ steps.dependency.outputs.purl }} - PURL_PATTERN: "" - SHA256: ${{ steps.dependency.outputs.sha256 }} - SOURCE_SHA256: ${{ steps.dependency.outputs.source_sha256 }} - SOURCE_URI: ${{ steps.dependency.outputs.source }} - URI: ${{ steps.dependency.outputs.uri }} - VERSION: ${{ steps.dependency.outputs.version }} - VERSION_PATTERN: '[\d]+\.[\d]+\.[\d]+' - - uses: peter-evans/create-pull-request@v5 - with: - author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> - body: Bumps `google-stackdriver-debugger-nodejs` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. - branch: update/buildpack/google-stackdriver-debugger-nodejs - commit-message: |- - Bump google-stackdriver-debugger-nodejs from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} - - Bumps google-stackdriver-debugger-nodejs from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}. - delete-branch: true - labels: ${{ steps.buildpack.outputs.version-label }}, type:dependency-upgrade - signoff: true - title: Bump google-stackdriver-debugger-nodejs from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} - token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} diff --git a/README.md b/README.md index db34668..0eaef3f 100644 --- a/README.md +++ b/README.md @@ -1,44 +1,45 @@ # `gcr.io/paketo-buildpacks/google-stackdriver` -The Paketo Buildpack for Google Stackdriver is a Cloud Native Buildpack that contributes Stackdriver agents and configures them to connect to the service. + +The Paketo Buildpack for Google Stackdriver is a Cloud Native Buildpack that contributes Stackdriver profiler agent and configure it to connect to the service. ## Behavior + This buildpack will participate if any of the following conditions are met -* A binding exists with `type` of `StackdriverDebugger` * A binding exists with `type` of `StackdriverProfiler` The buildpack will do the following for Java applications: -* If `StackdriverDebugger` binding exists contributes a Java debugger agent to a layer and configures `$JAVA_TOOL_OPTIONS` to use it * If `StackdriverProfiler` binding exists contributes a Java profiler agent to a layer and configures `$JAVA_TOOL_OPTIONS` to use it * Sets `$GOOGLE_APPLICATION_CREDENTIALS` to the path of the `ApplicationCredentials` secret The buildpack will do the following for NodeJS applications: -* If `StackdriverDebugger` binding exists - * Contributes a NodeJS debugger agent to a layer and configures `$NODE_MODULES` to use it - * If main module does not already require `@google-cloud/debug-agent` module, prepends the main module with `require('@google-cloud/debug-agent').start();` * If `StackdriverProfiler` binding exists * Contributes a NodeJS profiler agent to a layer and configures `$NODE_MODULES` to use it * If main module does not already require `@google-cloud/profiler` module, prepends the main module with `require('@google-cloud/profiler').start();` * Sets `$GOOGLE_APPLICATION_CREDENTIALS` to the path of the `ApplicationCredentials` secret ## Configuration -| Environment Variable | Description -| -------------------- | ----------- -| `$BPL_GOOGLE_STACKDRIVER_MODULE` | Configure the name of the application. Defaults to `default-module`. -| `$BPL_GOOGLE_STACKDRIVER_PROJECT_ID` | Configure the project id for the application. Defaults to ``. -| `$BPL_GOOGLE_STACKDRIVER_VERSION` | Configure the version of the application. Defaults to ``. + +| Environment Variable | Description | +| ------------------------------------ | --------------------------------------------------------------------- | +| `$BPL_GOOGLE_STACKDRIVER_MODULE` | Configure the name of the application. Defaults to `default-module`. | +| `$BPL_GOOGLE_STACKDRIVER_PROJECT_ID` | Configure the project id for the application. Defaults to ``. | +| `$BPL_GOOGLE_STACKDRIVER_VERSION` | Configure the version of the application. Defaults to ``. | ## Bindings + The buildpack optionally accepts the following bindings: ### Type: `dependency-mapping` -|Key | Value | Description -|----------------------|---------|------------ -|`` | `` | If needed, the buildpack will fetch the dependency with digest `` from `` + +| Key | Value | Description | +| --------------------- | ------- | ------------------------------------------------------------------------------------------------- | +| `` | `` | If needed, the buildpack will fetch the dependency with digest `` from `` | ## License + This buildpack is released under version 2.0 of the [Apache License][a]. [a]: http://www.apache.org/licenses/LICENSE-2.0 diff --git a/buildpack.toml b/buildpack.toml index 31df2c9..ef7420a 100644 --- a/buildpack.toml +++ b/buildpack.toml @@ -1,4 +1,4 @@ -# Copyright 2018-2020 the original author or authors. +# Copyright 2018-2024 the original author or authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -47,45 +47,13 @@ api = "0.7" launch = true name = "BPL_GOOGLE_STACKDRIVER_VERSION" - [[metadata.dependencies]] - cpes = ["cpe:2.3:a:google:google-stackdriver-debugger-java:4.1.0:*:*:*:*:*:*:*"] - id = "google-stackdriver-debugger-java" - name = "Google Stackdriver Debugger Java Agent" - purl = "pkg:generic/google-stackdriver-debugger-java@4.1.0" - sha256 = "931e8d5301828bb3ee1ba5948308eb678f33aa148a5381768263ac9fa0fa6349" - source = "https://github.com/GoogleCloudPlatform/cloud-debug-java/archive/refs/tags/v4.1.tar.gz" - source-sha256 = "d676df0e195457797284cd2da8e450da54b030b70135e3157358feff7d1d1b88" - stacks = ["io.buildpacks.stacks.bionic", "io.paketo.stacks.tiny", "*"] - uri = "https://github.com/GoogleCloudPlatform/cloud-debug-java/releases/download/v4.1/cdbg_java_agent_gce.tar.gz" - version = "4.1.0" - - [[metadata.dependencies.licenses]] - type = "Apache-2.0" - uri = "https://github.com/GoogleCloudPlatform/cloud-debug-java/blob/master/LICENSE" - - [[metadata.dependencies]] - cpes = ["cpe:2.3:a:google:google-stackdriver-debugger-nodejs:9.0.1:*:*:*:*:*:*:*"] - id = "google-stackdriver-debugger-nodejs" - name = "Google Stackdriver Debugger NodeJS Agent" - purl = "pkg:generic/google-stackdriver-debugger-nodejs@9.0.1" - sha256 = "826a0a542d6cd148458c01bdf1b297018a8203712609f7895d786228c77801c3" - source = "https://registry.npmjs.org/@google-cloud/debug-agent/-/debug-agent-9.0.1.tgz" - source-sha256 = "826a0a542d6cd148458c01bdf1b297018a8203712609f7895d786228c77801c3" - stacks = ["io.buildpacks.stacks.bionic", "io.paketo.stacks.tiny", "*"] - uri = "https://registry.npmjs.org/@google-cloud/debug-agent/-/debug-agent-9.0.1.tgz" - version = "9.0.1" - - [[metadata.dependencies.licenses]] - type = "Apache-2.0" - uri = "https://github.com/googleapis/cloud-debug-nodejs/blob/master/LICENSE" - [[metadata.dependencies]] cpes = ["cpe:2.3:a:google:google-stackdriver-profiler-java:2024.2.500:*:*:*:*:*:*:*"] id = "google-stackdriver-profiler-java" name = "Google Stackdriver Profiler Java Agent" purl = "pkg:generic/google-stackdriver-profiler-java@2024.2.500" sha256 = "bd266710d8af36ad127480ce21ef4d1e403e578f99af7e5de4c52b39e2d8f746" - stacks = ["io.buildpacks.stacks.bionic", "io.paketo.stacks.tiny", "*"] + stacks = ["*"] uri = "https://storage.googleapis.com/cloud-profiler/java/cloud-profiler-java-agent_20240205_RC00.tar.gz" version = "2024.2.500" @@ -101,19 +69,13 @@ api = "0.7" sha256 = "66261e02b7bb368265c260fa05d270c5e50459a8f191f6720666828878467a36" source = "https://registry.npmjs.org/@google-cloud/profiler/-/profiler-6.0.1.tgz" source-sha256 = "66261e02b7bb368265c260fa05d270c5e50459a8f191f6720666828878467a36" - stacks = ["io.buildpacks.stacks.bionic", "io.paketo.stacks.tiny", "*"] + stacks = ["*"] uri = "https://registry.npmjs.org/@google-cloud/profiler/-/profiler-6.0.1.tgz" version = "6.0.1" [[metadata.dependencies.licenses]] type = "Apache-2.0" - uri = "https://github.com/googleapis/cloud-debug-nodejs/blob/master/LICENSE" - -[[stacks]] - id = "io.buildpacks.stacks.bionic" - -[[stacks]] - id = "io.paketo.stacks.tiny" + uri = "https://github.com/googleapis/cloud-profiler-nodejs/blob/main/LICENSE" [[stacks]] id = "*" diff --git a/cmd/helper/main.go b/cmd/helper/main.go index dbdeada..02e38c2 100644 --- a/cmd/helper/main.go +++ b/cmd/helper/main.go @@ -1,5 +1,5 @@ /* - * Copyright 2018-2020 the original author or authors. + * Copyright 2018-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,6 @@ func main() { err error l = bard.NewLogger(os.Stdout) c = helper.Credentials{Logger: l} - d = helper.JavaDebugger{Logger: l} p = helper.JavaProfiler{Logger: l} ) @@ -44,7 +43,6 @@ func main() { return sherpa.Helpers(map[string]sherpa.ExecD{ "credentials": c, - "java-debugger": d, "java-profiler": p, }) }) diff --git a/helper/credentials.go b/helper/credentials.go index add0cc6..171d0f5 100644 --- a/helper/credentials.go +++ b/helper/credentials.go @@ -30,15 +30,6 @@ type Credentials struct { } func (c Credentials) Execute() (map[string]string, error) { - if b, ok, err := bindings.ResolveOne(c.Bindings, bindings.OfType("StackdriverDebugger")); err != nil { - return nil, fmt.Errorf("unable to resolve binding StackdriverDebugger\n%w", err) - } else if ok { - if p, ok := b.SecretFilePath("ApplicationCredentials"); ok { - c.Logger.Info("Configuring Google application credentials") - return map[string]string{"GOOGLE_APPLICATION_CREDENTIALS": p}, nil - } - } - if b, ok, err := bindings.ResolveOne(c.Bindings, bindings.OfType("StackdriverProfiler")); err != nil { return nil, fmt.Errorf("unable to resolve binding StackdriverProfiler\n%w", err) } else if ok { diff --git a/helper/credentials_test.go b/helper/credentials_test.go index 93c3601..293086d 100644 --- a/helper/credentials_test.go +++ b/helper/credentials_test.go @@ -1,5 +1,5 @@ /* - * Copyright 2018-2020 the original author or authors. + * Copyright 2018-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,21 +37,6 @@ func testCredentials(t *testing.T, context spec.G, it spec.S) { Expect(c.Execute()).To(BeZero()) }) - it("contributes credentials if debugger binding exists", func() { - c.Bindings = libcnb.Bindings{ - { - Name: "test-binding", - Path: "/test/path/test-binding", - Type: "StackdriverDebugger", - Secret: map[string]string{"ApplicationCredentials": "test-value"}, - }, - } - - Expect(c.Execute()).To(Equal(map[string]string{ - "GOOGLE_APPLICATION_CREDENTIALS": "/test/path/test-binding/ApplicationCredentials", - })) - }) - it("contributes credentials if profiler binding exists", func() { c.Bindings = libcnb.Bindings{ { diff --git a/helper/init_test.go b/helper/init_test.go index 6c140da..f41d105 100644 --- a/helper/init_test.go +++ b/helper/init_test.go @@ -1,5 +1,5 @@ /* - * Copyright 2018-2020 the original author or authors. + * Copyright 2018-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,6 @@ import ( func TestUnit(t *testing.T) { suite := spec.New("helper", spec.Report(report.Terminal{})) suite("Credentials", testCredentials) - suite("JavaDebugger", testJavaDebugger) suite("JavaProfiler", testJavaProfiler) suite.Run(t) } diff --git a/helper/java_debugger.go b/helper/java_debugger.go deleted file mode 100644 index acbfbe2..0000000 --- a/helper/java_debugger.go +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2018-2020 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package helper - -import ( - "fmt" - "os" - "strings" - - "github.com/paketo-buildpacks/libpak/bard" -) - -type JavaDebugger struct { - Logger bard.Logger -} - -func (j JavaDebugger) Execute() (map[string]string, error) { - module, ok := os.LookupEnv("BPL_GOOGLE_STACKDRIVER_MODULE") - if !ok { - module = "default-module" - } - - version := os.Getenv("BPL_GOOGLE_STACKDRIVER_VERSION") - - var values []string - if s, ok := os.LookupEnv("JAVA_TOOL_OPTIONS"); ok { - values = append(values, s) - } - - values = append(values, - "-Dcom.google.cdbg.auth.serviceaccount.enable=true", - fmt.Sprintf("-Dcom.google.cdbg.module=%s", module), - ) - - if version != "" { - values = append(values, fmt.Sprintf("-Dcom.google.cdbg.version=%s", version)) - } - - message := fmt.Sprintf("Google Stackdriver Debugger enabled for %s", module) - if version != "" { - message = fmt.Sprintf("%s:%s", message, version) - } - j.Logger.Info(message) - - return map[string]string{"JAVA_TOOL_OPTIONS": strings.Join(values, " ")}, nil -} diff --git a/helper/java_debugger_test.go b/helper/java_debugger_test.go deleted file mode 100644 index cc152a2..0000000 --- a/helper/java_debugger_test.go +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2018-2020 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package helper_test - -import ( - "os" - "testing" - - . "github.com/onsi/gomega" - "github.com/sclevine/spec" - - "github.com/paketo-buildpacks/google-stackdriver/v5/helper" -) - -func testJavaDebugger(t *testing.T, context spec.G, it spec.S) { - var ( - Expect = NewWithT(t).Expect - - j helper.JavaDebugger - ) - - it("uses defaults", func() { - Expect(j.Execute()).To(Equal(map[string]string{ - "JAVA_TOOL_OPTIONS": "-Dcom.google.cdbg.auth.serviceaccount.enable=true -Dcom.google.cdbg.module=default-module", - })) - }) - - context("$BPL_GOOGLE_STACKDRIVER_MODULE", func() { - it.Before(func() { - Expect(os.Setenv("BPL_GOOGLE_STACKDRIVER_MODULE", "test-module")).To(Succeed()) - }) - - it.After(func() { - Expect(os.Unsetenv("BPL_GOOGLE_STACKDRIVER_MODULE")).To(Succeed()) - }) - - it("uses configured module", func() { - Expect(j.Execute()).To(Equal(map[string]string{ - "JAVA_TOOL_OPTIONS": "-Dcom.google.cdbg.auth.serviceaccount.enable=true -Dcom.google.cdbg.module=test-module", - })) - }) - }) - - context("$BPL_GOOGLE_STACKDRIVER_VERSION", func() { - it.Before(func() { - Expect(os.Setenv("BPL_GOOGLE_STACKDRIVER_VERSION", "test-version")).To(Succeed()) - }) - - it.After(func() { - Expect(os.Unsetenv("BPL_GOOGLE_STACKDRIVER_VERSION")).To(Succeed()) - }) - - it("uses configured version", func() { - Expect(j.Execute()).To(Equal(map[string]string{ - "JAVA_TOOL_OPTIONS": "-Dcom.google.cdbg.auth.serviceaccount.enable=true -Dcom.google.cdbg.module=default-module -Dcom.google.cdbg.version=test-version", - })) - }) - }) - - context("$JAVA_TOOL_OPTIONS", func() { - it.Before(func() { - Expect(os.Setenv("JAVA_TOOL_OPTIONS", "test-java-tool-options")).To(Succeed()) - }) - - it.After(func() { - Expect(os.Unsetenv("JAVA_TOOL_OPTIONS")).To(Succeed()) - }) - - it("uses configured JAVA_TOOL_OPTIONS", func() { - Expect(j.Execute()).To(Equal(map[string]string{ - "JAVA_TOOL_OPTIONS": "test-java-tool-options -Dcom.google.cdbg.auth.serviceaccount.enable=true -Dcom.google.cdbg.module=default-module", - })) - }) - }) -} diff --git a/helper/java_profiler_test.go b/helper/java_profiler_test.go index dcf0716..24cd7fe 100644 --- a/helper/java_profiler_test.go +++ b/helper/java_profiler_test.go @@ -1,5 +1,5 @@ /* - * Copyright 2018-2020 the original author or authors. + * Copyright 2018-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package helper_test import ( - "os" "testing" . "github.com/onsi/gomega" @@ -41,11 +40,7 @@ func testJavaProfiler(t *testing.T, context spec.G, it spec.S) { context("$BPI_GOOGLE_STACKDRIVER_PROFILER_JAVA_AGENT_PATH", func() { it.Before(func() { - Expect(os.Setenv("BPI_GOOGLE_STACKDRIVER_PROFILER_JAVA_AGENT_PATH", "test-path")).To(Succeed()) - }) - - it.After(func() { - Expect(os.Unsetenv("BPI_GOOGLE_STACKDRIVER_PROFILER_JAVA_AGENT_PATH")).To(Succeed()) + t.Setenv("BPI_GOOGLE_STACKDRIVER_PROFILER_JAVA_AGENT_PATH", "test-path") }) it("uses defaults", func() { @@ -56,11 +51,7 @@ func testJavaProfiler(t *testing.T, context spec.G, it spec.S) { context("$BPL_GOOGLE_STACKDRIVER_MODULE", func() { it.Before(func() { - Expect(os.Setenv("BPL_GOOGLE_STACKDRIVER_MODULE", "test-module")).To(Succeed()) - }) - - it.After(func() { - Expect(os.Unsetenv("BPL_GOOGLE_STACKDRIVER_MODULE")).To(Succeed()) + t.Setenv("BPL_GOOGLE_STACKDRIVER_MODULE", "test-module") }) it("uses configured module", func() { @@ -72,11 +63,7 @@ func testJavaProfiler(t *testing.T, context spec.G, it spec.S) { context("$BPL_GOOGLE_STACKDRIVER_VERSION", func() { it.Before(func() { - Expect(os.Setenv("BPL_GOOGLE_STACKDRIVER_VERSION", "test-version")).To(Succeed()) - }) - - it.After(func() { - Expect(os.Unsetenv("BPL_GOOGLE_STACKDRIVER_VERSION")).To(Succeed()) + t.Setenv("BPL_GOOGLE_STACKDRIVER_VERSION", "test-version") }) it("uses configured version", func() { @@ -88,11 +75,7 @@ func testJavaProfiler(t *testing.T, context spec.G, it spec.S) { context("$JAVA_TOOL_OPTIONS", func() { it.Before(func() { - Expect(os.Setenv("JAVA_TOOL_OPTIONS", "test-java-tool-options")).To(Succeed()) - }) - - it.After(func() { - Expect(os.Unsetenv("JAVA_TOOL_OPTIONS")).To(Succeed()) + t.Setenv("JAVA_TOOL_OPTIONS", "test-java-tool-options") }) it("uses configured JAVA_TOOL_OPTIONS", func() { diff --git a/stackdriver/build.go b/stackdriver/build.go index 08289e2..58a5bb4 100644 --- a/stackdriver/build.go +++ b/stackdriver/build.go @@ -1,5 +1,5 @@ /* - * Copyright 2018-2020 the original author or authors. + * Copyright 2018-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,36 +52,6 @@ func (b Build) Build(context libcnb.BuildContext) (libcnb.BuildResult, error) { names := []string{"credentials"} - if _, ok, err := pr.Resolve("google-stackdriver-debugger-java"); err != nil { - return libcnb.BuildResult{}, fmt.Errorf("unable to resolve google-stackdriver-debugger-java plan entry\n%w", err) - } else if ok { - dep, err := dr.Resolve("google-stackdriver-debugger-java", "") - if err != nil { - return libcnb.BuildResult{}, fmt.Errorf("unable to find dependency\n%w", err) - } - - ja, be := NewJavaDebuggerAgent(dep, dc) - ja.Logger = b.Logger - result.Layers = append(result.Layers, ja) - result.BOM.Entries = append(result.BOM.Entries, be) - - names = append(names, "java-debugger") - } - - if _, ok, err := pr.Resolve("google-stackdriver-debugger-nodejs"); err != nil { - return libcnb.BuildResult{}, fmt.Errorf("unable to resolve google-stackdriver-debugger-nodejs plan entry\n%w", err) - } else if ok { - dep, err := dr.Resolve("google-stackdriver-debugger-nodejs", "") - if err != nil { - return libcnb.BuildResult{}, fmt.Errorf("unable to find dependency\n%w", err) - } - - ja, be := NewNodeJSDebuggerAgent(context.Buildpack.Path, dep, dc) - ja.Logger = b.Logger - result.Layers = append(result.Layers, ja) - result.BOM.Entries = append(result.BOM.Entries, be) - } - if _, ok, err := pr.Resolve("google-stackdriver-profiler-java"); err != nil { return libcnb.BuildResult{}, fmt.Errorf("unable to resolve google-stackdriver-profiler-java plan entry\n%w", err) } else if ok { diff --git a/stackdriver/build_test.go b/stackdriver/build_test.go index 1e429d5..575cc4a 100644 --- a/stackdriver/build_test.go +++ b/stackdriver/build_test.go @@ -1,5 +1,5 @@ /* - * Copyright 2018-2020 the original author or authors. + * Copyright 2018-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,143 +34,7 @@ func testBuild(t *testing.T, context spec.G, it spec.S) { ctx libcnb.BuildContext ) - it("contributes Java debugger agent for API <= 0.6", func() { - ctx.Plan.Entries = append(ctx.Plan.Entries, libcnb.BuildpackPlanEntry{Name: "google-stackdriver-debugger-java"}) - ctx.Buildpack.Metadata = map[string]interface{}{ - "dependencies": []map[string]interface{}{ - { - "id": "google-stackdriver-debugger-java", - "version": "1.1.1", - "stacks": []interface{}{"test-stack-id"}, - }, - }, - } - ctx.StackID = "test-stack-id" - ctx.Buildpack.API = "0.6" - - result, err := stackdriver.Build{}.Build(ctx) - Expect(err).NotTo(HaveOccurred()) - - Expect(result.Layers).To(HaveLen(2)) - Expect(result.Layers[0].Name()).To(Equal("google-stackdriver-debugger-java")) - Expect(result.Layers[1].Name()).To(Equal("helper")) - Expect(result.Layers[1].(libpak.HelperLayerContributor).Names).To(Equal([]string{"credentials", "java-debugger"})) - - Expect(len(result.BOM.Entries)).To(Equal(2)) - Expect(result.BOM.Entries[0].Name).To(Equal("google-stackdriver-debugger-java")) - Expect(result.BOM.Entries[1].Name).To(Equal("helper")) - }) - it("contributes Java debugger agent for API 0.7+", func() { - ctx.Plan.Entries = append(ctx.Plan.Entries, libcnb.BuildpackPlanEntry{Name: "google-stackdriver-debugger-java"}) - ctx.Buildpack.Metadata = map[string]interface{}{ - "dependencies": []map[string]interface{}{ - { - "id": "google-stackdriver-debugger-java", - "version": "1.1.1", - "stacks": []interface{}{"test-stack-id"}, - "cpes": []string{"cpe:2.3:a:google:google-stackdriver-debugger-java:1.1.0:*:*:*:*:*:*:*"}, - "purl": "pkg:generic/google-stackdriver-profiler-java@2021.11.1500", - }, - }, - } - ctx.StackID = "test-stack-id" - ctx.Buildpack.API = "0.7" - - result, err := stackdriver.Build{}.Build(ctx) - Expect(err).NotTo(HaveOccurred()) - - Expect(result.Layers).To(HaveLen(2)) - Expect(result.Layers[0].Name()).To(Equal("google-stackdriver-debugger-java")) - Expect(result.Layers[1].Name()).To(Equal("helper")) - Expect(result.Layers[1].(libpak.HelperLayerContributor).Names).To(Equal([]string{"credentials", "java-debugger"})) - - Expect(len(result.BOM.Entries)).To(Equal(2)) - Expect(result.BOM.Entries[0].Name).To(Equal("google-stackdriver-debugger-java")) - Expect(result.BOM.Entries[1].Name).To(Equal("helper")) - }) - - it("contributes NodeJS debugger agent for API 0.7+", func() { - ctx.Plan.Entries = append(ctx.Plan.Entries, libcnb.BuildpackPlanEntry{Name: "google-stackdriver-debugger-nodejs"}) - ctx.Buildpack.Metadata = map[string]interface{}{ - "dependencies": []map[string]interface{}{ - { - "id": "google-stackdriver-debugger-nodejs", - "version": "1.1.1", - "stacks": []interface{}{"test-stack-id"}, - "cpes": []string{"cpe:2.3:a:google:google-stackdriver-debugger-nodejs:1.1.0:*:*:*:*:*:*:*"}, - "purl": "pkg:generic/google-stackdriver-profiler-nodejs@2021.11.1500", - }, - }, - } - ctx.StackID = "test-stack-id" - ctx.Buildpack.API = "0.7" - - result, err := stackdriver.Build{}.Build(ctx) - Expect(err).NotTo(HaveOccurred()) - - Expect(result.Layers).To(HaveLen(2)) - Expect(result.Layers[0].Name()).To(Equal("google-stackdriver-debugger-nodejs")) - Expect(result.Layers[1].Name()).To(Equal("helper")) - Expect(result.Layers[1].(libpak.HelperLayerContributor).Names).To(Equal([]string{"credentials"})) - - Expect(len(result.BOM.Entries)).To(Equal(2)) - Expect(result.BOM.Entries[0].Name).To(Equal("google-stackdriver-debugger-nodejs")) - Expect(result.BOM.Entries[1].Name).To(Equal("helper")) - }) - it("contributes NodeJS debugger agent for API <= 0.6", func() { - ctx.Plan.Entries = append(ctx.Plan.Entries, libcnb.BuildpackPlanEntry{Name: "google-stackdriver-debugger-nodejs"}) - ctx.Buildpack.Metadata = map[string]interface{}{ - "dependencies": []map[string]interface{}{ - { - "id": "google-stackdriver-debugger-nodejs", - "version": "1.1.1", - "stacks": []interface{}{"test-stack-id"}, - }, - }, - } - ctx.StackID = "test-stack-id" - ctx.Buildpack.API = "0.6" - - result, err := stackdriver.Build{}.Build(ctx) - Expect(err).NotTo(HaveOccurred()) - - Expect(result.Layers).To(HaveLen(2)) - Expect(result.Layers[0].Name()).To(Equal("google-stackdriver-debugger-nodejs")) - Expect(result.Layers[1].Name()).To(Equal("helper")) - Expect(result.Layers[1].(libpak.HelperLayerContributor).Names).To(Equal([]string{"credentials"})) - - Expect(len(result.BOM.Entries)).To(Equal(2)) - Expect(result.BOM.Entries[0].Name).To(Equal("google-stackdriver-debugger-nodejs")) - Expect(result.BOM.Entries[1].Name).To(Equal("helper")) - }) - - it("contributes Java profiler agent for API <=0.6", func() { - ctx.Plan.Entries = append(ctx.Plan.Entries, libcnb.BuildpackPlanEntry{Name: "google-stackdriver-profiler-java"}) - ctx.Buildpack.Metadata = map[string]interface{}{ - "dependencies": []map[string]interface{}{ - { - "id": "google-stackdriver-profiler-java", - "version": "1.1.1", - "stacks": []interface{}{"test-stack-id"}, - }, - }, - } - ctx.StackID = "test-stack-id" - ctx.Buildpack.API = "0.6" - - result, err := stackdriver.Build{}.Build(ctx) - Expect(err).NotTo(HaveOccurred()) - - Expect(result.Layers).To(HaveLen(2)) - Expect(result.Layers[0].Name()).To(Equal("google-stackdriver-profiler-java")) - Expect(result.Layers[1].Name()).To(Equal("helper")) - Expect(result.Layers[1].(libpak.HelperLayerContributor).Names).To(Equal([]string{"credentials", "java-profiler"})) - - Expect(len(result.BOM.Entries)).To(Equal(2)) - Expect(result.BOM.Entries[0].Name).To(Equal("google-stackdriver-profiler-java")) - Expect(result.BOM.Entries[1].Name).To(Equal("helper")) - }) - it("contributes Java profiler agent for API 0.7+", func() { + it("contributes Java profiler agent", func() { ctx.Plan.Entries = append(ctx.Plan.Entries, libcnb.BuildpackPlanEntry{Name: "google-stackdriver-profiler-java"}) ctx.Buildpack.Metadata = map[string]interface{}{ "dependencies": []map[string]interface{}{ @@ -199,7 +63,7 @@ func testBuild(t *testing.T, context spec.G, it spec.S) { Expect(result.BOM.Entries[1].Name).To(Equal("helper")) }) - it("contributes NodeJS profiler agent for API 0.7+", func() { + it("contributes NodeJS profiler agent", func() { ctx.Plan.Entries = append(ctx.Plan.Entries, libcnb.BuildpackPlanEntry{Name: "google-stackdriver-profiler-nodejs"}) ctx.Buildpack.Metadata = map[string]interface{}{ "dependencies": []map[string]interface{}{ @@ -223,32 +87,6 @@ func testBuild(t *testing.T, context spec.G, it spec.S) { Expect(result.Layers[1].Name()).To(Equal("helper")) Expect(result.Layers[1].(libpak.HelperLayerContributor).Names).To(Equal([]string{"credentials"})) - Expect(len(result.BOM.Entries)).To(Equal(2)) - Expect(result.BOM.Entries[0].Name).To(Equal("google-stackdriver-profiler-nodejs")) - Expect(result.BOM.Entries[1].Name).To(Equal("helper")) - }) - it("contributes NodeJS profiler agent for API <= 0.6", func() { - ctx.Plan.Entries = append(ctx.Plan.Entries, libcnb.BuildpackPlanEntry{Name: "google-stackdriver-profiler-nodejs"}) - ctx.Buildpack.Metadata = map[string]interface{}{ - "dependencies": []map[string]interface{}{ - { - "id": "google-stackdriver-profiler-nodejs", - "version": "1.1.1", - "stacks": []interface{}{"test-stack-id"}, - }, - }, - } - ctx.StackID = "test-stack-id" - ctx.Buildpack.API = "0.6" - - result, err := stackdriver.Build{}.Build(ctx) - Expect(err).NotTo(HaveOccurred()) - - Expect(result.Layers).To(HaveLen(2)) - Expect(result.Layers[0].Name()).To(Equal("google-stackdriver-profiler-nodejs")) - Expect(result.Layers[1].Name()).To(Equal("helper")) - Expect(result.Layers[1].(libpak.HelperLayerContributor).Names).To(Equal([]string{"credentials"})) - Expect(len(result.BOM.Entries)).To(Equal(2)) Expect(result.BOM.Entries[0].Name).To(Equal("google-stackdriver-profiler-nodejs")) Expect(result.BOM.Entries[1].Name).To(Equal("helper")) diff --git a/stackdriver/detect.go b/stackdriver/detect.go index da336ab..ba4a97f 100644 --- a/stackdriver/detect.go +++ b/stackdriver/detect.go @@ -1,5 +1,5 @@ /* - * Copyright 2018-2020 the original author or authors. + * Copyright 2018-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,45 +20,17 @@ import ( "fmt" "github.com/buildpacks/libcnb" - "github.com/paketo-buildpacks/libpak/bindings" "github.com/paketo-buildpacks/libpak/bard" + "github.com/paketo-buildpacks/libpak/bindings" ) -type Detect struct{ +type Detect struct { Logger bard.Logger } func (d Detect) Detect(context libcnb.DetectContext) (libcnb.DetectResult, error) { result := libcnb.DetectResult{Pass: false} - if _, ok, err := bindings.ResolveOne(context.Platform.Bindings, bindings.OfType("StackdriverDebugger")); err != nil { - return libcnb.DetectResult{}, fmt.Errorf("unable to resolve binding StackdriverDebugger\n%w", err) - } else if ok { - result.Pass = true - result.Plans = append(result.Plans, - libcnb.BuildPlan{ - Provides: []libcnb.BuildPlanProvide{ - {Name: "google-stackdriver-debugger-java"}, - }, - Requires: []libcnb.BuildPlanRequire{ - {Name: "google-stackdriver-debugger-java"}, - {Name: "jvm-application"}, - }, - }, - libcnb.BuildPlan{ - Provides: []libcnb.BuildPlanProvide{ - {Name: "google-stackdriver-debugger-nodejs"}, - }, - Requires: []libcnb.BuildPlanRequire{ - {Name: "google-stackdriver-debugger-nodejs"}, - {Name: "node", Metadata: map[string]interface{}{"build": true}}, - {Name: "node_modules"}, - }, - }, - ) - d.Logger.Info("PASSED: binding of type 'StackdriverDebugger' found") - } - if _, ok, err := bindings.ResolveOne(context.Platform.Bindings, bindings.OfType("StackdriverProfiler")); err != nil { return libcnb.DetectResult{}, fmt.Errorf("unable to resolve binding StackdriverProfiler\n%w", err) } else if ok { @@ -87,8 +59,8 @@ func (d Detect) Detect(context libcnb.DetectContext) (libcnb.DetectResult, error d.Logger.Info("PASSED: binding of type 'StackdriverProfiler' found") } - if result.Pass != true { - d.Logger.Info("SKIPPED: no bindings of type 'StackdriverDebugger' or 'StackdriverProfiler' found") + if !result.Pass { + d.Logger.Info("SKIPPED: no bindings of type 'StackdriverProfiler' found") } return result, nil } diff --git a/stackdriver/detect_test.go b/stackdriver/detect_test.go index 32f3ba0..ba2bec1 100644 --- a/stackdriver/detect_test.go +++ b/stackdriver/detect_test.go @@ -1,5 +1,5 @@ /* - * Copyright 2018-2020 the original author or authors. + * Copyright 2018-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,37 +38,6 @@ func testDetect(t *testing.T, context spec.G, it spec.S) { Expect(detect.Detect(ctx)).To(Equal(libcnb.DetectResult{})) }) - it("passes with debugger service", func() { - ctx.Platform.Bindings = libcnb.Bindings{ - libcnb.Binding{Name: "test-service", Type: "StackdriverDebugger"}, - } - - Expect(detect.Detect(ctx)).To(Equal(libcnb.DetectResult{ - Pass: true, - Plans: []libcnb.BuildPlan{ - { - Provides: []libcnb.BuildPlanProvide{ - {Name: "google-stackdriver-debugger-java"}, - }, - Requires: []libcnb.BuildPlanRequire{ - {Name: "google-stackdriver-debugger-java"}, - {Name: "jvm-application"}, - }, - }, - { - Provides: []libcnb.BuildPlanProvide{ - {Name: "google-stackdriver-debugger-nodejs"}, - }, - Requires: []libcnb.BuildPlanRequire{ - {Name: "google-stackdriver-debugger-nodejs"}, - {Name: "node", Metadata: map[string]interface{}{"build": true}}, - {Name: "node_modules"}, - }, - }, - }, - })) - }) - it("passes with profiler service", func() { ctx.Platform.Bindings = libcnb.Bindings{ libcnb.Binding{Name: "test-service", Type: "StackdriverProfiler"}, diff --git a/stackdriver/init_test.go b/stackdriver/init_test.go index 777525d..5495656 100644 --- a/stackdriver/init_test.go +++ b/stackdriver/init_test.go @@ -1,5 +1,5 @@ /* - * Copyright 2018-2020 the original author or authors. + * Copyright 2018-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,9 +27,7 @@ func TestUnit(t *testing.T) { suite := spec.New("stackdriver", spec.Report(report.Terminal{})) suite("Build", testBuild) suite("Detect", testDetect) - suite("JavaDebuggerAgent", testJavaDebuggerAgent) suite("JavaProfilerAgent", testJavaProfilerAgent) - suite("NodeJSDebuggerAgent", testNodeJSDebuggerAgent) suite("NodeJSProfileAgent", testNodeJSProfilerAgent) suite.Run(t) } diff --git a/stackdriver/java_debugger_agent.go b/stackdriver/java_debugger_agent.go deleted file mode 100644 index 7c015ec..0000000 --- a/stackdriver/java_debugger_agent.go +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2018-2020 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package stackdriver - -import ( - "fmt" - "os" - "path/filepath" - - "github.com/buildpacks/libcnb" - "github.com/paketo-buildpacks/libpak" - "github.com/paketo-buildpacks/libpak/bard" - "github.com/paketo-buildpacks/libpak/crush" -) - -type JavaDebuggerAgent struct { - LayerContributor libpak.DependencyLayerContributor - Logger bard.Logger -} - -func NewJavaDebuggerAgent(dependency libpak.BuildpackDependency, cache libpak.DependencyCache) (JavaDebuggerAgent, libcnb.BOMEntry) { - contributor, entry := libpak.NewDependencyLayer(dependency, cache, libcnb.LayerTypes{ - Launch: true, - }) - return JavaDebuggerAgent{LayerContributor: contributor}, entry -} - -func (j JavaDebuggerAgent) Contribute(layer libcnb.Layer) (libcnb.Layer, error) { - j.LayerContributor.Logger = j.Logger - - return j.LayerContributor.Contribute(layer, func(artifact *os.File) (libcnb.Layer, error) { - j.Logger.Bodyf("Expanding to %s", layer.Path) - - if err := crush.ExtractTarGz(artifact, layer.Path, 0); err != nil { - return libcnb.Layer{}, fmt.Errorf("unable to extract %s\n%w", artifact.Name(), err) - } - - layer.LaunchEnvironment.Appendf("JAVA_TOOL_OPTIONS", " ", - "-agentpath:%s=--logtostderr=1", filepath.Join(layer.Path, "cdbg_java_agent.so")) - - return layer, nil - }) -} - -func (j JavaDebuggerAgent) Name() string { - return j.LayerContributor.LayerName() -} diff --git a/stackdriver/java_debugger_agent_test.go b/stackdriver/java_debugger_agent_test.go deleted file mode 100644 index 4b0980b..0000000 --- a/stackdriver/java_debugger_agent_test.go +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2018-2020 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package stackdriver_test - -import ( - "fmt" - "io/ioutil" - "os" - "path/filepath" - "testing" - - "github.com/buildpacks/libcnb" - . "github.com/onsi/gomega" - "github.com/paketo-buildpacks/libpak" - "github.com/sclevine/spec" - - "github.com/paketo-buildpacks/google-stackdriver/v5/stackdriver" -) - -func testJavaDebuggerAgent(t *testing.T, context spec.G, it spec.S) { - var ( - Expect = NewWithT(t).Expect - - ctx libcnb.BuildContext - ) - - it.Before(func() { - var err error - - ctx.Layers.Path, err = ioutil.TempDir("", "java-debugger-agent-layers") - Expect(err).NotTo(HaveOccurred()) - }) - - it.After(func() { - Expect(os.RemoveAll(ctx.Layers.Path)).To(Succeed()) - }) - - it("contributes Java agent", func() { - dep := libpak.BuildpackDependency{ - URI: "https://localhost/stub-stackdriver-debugger-agent.tar.gz", - SHA256: "80ceb691b8b586e15dedae62564dea2cfe8e2f6ac44ec48fe4dc87599fa22cab", - } - dc := libpak.DependencyCache{CachePath: "testdata"} - - layer, err := ctx.Layers.Layer("test-layer") - Expect(err).NotTo(HaveOccurred()) - - contrib, be := stackdriver.NewJavaDebuggerAgent(dep, dc) - Expect(be.Launch).To(BeTrue()) - Expect(be.Metadata["uri"]).To(Equal("https://localhost/stub-stackdriver-debugger-agent.tar.gz")) - - layer, err = contrib.Contribute(layer) - Expect(err).NotTo(HaveOccurred()) - - Expect(layer.LayerTypes.Launch).To(BeTrue()) - - file := filepath.Join(layer.Path, "cdbg_java_agent.so") - Expect(file).To(BeARegularFile()) - Expect(layer.LaunchEnvironment["JAVA_TOOL_OPTIONS.delim"]).To(Equal(" ")) - Expect(layer.LaunchEnvironment["JAVA_TOOL_OPTIONS.append"]).To(Equal(fmt.Sprintf("-agentpath:%s=--logtostderr=1", file))) - }) -} diff --git a/stackdriver/java_profiler_agent_test.go b/stackdriver/java_profiler_agent_test.go index 1dad149..c48ddd8 100644 --- a/stackdriver/java_profiler_agent_test.go +++ b/stackdriver/java_profiler_agent_test.go @@ -1,5 +1,5 @@ /* - * Copyright 2018-2020 the original author or authors. + * Copyright 2018-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +17,6 @@ package stackdriver_test import ( - "io/ioutil" - "os" "path/filepath" "testing" @@ -40,14 +38,10 @@ func testJavaProfilerAgent(t *testing.T, context spec.G, it spec.S) { it.Before(func() { var err error - ctx.Layers.Path, err = ioutil.TempDir("", "java-profiler-agent-layers") + ctx.Layers.Path = t.TempDir() Expect(err).NotTo(HaveOccurred()) }) - it.After(func() { - Expect(os.RemoveAll(ctx.Layers.Path)).To(Succeed()) - }) - it("contributes Java agent", func() { dep := libpak.BuildpackDependency{ URI: "https://localhost/stub-stackdriver-profiler-agent.tar.gz", diff --git a/stackdriver/nodejs_debugger_agent.go b/stackdriver/nodejs_debugger_agent.go deleted file mode 100644 index 34c9762..0000000 --- a/stackdriver/nodejs_debugger_agent.go +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2018-2020 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package stackdriver - -import ( - "fmt" - "io/ioutil" - "os" - "path/filepath" - "regexp" - - "github.com/buildpacks/libcnb" - "github.com/paketo-buildpacks/libpak" - "github.com/paketo-buildpacks/libpak/bard" - "github.com/paketo-buildpacks/libpak/effect" - "github.com/paketo-buildpacks/libpak/sherpa" -) - -type NodeJSDebuggerAgent struct { - ApplicationPath string - Executor effect.Executor - LayerContributor libpak.DependencyLayerContributor - Logger bard.Logger -} - -func NewNodeJSDebuggerAgent(applicationPath string, dependency libpak.BuildpackDependency, cache libpak.DependencyCache) (NodeJSDebuggerAgent, libcnb.BOMEntry) { - contributor, entry := libpak.NewDependencyLayer(dependency, cache, libcnb.LayerTypes{Launch: true}) - return NodeJSDebuggerAgent{ - ApplicationPath: applicationPath, - Executor: effect.NewExecutor(), - LayerContributor: contributor, - }, entry -} - -func (n NodeJSDebuggerAgent) Contribute(layer libcnb.Layer) (libcnb.Layer, error) { - n.LayerContributor.Logger = n.Logger - - layer, err := n.LayerContributor.Contribute(layer, func(artifact *os.File) (libcnb.Layer, error) { - n.Logger.Bodyf("Installing to %s", layer.Path) - - if err := n.Executor.Execute(effect.Execution{ - Command: "npm", - Args: []string{"install", "--no-save", artifact.Name()}, - Dir: layer.Path, - Stdout: n.Logger.InfoWriter(), - Stderr: n.Logger.InfoWriter(), - }); err != nil { - return libcnb.Layer{}, fmt.Errorf("unable to run npm install\n%w", err) - } - - layer.LaunchEnvironment.Prepend("NODE_PATH", string(os.PathListSeparator), filepath.Join(layer.Path, "node_modules")) - - return layer, nil - }) - if err != nil { - return libcnb.Layer{}, fmt.Errorf("unable to install node module\n%w", err) - } - - m, err := sherpa.NodeJSMainModule(n.ApplicationPath) - if err != nil { - return libcnb.Layer{}, fmt.Errorf("unable to find main module in %s\n%w", n.ApplicationPath, err) - } - - file := filepath.Join(n.ApplicationPath, m) - c, err := ioutil.ReadFile(file) - if err != nil { - return libcnb.Layer{}, fmt.Errorf("unable to read contents of %s\n%w", file, err) - } - - if !regexp.MustCompile(`require\(['"]@google-cloud/debug-agent['"]\)`).Match(c) { - n.Logger.Header("Requiring '@google-cloud/debug-agent' module") - - if err := ioutil.WriteFile(file, append([]byte("require('@google-cloud/debug-agent').start();\n"), c...), 0644); err != nil { - return libcnb.Layer{}, fmt.Errorf("unable to write main module %s\n%w", file, err) - } - } - - return layer, nil -} - -func (n NodeJSDebuggerAgent) Name() string { - return n.LayerContributor.LayerName() -} diff --git a/stackdriver/nodejs_debugger_agent_test.go b/stackdriver/nodejs_debugger_agent_test.go deleted file mode 100644 index dbaa252..0000000 --- a/stackdriver/nodejs_debugger_agent_test.go +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright 2018-2020 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package stackdriver_test - -import ( - "io/ioutil" - "os" - "path/filepath" - "testing" - - "github.com/buildpacks/libcnb" - . "github.com/onsi/gomega" - "github.com/paketo-buildpacks/libpak" - "github.com/paketo-buildpacks/libpak/effect" - "github.com/paketo-buildpacks/libpak/effect/mocks" - "github.com/sclevine/spec" - "github.com/stretchr/testify/mock" - - "github.com/paketo-buildpacks/google-stackdriver/v5/stackdriver" -) - -func testNodeJSDebuggerAgent(t *testing.T, context spec.G, it spec.S) { - var ( - Expect = NewWithT(t).Expect - - ctx libcnb.BuildContext - executor *mocks.Executor - ) - - it.Before(func() { - var err error - - ctx.Application.Path, err = ioutil.TempDir("", "nodejs-debugger-agent-application") - Expect(err).NotTo(HaveOccurred()) - - ctx.Layers.Path, err = ioutil.TempDir("", "nodejs-debugger-agent-layers") - Expect(err).NotTo(HaveOccurred()) - - executor = &mocks.Executor{} - executor.On("Execute", mock.Anything).Return(nil) - }) - - it.After(func() { - Expect(os.RemoveAll(ctx.Application.Path)).To(Succeed()) - Expect(os.RemoveAll(ctx.Layers.Path)).To(Succeed()) - }) - - it("contributes NodeJS agent", func() { - Expect(ioutil.WriteFile(filepath.Join(ctx.Application.Path, "package.json"), []byte(`{ "main": "main.js" }`), - 0644)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(ctx.Application.Path, "main.js"), []byte{}, 0644)).To(Succeed()) - - dep := libpak.BuildpackDependency{ - URI: "https://localhost/stub-stackdriver-debugger-agent.tgz", - SHA256: "c3ecfa1e2daa29db419b063dec9ea20108923e406d9ab7a35318f6f14f615dc6", - } - dc := libpak.DependencyCache{CachePath: "testdata"} - - n, be := stackdriver.NewNodeJSDebuggerAgent(ctx.Application.Path, dep, dc) - Expect(be.Launch).To(BeTrue()) - Expect(be.Metadata["uri"]).To(Equal("https://localhost/stub-stackdriver-debugger-agent.tgz")) - - n.Executor = executor - layer, err := ctx.Layers.Layer("test-layer") - Expect(err).NotTo(HaveOccurred()) - - layer, err = n.Contribute(layer) - Expect(err).NotTo(HaveOccurred()) - - Expect(layer.LayerTypes.Launch).To(BeTrue()) - - execution := executor.Calls[0].Arguments[0].(effect.Execution) - Expect(execution.Command).To(Equal("npm")) - Expect(execution.Args).To(Equal([]string{"install", "--no-save", - filepath.Join("testdata", - "c3ecfa1e2daa29db419b063dec9ea20108923e406d9ab7a35318f6f14f615dc6", - "stub-stackdriver-debugger-agent.tgz"), - })) - - Expect(layer.LaunchEnvironment["NODE_PATH.delim"]).To(Equal(string(os.PathListSeparator))) - Expect(layer.LaunchEnvironment["NODE_PATH.prepend"]).To(Equal(filepath.Join(layer.Path, "node_modules"))) - }) - - it("requires @google-cloud/debug-agent module", func() { - Expect(ioutil.WriteFile(filepath.Join(ctx.Application.Path, "package.json"), []byte(`{ "main": "main.js" }`), - 0644)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(ctx.Application.Path, "main.js"), []byte("test"), 0644)).To(Succeed()) - - dep := libpak.BuildpackDependency{ - URI: "https://localhost/stub-stackdriver-debugger-agent.tgz", - SHA256: "c3ecfa1e2daa29db419b063dec9ea20108923e406d9ab7a35318f6f14f615dc6", - } - dc := libpak.DependencyCache{CachePath: "testdata"} - - n, _ := stackdriver.NewNodeJSDebuggerAgent(ctx.Application.Path, dep, dc) - n.Executor = executor - layer, err := ctx.Layers.Layer("test-layer") - Expect(err).NotTo(HaveOccurred()) - - layer, err = n.Contribute(layer) - Expect(err).NotTo(HaveOccurred()) - - Expect(ioutil.ReadFile(filepath.Join(ctx.Application.Path, "main.js"))).To(Equal( - []byte("require('@google-cloud/debug-agent').start();\ntest"))) - }) - - it("does not require @google-cloud/debug-agent module", func() { - Expect(ioutil.WriteFile(filepath.Join(ctx.Application.Path, "package.json"), []byte(`{ "main": "main.js" }`), - 0644)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(ctx.Application.Path, "main.js"), - []byte("test\nrequire('@google-cloud/debug-agent')\ntest"), 0644)).To(Succeed()) - - dep := libpak.BuildpackDependency{ - URI: "https://localhost/stub-stackdriver-debugger-agent.tgz", - SHA256: "c3ecfa1e2daa29db419b063dec9ea20108923e406d9ab7a35318f6f14f615dc6", - } - dc := libpak.DependencyCache{CachePath: "testdata"} - - n, _ := stackdriver.NewNodeJSDebuggerAgent(ctx.Application.Path, dep, dc) - n.Executor = executor - layer, err := ctx.Layers.Layer("test-layer") - Expect(err).NotTo(HaveOccurred()) - - layer, err = n.Contribute(layer) - Expect(err).NotTo(HaveOccurred()) - - Expect(ioutil.ReadFile(filepath.Join(ctx.Application.Path, "main.js"))).To(Equal( - []byte("test\nrequire('@google-cloud/debug-agent')\ntest"))) - }) -} diff --git a/stackdriver/nodejs_profiler_agent.go b/stackdriver/nodejs_profiler_agent.go index f2195ce..8d45094 100644 --- a/stackdriver/nodejs_profiler_agent.go +++ b/stackdriver/nodejs_profiler_agent.go @@ -1,5 +1,5 @@ /* - * Copyright 2018-2020 the original author or authors. + * Copyright 2018-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ package stackdriver import ( "fmt" - "io/ioutil" "os" "path/filepath" "regexp" @@ -76,7 +75,7 @@ func (n NodeJSProfilerAgent) Contribute(layer libcnb.Layer) (libcnb.Layer, error } file := filepath.Join(n.ApplicationPath, m) - c, err := ioutil.ReadFile(file) + c, err := os.ReadFile(file) if err != nil { return libcnb.Layer{}, fmt.Errorf("unable to read contents of %s\n%w", file, err) } @@ -84,7 +83,7 @@ func (n NodeJSProfilerAgent) Contribute(layer libcnb.Layer) (libcnb.Layer, error if !regexp.MustCompile(`require\(['"]@google-cloud/profiler['"]\)`).Match(c) { n.Logger.Header("Requiring '@google-cloud/profiler' module") - if err := ioutil.WriteFile(file, append([]byte("require('@google-cloud/profiler').start();\n"), c...), 0644); err != nil { + if err := os.WriteFile(file, append([]byte("require('@google-cloud/profiler').start();\n"), c...), 0644); err != nil { return libcnb.Layer{}, fmt.Errorf("unable to write main module %s\n%w", file, err) } } diff --git a/stackdriver/nodejs_profiler_agent_test.go b/stackdriver/nodejs_profiler_agent_test.go index f809649..cfe432c 100644 --- a/stackdriver/nodejs_profiler_agent_test.go +++ b/stackdriver/nodejs_profiler_agent_test.go @@ -1,5 +1,5 @@ /* - * Copyright 2018-2020 the original author or authors. + * Copyright 2018-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package stackdriver_test import ( - "io/ioutil" "os" "path/filepath" "testing" @@ -44,25 +43,20 @@ func testNodeJSProfilerAgent(t *testing.T, context spec.G, it spec.S) { it.Before(func() { var err error - ctx.Application.Path, err = ioutil.TempDir("", "nodejs-profiler-agent-application") + ctx.Application.Path = t.TempDir() Expect(err).NotTo(HaveOccurred()) - ctx.Layers.Path, err = ioutil.TempDir("", "nodejs-profiler-agent-layers") + ctx.Layers.Path = t.TempDir() Expect(err).NotTo(HaveOccurred()) executor = &mocks.Executor{} executor.On("Execute", mock.Anything).Return(nil) }) - it.After(func() { - Expect(os.RemoveAll(ctx.Application.Path)).To(Succeed()) - Expect(os.RemoveAll(ctx.Layers.Path)).To(Succeed()) - }) - it("contributes NodeJS agent", func() { - Expect(ioutil.WriteFile(filepath.Join(ctx.Application.Path, "package.json"), []byte(`{ "main": "main.js" }`), + Expect(os.WriteFile(filepath.Join(ctx.Application.Path, "package.json"), []byte(`{ "main": "main.js" }`), 0644)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(ctx.Application.Path, "main.js"), []byte{}, 0644)).To(Succeed()) + Expect(os.WriteFile(filepath.Join(ctx.Application.Path, "main.js"), []byte{}, 0644)).To(Succeed()) dep := libpak.BuildpackDependency{ URI: "https://localhost/stub-stackdriver-profiler-agent.tgz", @@ -96,9 +90,9 @@ func testNodeJSProfilerAgent(t *testing.T, context spec.G, it spec.S) { }) it("requires @google-cloud/profiler module", func() { - Expect(ioutil.WriteFile(filepath.Join(ctx.Application.Path, "package.json"), []byte(`{ "main": "main.js" }`), + Expect(os.WriteFile(filepath.Join(ctx.Application.Path, "package.json"), []byte(`{ "main": "main.js" }`), 0644)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(ctx.Application.Path, "main.js"), []byte("test"), 0644)).To(Succeed()) + Expect(os.WriteFile(filepath.Join(ctx.Application.Path, "main.js"), []byte("test"), 0644)).To(Succeed()) dep := libpak.BuildpackDependency{ URI: "https://localhost/stub-stackdriver-profiler-agent.tgz", @@ -112,17 +106,17 @@ func testNodeJSProfilerAgent(t *testing.T, context spec.G, it spec.S) { layer, err := ctx.Layers.Layer("test-layer") Expect(err).NotTo(HaveOccurred()) - layer, err = n.Contribute(layer) + _, err = n.Contribute(layer) Expect(err).NotTo(HaveOccurred()) - Expect(ioutil.ReadFile(filepath.Join(ctx.Application.Path, "main.js"))).To(Equal( + Expect(os.ReadFile(filepath.Join(ctx.Application.Path, "main.js"))).To(Equal( []byte("require('@google-cloud/profiler').start();\ntest"))) }) it("does not require @google-cloud/profiler module", func() { - Expect(ioutil.WriteFile(filepath.Join(ctx.Application.Path, "package.json"), []byte(`{ "main": "main.js" }`), + Expect(os.WriteFile(filepath.Join(ctx.Application.Path, "package.json"), []byte(`{ "main": "main.js" }`), 0644)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(ctx.Application.Path, "main.js"), + Expect(os.WriteFile(filepath.Join(ctx.Application.Path, "main.js"), []byte("test\nrequire('@google-cloud/profiler')\ntest"), 0644)).To(Succeed()) dep := libpak.BuildpackDependency{ @@ -136,10 +130,10 @@ func testNodeJSProfilerAgent(t *testing.T, context spec.G, it spec.S) { layer, err := ctx.Layers.Layer("test-layer") Expect(err).NotTo(HaveOccurred()) - layer, err = n.Contribute(layer) + _, err = n.Contribute(layer) Expect(err).NotTo(HaveOccurred()) - Expect(ioutil.ReadFile(filepath.Join(ctx.Application.Path, "main.js"))).To(Equal( + Expect(os.ReadFile(filepath.Join(ctx.Application.Path, "main.js"))).To(Equal( []byte("test\nrequire('@google-cloud/profiler')\ntest"))) }) } diff --git a/stackdriver/testdata/80ceb691b8b586e15dedae62564dea2cfe8e2f6ac44ec48fe4dc87599fa22cab.toml b/stackdriver/testdata/80ceb691b8b586e15dedae62564dea2cfe8e2f6ac44ec48fe4dc87599fa22cab.toml deleted file mode 100644 index b53e31e..0000000 --- a/stackdriver/testdata/80ceb691b8b586e15dedae62564dea2cfe8e2f6ac44ec48fe4dc87599fa22cab.toml +++ /dev/null @@ -1,2 +0,0 @@ -uri = "https://localhost/stub-stackdriver-debugger-agent.tar.gz" -sha256 = "80ceb691b8b586e15dedae62564dea2cfe8e2f6ac44ec48fe4dc87599fa22cab" diff --git a/stackdriver/testdata/80ceb691b8b586e15dedae62564dea2cfe8e2f6ac44ec48fe4dc87599fa22cab/stub-stackdriver-debugger-agent.tar.gz b/stackdriver/testdata/80ceb691b8b586e15dedae62564dea2cfe8e2f6ac44ec48fe4dc87599fa22cab/stub-stackdriver-debugger-agent.tar.gz deleted file mode 100644 index 0f4e75f..0000000 Binary files a/stackdriver/testdata/80ceb691b8b586e15dedae62564dea2cfe8e2f6ac44ec48fe4dc87599fa22cab/stub-stackdriver-debugger-agent.tar.gz and /dev/null differ diff --git a/stackdriver/testdata/c3ecfa1e2daa29db419b063dec9ea20108923e406d9ab7a35318f6f14f615dc6.toml b/stackdriver/testdata/c3ecfa1e2daa29db419b063dec9ea20108923e406d9ab7a35318f6f14f615dc6.toml deleted file mode 100644 index 765098e..0000000 --- a/stackdriver/testdata/c3ecfa1e2daa29db419b063dec9ea20108923e406d9ab7a35318f6f14f615dc6.toml +++ /dev/null @@ -1,2 +0,0 @@ -uri = "https://localhost/stub-stackdriver-debugger-agent.tgz" -sha256 = "c3ecfa1e2daa29db419b063dec9ea20108923e406d9ab7a35318f6f14f615dc6" diff --git a/stackdriver/testdata/c3ecfa1e2daa29db419b063dec9ea20108923e406d9ab7a35318f6f14f615dc6/stub-stackdriver-debugger-agent.tgz b/stackdriver/testdata/c3ecfa1e2daa29db419b063dec9ea20108923e406d9ab7a35318f6f14f615dc6/stub-stackdriver-debugger-agent.tgz deleted file mode 100644 index dbe4322..0000000 Binary files a/stackdriver/testdata/c3ecfa1e2daa29db419b063dec9ea20108923e406d9ab7a35318f6f14f615dc6/stub-stackdriver-debugger-agent.tgz and /dev/null differ