Skip to content

Commit 8023398

Browse files
authored
chore: use sha for init container image (#1242)
For disconnected environment, OCP bundle should use only SHA format for container images.
2 parents 6c70c6e + 285645c commit 8023398

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ generate: $(CONTROLLER_GEN) ## Generate code
391391

392392
.PHONY: bundle
393393
bundle: $(OPERATOR_SDK) $(KUSTOMIZE) manifests ## Generate bundle manifests and metadata, then validate generated files.
394+
cd hack && $(GO) run release.go --with-sha256 --templateDir ./templates/config/manager --outputDir ../config/manager/
394395
$(OPERATOR_SDK) generate kustomize manifests -q
395396
cd config/manager && $(KUSTOMIZE) edit set image controller=$(TAG)
396397
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS)
@@ -412,7 +413,6 @@ release-build:
412413
cd hack && $(GO) run release.go --templateDir ./templates/samples/ --outputDir ../config/samples/
413414
cd hack && $(GO) run release.go --templateDir ./templates/crs/ --outputDir ../example/crs
414415
cd hack && $(GO) run release.go --templateDir ./templates/values/ --outputDir ../deployment/network-operator/
415-
cd hack && $(GO) run release.go --templateDir ./templates/config/manager --outputDir ../config/manager/
416416

417417
# dev environment
418418

bundle/manifests/nvidia-network-operator.clusterserviceversion.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ metadata:
8989
}
9090
]
9191
capabilities: Basic Install
92-
createdAt: "2025-01-05T08:32:23Z"
92+
createdAt: "2025-01-07T07:14:11Z"
9393
description: Deploy and manage NVIDIA networking resources in Kubernetes
9494
features.operators.openshift.io/cnf: "false"
9595
features.operators.openshift.io/cni: "true"
@@ -455,7 +455,7 @@ spec:
455455
- name: USE_DTK
456456
value: "true"
457457
- name: OFED_INIT_CONTAINER_IMAGE
458-
value: ghcr.io/mellanox/network-operator-init-container:v0.0.2
458+
value: ghcr.io/mellanox/network-operator-init-container@sha256:1699d23027ea30c9fa59575a914114bdfd5a87a359caf8c0a9b16d409ec0d068
459459
image: nvcr.io/nvstaging/mellanox/network-operator@sha256:e8de2ff64f2d2b6c19602b4a6817bbff4bfd4aaba0b73e7a60993f4d819c1bdf
460460
imagePullPolicy: IfNotPresent
461461
livenessProbe:

config/manager/init_container_image_name_patch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
path: "/spec/template/spec/containers/0/env/-"
33
value:
44
name: OFED_INIT_CONTAINER_IMAGE
5-
value: "ghcr.io/mellanox/network-operator-init-container:v0.0.2"
5+
value: "ghcr.io/mellanox/network-operator-init-container@sha256:1699d23027ea30c9fa59575a914114bdfd5a87a359caf8c0a9b16d409ec0d068"

hack/templates/config/manager/init_container_image_name_patch.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
path: "/spec/template/spec/containers/0/env/-"
33
value:
44
name: OFED_INIT_CONTAINER_IMAGE
5-
value: "{{ .NetworkOperatorInitContainer.Repository }}/{{ .NetworkOperatorInitContainer.Image }}:{{ .NetworkOperatorInitContainer.Version }}"
5+
value: "{{ (imageAsSha .NetworkOperatorInitContainer) }}"

0 commit comments

Comments
 (0)