Skip to content

Commit f58895b

Browse files
committed
Merge branch 'master' into CMP-3846
2 parents 1dfff77 + 2bae8b1 commit f58895b

20 files changed

+283
-84
lines changed

.tekton/compliance-operator-bundle-dev-pull-request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ spec:
386386
- name: CACHI2_ARTIFACT
387387
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
388388
- name: ARGS
389-
value: "--project-name=openshift/compliance-operator --report --org=86a5b6bf-8aad-4842-ab41-e5c7358c202e"
389+
value: "--project-name=ComplianceAsCode/compliance-operator --report --org=86a5b6bf-8aad-4842-ab41-e5c7358c202e"
390390
runAfter:
391391
- build-image-index
392392
taskRef:

.tekton/compliance-operator-bundle-dev-push.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ spec:
383383
- name: CACHI2_ARTIFACT
384384
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
385385
- name: ARGS
386-
value: "--project-name=openshift/compliance-operator --report --org=86a5b6bf-8aad-4842-ab41-e5c7358c202e"
386+
value: "--project-name=ComplianceAsCode/compliance-operator --report --org=86a5b6bf-8aad-4842-ab41-e5c7358c202e"
387387
runAfter:
388388
- build-image-index
389389
taskRef:

.tekton/compliance-operator-dev-pull-request.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ metadata:
88
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
99
pipelinesascode.tekton.dev/cancel-in-progress: "true"
1010
pipelinesascode.tekton.dev/max-keep-runs: "3"
11-
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch == "master" && ( ".tekton/compliance-operator-dev-*.yaml".pathChanged() || "images/operator/***".pathChanged() || "images/redhat.repo".pathChanged() || "main.go".pathChanged() || "tools.go".pathChanged() || "pkg/**/*.go".pathChanged() || "cmd/**/*.go".pathChanged() || "version/***".pathChanged() || "config/***".pathChanged() || "*Makefile*".pathChanged() || "vendor/***".pathChanged() || "tests/***".pathChanged() || "LICENSE".pathChanged() )
11+
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch == "master" && ( ".tekton/compliance-operator-dev-*.yaml".pathChanged() || "images/operator/***".pathChanged() || "images/redhat.repo".pathChanged() || "main.go".pathChanged() || "tools.go".pathChanged() || "images/operator/Dockerfile".pathChanged() || "build/bin/*".pathChanged() || "pkg/**/*.go".pathChanged() || "cmd/**/*.go".pathChanged() || "version/***".pathChanged() || "config/***".pathChanged() || "*Makefile*".pathChanged() || "vendor/***".pathChanged() || "tests/***".pathChanged() || "LICENSE".pathChanged() )
1212
creationTimestamp:
1313
labels:
1414
appstudio.openshift.io/application: compliance-operator-dev
@@ -409,7 +409,7 @@ spec:
409409
- name: CACHI2_ARTIFACT
410410
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
411411
- name: ARGS
412-
value: "--project-name=openshift/compliance-operator --report --org=86a5b6bf-8aad-4842-ab41-e5c7358c202e"
412+
value: "--project-name=ComplianceAsCode/compliance-operator --report --org=86a5b6bf-8aad-4842-ab41-e5c7358c202e"
413413
runAfter:
414414
- build-image-index
415415
taskRef:

.tekton/compliance-operator-dev-push.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ metadata:
88
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
99
pipelinesascode.tekton.dev/cancel-in-progress: "false"
1010
pipelinesascode.tekton.dev/max-keep-runs: "3"
11-
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch == "master" && ( ".tekton/compliance-operator-dev-*.yaml".pathChanged() || "images/operator/***".pathChanged() || "images/redhat.repo".pathChanged() || "main.go".pathChanged() || "tools.go".pathChanged() || "pkg/**/*.go".pathChanged() || "cmd/**/*.go".pathChanged() || "version/***".pathChanged() || "config/***".pathChanged() || "*Makefile*".pathChanged() || "vendor/***".pathChanged() || "tests/***".pathChanged() || "LICENSE".pathChanged() )
11+
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch == "master" && ( ".tekton/compliance-operator-dev-*.yaml".pathChanged() || "images/operator/***".pathChanged() || "images/redhat.repo".pathChanged() || "main.go".pathChanged() || "tools.go".pathChanged() || "images/operator/Dockerfile".pathChanged() || "build/bin/*".pathChanged() || "pkg/**/*.go".pathChanged() || "cmd/**/*.go".pathChanged() || "version/***".pathChanged() || "config/***".pathChanged() || "*Makefile*".pathChanged() || "vendor/***".pathChanged() || "tests/***".pathChanged() || "LICENSE".pathChanged() )
1212
creationTimestamp:
1313
labels:
1414
appstudio.openshift.io/application: compliance-operator-dev
@@ -407,7 +407,7 @@ spec:
407407
- name: CACHI2_ARTIFACT
408408
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
409409
- name: ARGS
410-
value: "--project-name=openshift/compliance-operator --report --org=86a5b6bf-8aad-4842-ab41-e5c7358c202e"
410+
value: "--project-name=ComplianceAsCode/compliance-operator --report --org=86a5b6bf-8aad-4842-ab41-e5c7358c202e"
411411
runAfter:
412412
- build-image-index
413413
taskRef:

