Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boilerplate update #188

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build_root_image:
name: boilerplate
namespace: openshift
tag: image-v5.0.3
tag: image-v6.0.1
3 changes: 1 addition & 2 deletions OWNERS_ALIASES
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ aliases:
srep-functional-team-aurora:
- abyrne55
- dakotalongRH
- lnguyen1401
- joshbranham
- luis-falcon
- reedcort
srep-functional-team-fedramp:
Expand Down Expand Up @@ -74,7 +74,6 @@ aliases:
- Nikokolas3270
- theautoroboto
- bmeng
- mjlshen
- sam-nguyen7
- ravitri
- mmazur
Expand Down
2 changes: 1 addition & 1 deletion boilerplate/_data/backing-image-tag
Original file line number Diff line number Diff line change
@@ -1 +1 @@
image-v5.0.3
image-v6.0.1
2 changes: 1 addition & 1 deletion boilerplate/_data/last-boilerplate-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fd2674d43e7c364e2139cfb9da204991821ce727
8563add3b7f509de3b49ba04863d2708d965b489
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@ export REPLACE_FUNC=$(echo "$REPLACE_SPECNAME" | sed 's/ //g' )

mkdir -p $HARNESS_DIR

E2E_SUITE_BUILDER_IMAGE="registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.22-openshift-4.17"
if [[ -n ${KONFLUX_BUILDS} ]]; then
E2E_SUITE_BUILDER_IMAGE="brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.22"
Copy link

@tkong-redhat tkong-redhat Nov 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to make sure if Konflux build and normal build will use the same base image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tkong-redhat I would think so. These changes are from biolerplate updates, and I think some other operators have been promoted such as route monitor https://github.com/openshift/route-monitor-operator/blob/master/boilerplate/openshift/golang-osd-operator-osde2e/e2e-harness-generate.sh#L26

fi

echo "# THIS FILE IS GENERATED BY BOILERPLATE. DO NOT EDIT.
FROM ${E2E_SUITE_BUILDER_IMAGE} as builder
FROM registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.22-openshift-4.17 as builder
WORKDIR /go/src/github.com/openshift/$OPERATOR_NAME/
COPY . .
RUN CGO_ENABLED=0 GOFLAGS=\"-mod=mod\" go test ./osde2e -v -c --tags=osde2e -o /harness.test
Expand Down
17 changes: 17 additions & 0 deletions boilerplate/openshift/golang-osd-operator-osde2e/update
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -e

source $CONVENTION_ROOT/_lib/common.sh

# No PRE
[[ "$1" == "PRE" ]] && exit 0

# Expect POST
[[ "$1" == "POST" ]] || err "Got a parameter I don't understand: '$1'. Did the infrastructure change?"

DOCKERFILE=osde2e/Dockerfile
if [[ -n ${KONFLUX_BUILDS} && -f "${DOCKERFILE}" ]]; then
E2E_SUITE_BUILDER_IMAGE="brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_1.22"
${SED?} -i "2s,.*,FROM $E2E_SUITE_BUILDER_IMAGE AS builder," "${DOCKERFILE}"
fi
3 changes: 1 addition & 2 deletions boilerplate/openshift/golang-osd-operator/OWNERS_ALIASES
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ aliases:
srep-functional-team-aurora:
- abyrne55
- dakotalongRH
- lnguyen1401
- joshbranham
- luis-falcon
- reedcort
srep-functional-team-fedramp:
Expand Down Expand Up @@ -74,7 +74,6 @@ aliases:
- Nikokolas3270
- theautoroboto
- bmeng
- mjlshen
- sam-nguyen7
- ravitri
- mmazur
Expand Down
19 changes: 19 additions & 0 deletions boilerplate/openshift/golang-osd-operator/update
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,25 @@ if [[ -f ${REPO_ROOT}/.gitignore ]]; then
${SED?} -i "/Dockerfile.olm-registry/d" ${REPO_ROOT}/.gitignore
fi

OPERATOR_NAME=$(sed -n 's/.*OperatorName .*"\([^"]*\)".*/\1/p' "${REPO_ROOT}/config/config.go")

if [[ ! -f ${REPO_ROOT}/config/metadata/additional-labels.txt ]]; then
mkdir -p ${REPO_ROOT}/config/metadata
cat >${REPO_ROOT}/config/metadata/additional-labels.txt <<EOF
LABEL com.redhat.component="openshift-${OPERATOR_NAME}" \
io.k8s.description="..." \
description="..." \
distribution-scope="public" \
name="openshift/${OPERATOR_NAME}" \
url="https://github.com/openshift/${OPERATOR_NAME}" \
vendor="Red Hat, Inc." \
release="v0.0.0" \
version="v0.0.0"
EOF
fi

IMAGE_PULL_PATH="quay.io/redhat-services-prod/openshift/boilerplate:${LATEST_IMAGE_TAG}"

# Update Dockerfile builder image
DOCKERFILES=$(ls -1 $REPO_ROOT/build/Dockerfile*)
for file in $DOCKERFILES; do
Expand Down
4 changes: 2 additions & 2 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM quay.io/app-sre/boilerplate:image-v5.0.3 AS builder
FROM quay.io/redhat-services-prod/openshift/boilerplate:image-v6.0.1 AS builder

RUN mkdir -p /workdir
WORKDIR /workdir
Expand All @@ -8,7 +8,7 @@ COPY . .
RUN make go-build

####
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10-1086
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10-1130

ENV USER_UID=1001 \
USER_NAME=rbac-permissions-operator
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile.olm-registry
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ COPY ${SAAS_OPERATOR_DIR} manifests
RUN initializer --permissive

# ubi-micro does not work for clusters with fips enabled unless we make OpenSSL available
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10-1086
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10-1130

COPY --from=builder /bin/registry-server /bin/registry-server
COPY --from=builder /bin/grpc_health_probe /bin/grpc_health_probe
Expand Down
1 change: 1 addition & 0 deletions config/metadata/additional-labels.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LABEL com.redhat.component="openshift-rbac-permissions-operator" io.k8s.description="..." description="..." distribution-scope="public" name="openshift/rbac-permissions-operator" url="https://github.com/openshift/rbac-permissions-operator" vendor="Red Hat, Inc." release="v0.0.0" version="v0.0.0"