diff --git a/.github/workflows/publish-images.yaml b/.github/workflows/publish-images.yaml index b0b886ad6b..122479a305 100644 --- a/.github/workflows/publish-images.yaml +++ b/.github/workflows/publish-images.yaml @@ -15,6 +15,12 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Unshallow + run: git fetch --prune --unshallow + + - name: Describe the current state + run: git describe --tags + - name: Set env vars for the job run: | grep -v '\#' versions.txt | grep opentelemetry-collector | awk -F= '{print "OTELCOL_VERSION="$2}' >> $GITHUB_ENV @@ -63,8 +69,8 @@ jobs: labels: ${{ steps.docker_meta.outputs.labels }} build-args: | VERSION_PKG=github.com/open-telemetry/opentelemetry-operator/internal/version - VERSION=${VERSION} - VERSION_DATE=${VERSION_DATE} - OTELCOL_VERSION=${OTELCOL_VERSION} + VERSION=${{ env.VERSION }} + VERSION_DATE=${{ env.VERSION_DATE }} + OTELCOL_VERSION=${{ env.OTELCOL_VERSION }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache diff --git a/main.go b/main.go index 120ae50830..3fe73dbe27 100644 --- a/main.go +++ b/main.go @@ -70,6 +70,18 @@ func main() { // Add flags related to this operator v := version.Get() + logger := zap.New(zap.UseFlagOptions(&opts)) + ctrl.SetLogger(logger) + + logger.Info("Starting the OpenTelemetry Operator", + "opentelemetry-operator", v.Operator, + "opentelemetry-collector", v.OpenTelemetryCollector, + "build-date", v.BuildDate, + "go-version", v.Go, + "go-arch", runtime.GOARCH, + "go-os", runtime.GOOS, + ) + restConfig := ctrl.GetConfigOrDie() // builds the operator's configuration @@ -89,18 +101,6 @@ func main() { pflag.Parse() - logger := zap.New(zap.UseFlagOptions(&opts)) - ctrl.SetLogger(logger) - - logger.Info("Starting the OpenTelemetry Operator", - "opentelemetry-operator", v.Operator, - "opentelemetry-collector", v.OpenTelemetryCollector, - "build-date", v.BuildDate, - "go-version", v.Go, - "go-arch", runtime.GOARCH, - "go-os", runtime.GOOS, - ) - watchNamespace, found := os.LookupEnv("WATCH_NAMESPACE") if found { setupLog.Info("watching namespace(s)", "namespaces", watchNamespace)