Skip to content

Commit 260e404

Browse files
authored
add supported OpenShift versions (#2252)
1 parent 844edff commit 260e404

File tree

4 files changed

+22
-17
lines changed

4 files changed

+22
-17
lines changed

.github/actions/gen-install-scripts/entrypoint.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,22 @@ which kustomize
3737
kustomize version
3838

3939
# all-in-one
40-
kustomize build --load-restrictor LoadRestrictionsNone "config/release/${INPUT_ENV}/allinone" > "${target_dir}/all-in-one.yaml"
40+
kustomize build --load-restrictor LoadRestrictionsNone "config/release/${INPUT_ENV}/allinone" >"${target_dir}/all-in-one.yaml"
4141
echo "Created all-in-one config"
4242

4343
# clusterwide
44-
kustomize build --load-restrictor LoadRestrictionsNone "config/release/${INPUT_ENV}/clusterwide" > "${clusterwide_dir}/clusterwide-config.yaml"
45-
kustomize build "config/crd" > "${clusterwide_dir}/crds.yaml"
44+
kustomize build --load-restrictor LoadRestrictionsNone "config/release/${INPUT_ENV}/clusterwide" >"${clusterwide_dir}/clusterwide-config.yaml"
45+
kustomize build "config/crd" >"${clusterwide_dir}/crds.yaml"
4646
echo "Created clusterwide config"
4747

4848
# base-openshift-namespace-scoped
49-
kustomize build --load-restrictor LoadRestrictionsNone "config/release/${INPUT_ENV}/openshift" > "${openshift}/openshift.yaml"
50-
kustomize build "config/crd" > "${openshift}/crds.yaml"
49+
kustomize build --load-restrictor LoadRestrictionsNone "config/release/${INPUT_ENV}/openshift" >"${openshift}/openshift.yaml"
50+
kustomize build "config/crd" >"${openshift}/crds.yaml"
5151
echo "Created openshift namespaced config"
5252

5353
# namespaced
54-
kustomize build --load-restrictor LoadRestrictionsNone "config/release/${INPUT_ENV}/namespaced" > "${namespaced_dir}/namespaced-config.yaml"
55-
kustomize build "config/crd" > "${namespaced_dir}/crds.yaml"
54+
kustomize build --load-restrictor LoadRestrictionsNone "config/release/${INPUT_ENV}/namespaced" >"${namespaced_dir}/namespaced-config.yaml"
55+
kustomize build "config/crd" >"${namespaced_dir}/crds.yaml"
5656
echo "Created namespaced config"
5757

5858
# crds
@@ -71,20 +71,20 @@ if [[ "${INPUT_ENV}" == "dev" ]]; then
7171
operator-sdk generate bundle -q --overwrite --default-channel="${channel}" --channels="${channel}"
7272
else
7373
echo "build release version"
74-
echo "${INPUT_IMAGE_URL}"
74+
echo "${INPUT_IMAGE_URL}"
7575
kustomize build --load-restrictor LoadRestrictionsNone config/manifests |
7676
operator-sdk generate bundle -q --overwrite --version "${INPUT_VERSION}" --default-channel="${channel}" --channels="${channel}"
7777
# add replaces
78-
awk '!/replaces:/' bundle/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml > tmp && mv tmp bundle/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml
79-
echo " replaces: $current_version" >> bundle/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml
78+
awk '!/replaces:/' bundle/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml >tmp && mv tmp bundle/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml
79+
echo " replaces: $current_version" >>bundle/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml
8080
# Add WATCH_NAMESPACE env parameter
8181
value="metadata.annotations['olm.targetNamespaces']" yq e -i '.spec.install.spec.deployments[0].spec.template.spec.containers[0].env[2] |= {"name": "WATCH_NAMESPACE", "valueFrom": {"fieldRef": {"fieldPath": env(value)}}}' bundle/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml
8282
# Add containerImage to bundle/manifests/ csv. containerImage - The full location (registry, repository, name and tag) of the operator image
8383
yq e -i ".metadata.annotations.containerImage=\"${INPUT_IMAGE_URL}\"" bundle/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml
8484
fi
8585

8686
# add additional LABELs to bundle.Docker file
87-
label="LABEL com.redhat.openshift.versions=\"v4.8\"\nLABEL com.redhat.delivery.backport=true\nLABEL com.redhat.delivery.operator.bundle=true"
88-
awk -v rep="FROM scratch\n\n$label" '{sub(/FROM scratch/, rep); print}' bundle.Dockerfile > tmp && mv tmp bundle.Dockerfile
87+
label="LABEL com.redhat.openshift.versions=\"v4.8-v4.18\"\nLABEL com.redhat.delivery.backport=true\nLABEL com.redhat.delivery.operator.bundle=true"
88+
awk -v rep="FROM scratch\n\n$label" '{sub(/FROM scratch/, rep); print}' bundle.Dockerfile >tmp && mv tmp bundle.Dockerfile
8989

9090
operator-sdk bundle validate ./bundle

bundle.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM scratch
22

3-
LABEL com.redhat.openshift.versions="v4.8"
3+
LABEL com.redhat.openshift.versions="v4.8-4.18"
44
LABEL com.redhat.delivery.backport=true
55
LABEL com.redhat.delivery.operator.bundle=true
66

docs/dev/ci.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,12 @@ Adjust the `matrix` variable in the above workflow to match the desired Kubernet
108108

109109
Additionally, adjust the `ENVTEST_K8S_VERSION` variable in the `Makefile` as well.
110110

111-
Finally, adjust the minimum Kubernetes version ("1.27.1" in the above example) in the [Atlas Kubernetes CLI repository](https://github.com/mongodb/atlas-cli-plugin-kubernetes] plugin) as well. Here, a Kubernetes cluster is being created for e2e tests programmatically. Bump and adjust the Kubernetes version in its `go.mod` file: https://github.com/mongodb/atlas-cli-plugin-kubernetes/blob/d34c4b18930b0cd77dc6013d52669161edb224d5/go.mod#L32 for the kind version and https://github.com/mongodb/atlas-cli-plugin-kubernetes/blob/d5b2610dd50e312e315b63d1bfd0d7dde244b262/test/e2e/operator_helper_test.go#L91-L98 for the actual Kubernetes version.
111+
Adjust the minimum Kubernetes version ("1.27.1" in the above example) in the [Atlas Kubernetes CLI repository](https://github.com/mongodb/atlas-cli-plugin-kubernetes] plugin) as well. Here, a Kubernetes cluster is being created for e2e tests programmatically. Bump and adjust the Kubernetes version in its `go.mod` file: https://github.com/mongodb/atlas-cli-plugin-kubernetes/blob/d34c4b18930b0cd77dc6013d52669161edb224d5/go.mod#L32 for the kind version and https://github.com/mongodb/atlas-cli-plugin-kubernetes/blob/d5b2610dd50e312e315b63d1bfd0d7dde244b262/test/e2e/operator_helper_test.go#L91-L98 for the actual Kubernetes version.
112+
113+
Finally, adjust the `com.redhat.openshift.versions` setting in all relevant files to reflect the currently supported OpenShift versions, most notably:
114+
- `scripts/release-redhat-certified.sh`
115+
- `.github/actions/gen-install-scripts/entrypoint.sh`
116+
- `bundle.Dockerfile`
112117

113118
### Test Variants
114119

scripts/release-redhat-certified.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ set -eou pipefail
1818

1919
echo -n "Determining SHA for arm64 ... "
2020
IMG_SHA_ARM64=$(docker \
21-
manifest inspect quay.io/mongodb/mongodb-atlas-kubernetes-operator:${VERSION}-certified | \
21+
manifest inspect quay.io/mongodb/mongodb-atlas-kubernetes-operator:${VERSION}-certified |
2222
jq --raw-output '.manifests[] | select(.platform.architecture == "arm64") | .digest')
2323
echo ${IMG_SHA_ARM64}
2424

2525
echo -n "Determining SHA for amd64 ... "
2626
IMG_SHA_AMD64=$(docker \
27-
manifest inspect quay.io/mongodb/mongodb-atlas-kubernetes-operator:${VERSION}-certified | \
27+
manifest inspect quay.io/mongodb/mongodb-atlas-kubernetes-operator:${VERSION}-certified |
2828
jq --raw-output '.manifests[] | select(.platform.architecture == "amd64") | .digest')
2929
echo ${IMG_SHA_AMD64}
3030

@@ -60,7 +60,7 @@ value="${IMG_SHA_AMD64}" yq e -i '.metadata.annotations.containerImage = "quay.i
6060
"${REPO}/${VERSION}"/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml
6161

6262
# set openshift versions
63-
yq e -i '.annotations = .annotations + { "com.redhat.openshift.versions": "v4.8" }' \
63+
yq e -i '.annotations = .annotations + { "com.redhat.openshift.versions": "v4.8-v4.18" }' \
6464
"${REPO}/${VERSION}"/metadata/annotations.yaml
6565

6666
cd "${REPO}"

0 commit comments

Comments
 (0)