From e3995a3fcf11624a9282a45e30ef827032b47a88 Mon Sep 17 00:00:00 2001 From: "openshift-merge-bot[bot]" <148852131+openshift-merge-bot[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 17:15:47 +0000 Subject: [PATCH 1/2] Merge pull request #184 from Joeavaikath/fix-konflux-version-arg Rename VERSION to OADP_VERSION in konflux.Dockerfile --- Containerfile.download | 6 +++--- konflux.Dockerfile | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Containerfile.download b/Containerfile.download index 6a8f2d95..d504be49 100644 --- a/Containerfile.download +++ b/Containerfile.download @@ -13,8 +13,8 @@ RUN go mod download && go mod verify COPY . . -# Version information -ARG VERSION=dev +# Version information (OADP_VERSION avoids collision with Konflux-injected VERSION) +ARG OADP_VERSION=dev ARG GIT_COMMIT=unknown # Build release binaries for all platforms as direct executables @@ -33,7 +33,7 @@ RUN set -e && \ CGO_ENABLED=0 GOOS=$os GOARCH=$arch \ go build -trimpath \ -ldflags="-s -w \ - -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=${VERSION} \ + -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=${OADP_VERSION} \ -X github.com/vmware-tanzu/velero/pkg/buildinfo.GitSHA=${GIT_COMMIT} \ -X github.com/vmware-tanzu/velero/pkg/buildinfo.GitTreeState=clean" \ -o /archives/$output \ diff --git a/konflux.Dockerfile b/konflux.Dockerfile index 3d6ff62d..00a3bd3c 100644 --- a/konflux.Dockerfile +++ b/konflux.Dockerfile @@ -7,8 +7,8 @@ FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_golang_1.25 COPY . /workspace WORKDIR /workspace -# Version information -ARG VERSION=dev +# Version information (OADP_VERSION avoids collision with Konflux-injected VERSION) +ARG OADP_VERSION=dev ARG GIT_COMMIT=unknown # Build release binaries for all platforms (CGO_ENABLED=0 for cross-platform @@ -27,7 +27,7 @@ RUN set -e && \ CGO_ENABLED=0 GOOS=$os GOARCH=$arch \ go build -trimpath -mod=mod \ -ldflags="-s -w \ - -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=${VERSION} \ + -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=${OADP_VERSION} \ -X github.com/vmware-tanzu/velero/pkg/buildinfo.GitSHA=${GIT_COMMIT} \ -X github.com/vmware-tanzu/velero/pkg/buildinfo.GitTreeState=clean" \ -o /archives/$output \ From e5ff5d7a19fa3e21c4f4a196b79f863906e241ea Mon Sep 17 00:00:00 2001 From: Joseph Antony Vaikath Date: Mon, 4 May 2026 15:41:33 -0400 Subject: [PATCH 2/2] Merge pull request #186 from Joeavaikath/use-konflux-env-for-version Use ART-injected env vars for version in Konflux builds --- konflux.Dockerfile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/konflux.Dockerfile b/konflux.Dockerfile index 00a3bd3c..d80bd929 100644 --- a/konflux.Dockerfile +++ b/konflux.Dockerfile @@ -7,13 +7,14 @@ FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_golang_1.25 COPY . /workspace WORKDIR /workspace -# Version information (OADP_VERSION avoids collision with Konflux-injected VERSION) -ARG OADP_VERSION=dev -ARG GIT_COMMIT=unknown - # Build release binaries for all platforms (CGO_ENABLED=0 for cross-platform # portability — CLI binaries run on user machines outside the FIPS boundary) +# +# Version info: prefer ART-injected BUILD_VERSION/SOURCE_GIT_COMMIT env vars +# (set by doozer in Konflux builds), fall back to defaults for local builds. RUN set -e && \ + OADP_VERSION="${BUILD_VERSION:-dev}" && \ + OADP_GIT_COMMIT="${SOURCE_GIT_COMMIT:-unknown}" && \ mkdir -p /archives && \ for platform in linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 windows/amd64 windows/arm64; do \ os=$(echo $platform | cut -d'/' -f1) && \ @@ -23,12 +24,12 @@ RUN set -e && \ else \ output="kubectl-oadp_${os}_${arch}"; \ fi && \ - echo "Building $output..." && \ + echo "Building $output (version=${OADP_VERSION})..." && \ CGO_ENABLED=0 GOOS=$os GOARCH=$arch \ go build -trimpath -mod=mod \ -ldflags="-s -w \ -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=${OADP_VERSION} \ - -X github.com/vmware-tanzu/velero/pkg/buildinfo.GitSHA=${GIT_COMMIT} \ + -X github.com/vmware-tanzu/velero/pkg/buildinfo.GitSHA=${OADP_GIT_COMMIT} \ -X github.com/vmware-tanzu/velero/pkg/buildinfo.GitTreeState=clean" \ -o /archives/$output \ . && \