.tekton/compliance-operator-must-gather-dev-pull-request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ spec:
409409
- name: CACHI2_ARTIFACT
410410
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
411411
- name: ARGS
412-
value: "--project-name=openshift/compliance-operator --report --org=86a5b6bf-8aad-4842-ab41-e5c7358c202e"
412+
value: "--project-name=ComplianceAsCode/compliance-operator --report --org=86a5b6bf-8aad-4842-ab41-e5c7358c202e"
413413
runAfter:
414414
- build-image-index
415415
taskRef:

.tekton/compliance-operator-must-gather-dev-push.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ spec:
407407
- name: CACHI2_ARTIFACT
408408
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
409409
- name: ARGS
410-
value: "--project-name=openshift/compliance-operator --report --org=86a5b6bf-8aad-4842-ab41-e5c7358c202e"
410+
value: "--project-name=ComplianceAsCode/compliance-operator --report --org=86a5b6bf-8aad-4842-ab41-e5c7358c202e"
411411
runAfter:
412412
- build-image-index
413413
taskRef:

Dockerfile.ci

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Step one: build compliance-operator
2-
FROM registry.ci.openshift.org/openshift/release:rhel-9-release-golang-1.23-openshift-4.19 AS builder
2+
FROM registry.ci.openshift.org/openshift/release:rhel-9-release-golang-1.25-openshift-4.21 AS builder
33

44
WORKDIR /go/src/github.com/openshift/compliance-operator
55

@@ -12,16 +12,13 @@ RUN make manager
1212
# Step two: containerize compliance-operator
1313
FROM registry.access.redhat.com/ubi9/ubi-micro:latest
1414

15-
ENV OPERATOR=/usr/local/bin/compliance-operator \
16-
USER_UID=1001 \
17-
USER_NAME=compliance-operator
15+
ENV OPERATOR=/usr/local/bin/compliance-operator
1816

1917
# install operator binary
2018
COPY --from=builder /go/src/github.com/openshift/compliance-operator/build/_output/bin/compliance-operator ${OPERATOR}
2119

22-
COPY build/bin /usr/local/bin
23-
RUN /usr/local/bin/user_setup
20+
COPY build/bin/entrypoint /usr/local/bin/entrypoint
2421

2522
ENTRYPOINT ["/usr/local/bin/entrypoint"]
2623

27-
USER ${USER_UID}
24+
USER 1001

OWNERS

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ approvers:
55
- xiaojiey
66
- Vincent056
77
- rhmdnd
8-
- BhargaviGudi
98
- yuumasato
9+
- taimurhafeez
10+
- Anna-Koudelkova
1011
reviewers:
1112
- jhrozek
1213
- mrogers950
1314
- xiaojiey
1415
- Vincent056
1516
- rhmdnd
16-
- BhargaviGudi
1717
- yuumasato
18+
- taimurhafeez
19+
- Anna-Koudelkova

build/Dockerfile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Step one: build compliance-operator
2-
FROM golang:1.23 AS builder
2+
FROM golang:1.25 AS builder
33

44
WORKDIR /go/src/github.com/openshift/compliance-operator
55

@@ -11,16 +11,13 @@ RUN make manager
1111
# Step two: containerize compliance-operator
1212
FROM registry.access.redhat.com/ubi9/ubi-micro:latest
1313

14-
ENV OPERATOR=/usr/local/bin/compliance-operator \
15-
USER_UID=1001 \
16-
USER_NAME=compliance-operator
14+
ENV OPERATOR=/usr/local/bin/compliance-operator
1715

1816
# install operator binary
1917
COPY --from=builder /go/src/github.com/openshift/compliance-operator/build/_output/bin/compliance-operator ${OPERATOR}
2018

21-
COPY build/bin /usr/local/bin
22-
RUN /usr/local/bin/user_setup
19+
COPY build/bin/entrypoint /usr/local/bin/entrypoint
2320

2421
ENTRYPOINT ["/usr/local/bin/entrypoint"]
2522

26-
USER ${USER_UID}
23+
USER 1001

build/bin/entrypoint

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
#!/bin/sh -e
22

33
# This is documented here:
4-
# https://docs.openshift.com/container-platform/3.11/creating_images/guidelines.html#openshift-specific-guidelines
4+
# https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/images/creating-images#use-uid_create-images
55

6-
if ! whoami &>/dev/null; then
7-
if [ -w /etc/passwd ]; then
8-
echo "${USER_NAME:-compliance-operator}:x:$(id -u):$(id -g):${USER_NAME:-compliance-operator} user:${HOME}:/sbin/nologin" >> /etc/passwd
9-
fi
10-
fi
6+
# Since version 4.1 OCP supports arbitrary UIDs without requiring /etc/passwd entries
7+
# https://docs.redhat.com/en/documentation/openshift_container_platform/4.1/html/images/creating_images
8+
# The container runs with the UID assigned by the platform, with group 0 (root) membership
9+
# File permissions are managed through group ownership, not username lookups
1110

1211
exec ${OPERATOR} $@

0 commit comments

Comments
 (0)