Skip to content

Commit 85f9eb6

Browse files
jparrillclaude
andcommitted
fix(build): Add entitlement support for Konflux builds
Add subscription-manager and RHSM entitlement handling to Dockerfile.oadp and pass CONTAINER_SUB_MANAGER_OFF=1 build arg in Tekton pipelines to fix entitlement-related build failures in Konflux. Reference: openshift/hive#2367 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Juan Manuel Parrilla Madrid <jparrill@redhat.com>
1 parent 1ae944a commit 85f9eb6

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

.tekton/oadp-hypershift-oadp-plugin-main-pull-request.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ spec:
217217
- name: BUILD_ARGS
218218
value:
219219
- $(params.build-args[*])
220+
- CONTAINER_SUB_MANAGER_OFF=1
220221
- name: BUILD_ARGS_FILE
221222
value: $(params.build-args-file)
222223
- name: PRIVILEGED_NESTED

.tekton/oadp-hypershift-oadp-plugin-main-push.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ spec:
214214
- name: BUILD_ARGS
215215
value:
216216
- $(params.build-args[*])
217+
- CONTAINER_SUB_MANAGER_OFF=1
217218
- name: BUILD_ARGS_FILE
218219
value: $(params.build-args-file)
219220
- name: PRIVILEGED_NESTED

Dockerfile.oadp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
1+
ARG CONTAINER_SUB_MANAGER_OFF=0
2+
13
#@follow_tag(registry-proxy.engineering.redhat.com/rh-osbs/openshift-golang-builder:rhel_9_golang_1.25)
24
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_golang_1.25 AS builder
5+
ARG CONTAINER_SUB_MANAGER_OFF
6+
ENV SMDEV_CONTAINER_OFF=${CONTAINER_SUB_MANAGER_OFF}
37

48
COPY . /workspace
59
WORKDIR /workspace/
10+
11+
RUN unlink /etc/rhsm-host
12+
RUN if [ -e "/activation-key/org" ]; then subscription-manager register --org $(cat "/activation-key/org") --activationkey $(cat "/activation-key/activationkey"); fi
13+
614
ENV GOEXPERIMENT strictfipsruntime
715
RUN CGO_ENABLED=1 GOOS=linux go build -v -mod=vendor -tags strictfipsruntime -o /workspace/bin/hypershift-oadp-plugin .
816

917
#@follow_tag(registry.redhat.io/ubi9/ubi-minimal:latest)
1018
FROM registry.redhat.io/ubi9/ubi-minimal:latest
19+
ARG CONTAINER_SUB_MANAGER_OFF
20+
ENV SMDEV_CONTAINER_OFF=${CONTAINER_SUB_MANAGER_OFF}
21+
22+
RUN unlink /etc/rhsm-host
23+
RUN if [ -e "/activation-key/org" ]; then subscription-manager register --org $(cat "/activation-key/org") --activationkey $(cat "/activation-key/activationkey"); fi
24+
1125
RUN microdnf -y install openssl && microdnf -y reinstall tzdata && microdnf clean all
1226
RUN mkdir /plugins
1327
COPY --from=builder /workspace/bin/hypershift-oadp-plugin /plugins/

0 commit comments

Comments
 (0)