diff --git a/.github/workflows/changelog.yaml b/.github/workflows/changelog.yaml deleted file mode 100644 index b009cfbcdc..0000000000 --- a/.github/workflows/changelog.yaml +++ /dev/null @@ -1,88 +0,0 @@ -# This action requires that any PR targeting the main branch should add a -# yaml file to the ./.chloggen/ directory. If a CHANGELOG entry is not required, -# or if performing maintance on the Changelog, add either \"[chore]\" to the title of -# the pull request or add the \"Skip Changelog\" label to disable this action. - -name: changelog - -on: - pull_request: - types: [opened, synchronize, reopened, labeled, unlabeled] - branches: - - main - -env: - # See: https://github.com/actions/cache/issues/810#issuecomment-1222550359 - # Cache downloads for this workflow consistently run in under 1 minute - SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5 - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - -jobs: - changelog: - runs-on: ubuntu-latest - if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependencies') && !contains(github.event.pull_request.labels.*.name, 'Skip Changelog') && !contains(github.event.pull_request.title, '[chore]')}} - - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: 1.19 - - name: Cache Go - id: go-cache - uses: actions/cache@v3 - with: - path: | - ~/go/bin - ~/go/pkg/mod - key: changelog-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - - - name: Ensure no changes to the CHANGELOG - run: | - if [[ $(git diff --name-only $(git merge-base origin/main ${{ github.event.pull_request.head.sha }}) ${{ github.event.pull_request.head.sha }} ./CHANGELOG.md) ]] - then - echo "The CHANGELOG should not be directly modified." - echo "Please add a .yaml file to the ./.chloggen/ directory." - echo "See CONTRIBUTING.md for more details." - echo "Alternately, add either \"[chore]\" to the title of the pull request or add the \"Skip Changelog\" label if this job should be skipped." - false - else - echo "The CHANGELOG was not modified." - fi - - - name: Ensure ./.chloggen/*.yaml addition(s) - run: | - if [[ 1 -gt $(git diff --diff-filter=A --name-only $(git merge-base origin/main ${{ github.event.pull_request.head.sha }}) ${{ github.event.pull_request.head.sha }} ./.chloggen | grep -c \\.yaml) ]] - then - echo "No changelog entry was added to the ./.chloggen/ directory." - echo "Please add a .yaml file to the ./.chloggen/ directory." - echo "See CONTRIBUTING.md for more details." - echo "Alternately, add either \"[chore]\" to the title of the pull request or add the \"Skip Changelog\" label if this job should be skipped." - false - else - echo "A changelog entry was added to the ./.chloggen/ directory." - fi - - - name: Validate ./.chloggen/*.yaml changes - run: | - make chlog-validate \ - || { echo "New ./.chloggen/*.yaml file failed validation."; exit 1; } - - # In order to validate any links in the yaml file, render the config to markdown - - name: Render .chloggen changelog entries - run: make chlog-preview > changelog_preview.md - - name: Install markdown-link-check - run: npm install -g markdown-link-check - - name: Run markdown-link-check - run: | - markdown-link-check \ - --verbose \ - --config .github/workflows/check_links_config.json \ - changelog_preview.md \ - || { echo "Check that anchor links are lowercase"; exit 1; } diff --git a/.github/workflows/publish-autoinstrumentation-apache-httpd.yaml b/.github/workflows/publish-autoinstrumentation-apache-httpd.yaml index 597d79ecd4..8ba508df58 100644 --- a/.github/workflows/publish-autoinstrumentation-apache-httpd.yaml +++ b/.github/workflows/publish-autoinstrumentation-apache-httpd.yaml @@ -27,7 +27,7 @@ jobs: id: meta uses: docker/metadata-action@v4 with: - images: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-apache-httpd + images: gethelios/autoinstrumentation-apache-httpd tags: | type=match,pattern=v(.*),group=1,value=v${{ env.VERSION }} @@ -48,9 +48,8 @@ jobs: - name: Login to GitHub Package Registry uses: docker/login-action@v2 with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + username: gethelios + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v3 diff --git a/.github/workflows/publish-autoinstrumentation-dotnet.yaml b/.github/workflows/publish-autoinstrumentation-dotnet.yaml index 8b36346572..7550e662f2 100644 --- a/.github/workflows/publish-autoinstrumentation-dotnet.yaml +++ b/.github/workflows/publish-autoinstrumentation-dotnet.yaml @@ -27,7 +27,7 @@ jobs: id: meta uses: docker/metadata-action@v4 with: - images: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-dotnet + images: gethelios/autoinstrumentation-dotnet tags: | type=match,pattern=v(.*),group=1,value=v${{ env.VERSION }} @@ -48,9 +48,8 @@ jobs: - name: Login to GitHub Package Registry uses: docker/login-action@v2 with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + username: gethelios + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v3 diff --git a/.github/workflows/publish-autoinstrumentation-java.yaml b/.github/workflows/publish-autoinstrumentation-java.yaml index c95439f901..4bd04e6514 100644 --- a/.github/workflows/publish-autoinstrumentation-java.yaml +++ b/.github/workflows/publish-autoinstrumentation-java.yaml @@ -27,7 +27,7 @@ jobs: id: meta uses: docker/metadata-action@v4 with: - images: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-java + images: gethelios/autoinstrumentation-java tags: | type=match,pattern=v(.*),group=1,value=v${{ env.VERSION }} @@ -48,9 +48,8 @@ jobs: - name: Login to GitHub Package Registry uses: docker/login-action@v2 with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + username: gethelios + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v3 diff --git a/.github/workflows/publish-autoinstrumentation-nodejs.yaml b/.github/workflows/publish-autoinstrumentation-nodejs.yaml index 4fa837a2c5..9e8e17d44b 100644 --- a/.github/workflows/publish-autoinstrumentation-nodejs.yaml +++ b/.github/workflows/publish-autoinstrumentation-nodejs.yaml @@ -27,7 +27,7 @@ jobs: id: meta uses: docker/metadata-action@v4 with: - images: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-nodejs + images: gethelios/autoinstrumentation-nodejs tags: | type=match,pattern=v(.*),group=1,value=v${{ env.VERSION }} @@ -48,9 +48,8 @@ jobs: - name: Login to GitHub Package Registry uses: docker/login-action@v2 with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + username: gethelios + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v3 diff --git a/.github/workflows/publish-autoinstrumentation-python.yaml b/.github/workflows/publish-autoinstrumentation-python.yaml index 2f28a80414..94035e392c 100644 --- a/.github/workflows/publish-autoinstrumentation-python.yaml +++ b/.github/workflows/publish-autoinstrumentation-python.yaml @@ -27,7 +27,7 @@ jobs: id: meta uses: docker/metadata-action@v4 with: - images: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-python + images: gethelios/autoinstrumentation-python tags: | type=match,pattern=v(.*),group=1,value=v${{ env.VERSION }} @@ -48,9 +48,8 @@ jobs: - name: Login to GitHub Package Registry uses: docker/login-action@v2 with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + username: gethelios + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v3 diff --git a/.github/workflows/publish-images.yaml b/.github/workflows/publish-images.yaml index a04fcf3e1d..5e27b9de45 100644 --- a/.github/workflows/publish-images.yaml +++ b/.github/workflows/publish-images.yaml @@ -36,7 +36,7 @@ jobs: id: docker_meta uses: docker/metadata-action@v4 with: - images: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator + images: gethelios/opentelemetry-operator tags: | type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} @@ -60,21 +60,20 @@ jobs: - name: Login to GitHub Package Registry uses: docker/login-action@v2 with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + username: gethelios + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push Operator image uses: docker/build-push-action@v3 with: context: . file: ./Dockerfile - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} build-args: | - VERSION_PKG=github.com/open-telemetry/opentelemetry-operator/internal/version + VERSION_PKG=github.com/helios/opentelemetry-operator/internal/version VERSION=${{ env.VERSION }} VERSION_DATE=${{ env.VERSION_DATE }} OTELCOL_VERSION=${{ env.OTELCOL_VERSION }} diff --git a/.github/workflows/publish-target-allocator.yaml b/.github/workflows/publish-target-allocator.yaml index 473fc163e8..6fba3e2c8b 100644 --- a/.github/workflows/publish-target-allocator.yaml +++ b/.github/workflows/publish-target-allocator.yaml @@ -27,7 +27,7 @@ jobs: id: meta uses: docker/metadata-action@v4 with: - images: ghcr.io/open-telemetry/opentelemetry-operator/target-allocator + images: gethelios/target-allocator tags: | type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} @@ -51,9 +51,8 @@ jobs: - name: Login to GitHub Package Registry uses: docker/login-action@v2 with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + username: gethelios + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v3 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f839a733ff..246d549519 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -22,7 +22,7 @@ jobs: run: ./hack/install-kustomize.sh - name: "generate release resources" - run: make release-artifacts IMG_PREFIX="ghcr.io/open-telemetry/opentelemetry-operator" + run: make release-artifacts IMG_PREFIX="gethelios" - name: "create the release in GitHub" env: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d98ea5f7c8..fe63c09cce 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -57,7 +57,7 @@ The environment variable `CERTMANAGER_VERSION` can be used to override the cert- CERTMANAGER_VERSION=1.60 make cert-manager ``` -When deploying the operator into the cluster using `make deploy`, an image in the format `ghcr.io/${USER}/opentelemetry-operator` is generated. If this format isn't suitable, it can be overridden by: +When deploying the operator into the cluster using `make deploy`, an image in the format `gethelios/` is generated. If this format isn't suitable, it can be overridden by: * `IMG_PREFIX`, to override the registry, namespace and image name * `USER`, to override the namespace diff --git a/Makefile b/Makefile index 6c5392e438..34bf1ec378 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ LD_FLAGS ?= "-X ${VERSION_PKG}.version=${VERSION} -X ${VERSION_PKG}.buildDate=${ ARCH ?= $(shell go env GOARCH) # Image URL to use all building/pushing image targets -IMG_PREFIX ?= ghcr.io/${USER}/opentelemetry-operator +IMG_PREFIX ?= gethelios IMG_REPO ?= opentelemetry-operator IMG ?= ${IMG_PREFIX}/${IMG_REPO}:${VERSION} BUNDLE_IMG ?= ${IMG_PREFIX}/${IMG_REPO}-bundle:${VERSION} diff --git a/autoinstrumentation/python/requirements.txt b/autoinstrumentation/python/requirements.txt index 9a32da113f..9002282c7a 100644 --- a/autoinstrumentation/python/requirements.txt +++ b/autoinstrumentation/python/requirements.txt @@ -1 +1 @@ -helios-opentelemetry-sdk=v1.0.66 \ No newline at end of file +helios-opentelemetry-sdk==v1.0.66 \ No newline at end of file diff --git a/bundle/manifests/opentelemetry-operator.clusterserviceversion.yaml b/bundle/manifests/opentelemetry-operator.clusterserviceversion.yaml index a4b06995ba..128835ef21 100644 --- a/bundle/manifests/opentelemetry-operator.clusterserviceversion.yaml +++ b/bundle/manifests/opentelemetry-operator.clusterserviceversion.yaml @@ -30,7 +30,7 @@ metadata: capabilities: Basic Install categories: Logging & Tracing certified: "false" - containerImage: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator + containerImage: gethelios/opentelemetry-operator createdAt: "2020-12-16T13:37:00+00:00" description: Provides the OpenTelemetry components, including the Collector operators.operatorframework.io/builder: operator-sdk-v1.23.0 diff --git a/config/manifests/bases/opentelemetry-operator.clusterserviceversion.yaml b/config/manifests/bases/opentelemetry-operator.clusterserviceversion.yaml index b36f42e8e6..4b5be1bd67 100644 --- a/config/manifests/bases/opentelemetry-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/opentelemetry-operator.clusterserviceversion.yaml @@ -6,7 +6,7 @@ metadata: capabilities: Basic Install categories: Logging & Tracing certified: "false" - containerImage: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator + containerImage: gethelios/opentelemetry-operator createdAt: "2020-12-16T13:37:00+00:00" description: Provides the OpenTelemetry components, including the Collector repository: github.com/open-telemetry/opentelemetry-operator diff --git a/main.go b/main.go index 797b6bccae..1d85448b0c 100644 --- a/main.go +++ b/main.go @@ -100,12 +100,12 @@ func main() { pflag.BoolVar(&enableLeaderElection, "enable-leader-election", false, "Enable leader election for controller manager. "+ "Enabling this will ensure there is only one active controller manager.") - pflag.StringVar(&collectorImage, "collector-image", fmt.Sprintf("ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:%s", v.OpenTelemetryCollector), "The default OpenTelemetry collector image. This image is used when no image is specified in the CustomResource.") - pflag.StringVar(&targetAllocatorImage, "target-allocator-image", fmt.Sprintf("ghcr.io/open-telemetry/opentelemetry-operator/target-allocator:%s", v.TargetAllocator), "The default OpenTelemetry target allocator image. This image is used when no image is specified in the CustomResource.") - pflag.StringVar(&autoInstrumentationJava, "auto-instrumentation-java-image", fmt.Sprintf("ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-java:%s", v.AutoInstrumentationJava), "The default OpenTelemetry Java instrumentation image. This image is used when no image is specified in the CustomResource.") - pflag.StringVar(&autoInstrumentationNodeJS, "auto-instrumentation-nodejs-image", fmt.Sprintf("ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-nodejs:%s", v.AutoInstrumentationNodeJS), "The default OpenTelemetry NodeJS instrumentation image. This image is used when no image is specified in the CustomResource.") - pflag.StringVar(&autoInstrumentationPython, "auto-instrumentation-python-image", fmt.Sprintf("ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-python:%s", v.AutoInstrumentationPython), "The default OpenTelemetry Python instrumentation image. This image is used when no image is specified in the CustomResource.") - pflag.StringVar(&autoInstrumentationDotNet, "auto-instrumentation-dotnet-image", fmt.Sprintf("ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-dotnet:%s", v.AutoInstrumentationDotNet), "The default OpenTelemetry DotNet instrumentation image. This image is used when no image is specified in the CustomResource.") + pflag.StringVar(&collectorImage, "collector-image", fmt.Sprintf("gethelios/opentelemetry-collector:%s", v.OpenTelemetryCollector), "The default OpenTelemetry collector image. This image is used when no image is specified in the CustomResource.") + pflag.StringVar(&targetAllocatorImage, "target-allocator-image", fmt.Sprintf("gethelios/target-allocator:%s", v.TargetAllocator), "The default OpenTelemetry target allocator image. This image is used when no image is specified in the CustomResource.") + pflag.StringVar(&autoInstrumentationJava, "auto-instrumentation-java-image", fmt.Sprintf("gethelios/autoinstrumentation-java:%s", v.AutoInstrumentationJava), "The default OpenTelemetry Java instrumentation image. This image is used when no image is specified in the CustomResource.") + pflag.StringVar(&autoInstrumentationNodeJS, "auto-instrumentation-nodejs-image", fmt.Sprintf("gethelios/autoinstrumentation-nodejs:%s", v.AutoInstrumentationNodeJS), "The default OpenTelemetry NodeJS instrumentation image. This image is used when no image is specified in the CustomResource.") + pflag.StringVar(&autoInstrumentationPython, "auto-instrumentation-python-image", fmt.Sprintf("gethelios/autoinstrumentation-python:%s", v.AutoInstrumentationPython), "The default OpenTelemetry Python instrumentation image. This image is used when no image is specified in the CustomResource.") + pflag.StringVar(&autoInstrumentationDotNet, "auto-instrumentation-dotnet-image", fmt.Sprintf("gethelios/autoinstrumentation-dotnet:%s", v.AutoInstrumentationDotNet), "The default OpenTelemetry DotNet instrumentation image. This image is used when no image is specified in the CustomResource.") pflag.StringArrayVar(&labelsFilter, "labels", []string{}, "Labels to filter away from propagating onto deploys") pflag.IntVar(&webhookPort, "webhook-port", 9443, "The port the webhook endpoint binds to.") pflag.StringVar(&tlsOpt.minVersion, "tls-min-version", "VersionTLS12", "Minimum TLS version supported. Value must match version names from https://golang.org/pkg/crypto/tls/#pkg-constants.") diff --git a/pkg/instrumentation/nodejs.go b/pkg/instrumentation/nodejs.go index d1a4e180e0..66436cd9a3 100644 --- a/pkg/instrumentation/nodejs.go +++ b/pkg/instrumentation/nodejs.go @@ -23,8 +23,19 @@ import ( const ( envNodeOptions = "NODE_OPTIONS" nodeRequireArgument = " --require /otel-auto-instrumentation/autoinstrumentation.js" + envImageName = "HS_IMAGE_NAME" ) +func injectEnvVarIfNotExists(container *corev1.Container, envVarName, envVarValue string) { + idx := getIndexOfEnv(container.Env, envVarName) + if idx == -1 { + container.Env = append(container.Env, corev1.EnvVar{ + Name: envVarName, + Value: envVarValue, + }) + } +} + func injectNodeJSSDK(nodeJSSpec v1alpha1.NodeJS, pod corev1.Pod, index int) (corev1.Pod, error) { // caller checks if there is at least one container. container := &pod.Spec.Containers[index] @@ -51,6 +62,7 @@ func injectNodeJSSDK(nodeJSSpec v1alpha1.NodeJS, pod corev1.Pod, index int) (cor } else if idx > -1 { container.Env[idx].Value = container.Env[idx].Value + nodeRequireArgument } + injectEnvVarIfNotExists(container, envImageName, container.Image) container.VolumeMounts = append(container.VolumeMounts, corev1.VolumeMount{ Name: volumeName, diff --git a/pkg/instrumentation/podmutator_test.go b/pkg/instrumentation/podmutator_test.go index 64a6e1fb0b..fca9f37b01 100644 --- a/pkg/instrumentation/podmutator_test.go +++ b/pkg/instrumentation/podmutator_test.go @@ -148,7 +148,7 @@ func TestMutatePod(t *testing.T) { Value: "true", }, { - Name: "OTEL_INSTRUMENTATION_JDBC_ENABLED", + Name: "OTEL_INSTRUMENTATION_JDBC_ENABLED", Value: "false", }, { @@ -324,6 +324,10 @@ func TestMutatePod(t *testing.T) { Name: "NODE_OPTIONS", Value: nodeRequireArgument, }, + { + Name: "HS_IMAGE_NAME", + Value: "", + }, { Name: "OTEL_TRACES_EXPORTER", Value: "otlp", diff --git a/pkg/instrumentation/sdk_test.go b/pkg/instrumentation/sdk_test.go index 24e457ce76..e371f3c240 100644 --- a/pkg/instrumentation/sdk_test.go +++ b/pkg/instrumentation/sdk_test.go @@ -533,6 +533,10 @@ func TestInjectNodeJS(t *testing.T) { Name: "NODE_OPTIONS", Value: nodeRequireArgument, }, + { + Name: "HS_IMAGE_NAME", + Value: "", + }, { Name: "OTEL_SERVICE_NAME", Value: "app", diff --git a/tests/e2e/instrumentation-nodejs/01-assert.yaml b/tests/e2e/instrumentation-nodejs/01-assert.yaml index 3190895a59..298d5c9734 100644 --- a/tests/e2e/instrumentation-nodejs/01-assert.yaml +++ b/tests/e2e/instrumentation-nodejs/01-assert.yaml @@ -14,6 +14,8 @@ spec: value: "true" - name: NODE_OPTIONS value: " --require /otel-auto-instrumentation/autoinstrumentation.js" + - name: HS_IMAGE_NAME + value: "" - name: OTEL_TRACES_EXPORTER value: otlp - name: OTEL_EXPORTER_OTLP_ENDPOINT