14
14
BINDIR : bin
15
15
BINDIR_ABS :
16
16
sh : if [[ "{{.BINDIR}}" = /* ]]; then echo "{{.BINDIR}}"; else echo "$(pwd)/{{.BINDIR}}"; fi
17
- REGISTRY :
18
- sh : hostname | sed 's/$/:5000/'
17
+ HOST_CLUSTER_DOMAIN : ' {{ default "ocpcluster.redhat.com" .HOST_CLUSTER_DOMAIN }}'
18
+ DPU_CLUSTER_IP : ' {{ default "172.16.3.16" .DPU_CLUSTER_IP }}'
19
+ REGISTRY_HOST : ' {{ default (printf "default-route-openshift-image-registry.apps.%s/in-cluster-registry" .HOST_CLUSTER_DOMAIN) .REGISTRY_HOST }}'
20
+ REGISTRY_DPU : ' {{ default (printf "default-route-openshift-image-registry.apps.%s.nip.io/in-cluster-registry" .DPU_CLUSTER_IP) .REGISTRY_DPU }}'
21
+ REGISTRY : ' {{.REGISTRY_HOST}}'
19
22
ENVTEST_K8S_VERSION : 1.27.1
20
23
KUSTOMIZE_VERSION : v5.6.0
21
24
GINKGO_VERSION :
@@ -48,13 +51,52 @@ tasks:
48
51
cmds :
49
52
- echo "{{.BINDIR_ABS}}"
50
53
54
+ show-registry-config :
55
+ desc : " Show current registry configuration"
56
+ cmds :
57
+ - ' echo "Host Registry: {{.REGISTRY_HOST}}"'
58
+ - ' echo "DPU Registry: {{.REGISTRY_DPU}}"'
59
+ - ' echo "Default Registry: {{.REGISTRY}}"'
60
+
61
+ verify-registry-routes :
62
+ desc : " Verify registry routes match actual cluster routes (requires running clusters)"
63
+ cmds :
64
+ - |
65
+ echo "Verifying registry routes..."
66
+ echo "Expected host registry: {{.REGISTRY_HOST}}"
67
+ if oc get route default-route -n openshift-image-registry --kubeconfig /root/kubeconfig.ocpcluster &>/dev/null; then
68
+ ACTUAL_HOST=$(oc get route default-route -n openshift-image-registry --template='{{`{{ .spec.host }}`}}' --kubeconfig /root/kubeconfig.ocpcluster)
69
+ echo "Actual host registry: $ACTUAL_HOST"
70
+ if [ "{{.REGISTRY_HOST}}" = "$ACTUAL_HOST" ]; then
71
+ echo "Host registry matches"
72
+ else
73
+ echo "Host registry mismatch - consider setting HOST_CLUSTER_DOMAIN environment variable"
74
+ fi
75
+ else
76
+ echo "Host cluster not available or registry route not found"
77
+ fi
78
+
79
+ echo ""
80
+ echo "Expected DPU registry: {{.REGISTRY_DPU}}"
81
+ if oc get route default-route -n openshift-image-registry --kubeconfig /root/kubeconfig.microshift &>/dev/null; then
82
+ ACTUAL_DPU=$(oc get route default-route -n openshift-image-registry --template='{{`{{ .spec.host }}`}}' --kubeconfig /root/kubeconfig.microshift)
83
+ echo "Actual DPU registry: $ACTUAL_DPU"
84
+ if [ "{{.REGISTRY_DPU}}" = "$ACTUAL_DPU" ]; then
85
+ echo "DPU registry matches"
86
+ else
87
+ echo "DPU registry mismatch - consider setting DPU_CLUSTER_IP environment variable"
88
+ fi
89
+ else
90
+ echo "DPU cluster not available or registry route not found"
91
+ fi
92
+
51
93
push-image-helper :
52
94
internal : true
53
95
vars :
54
96
SOURCE : ' {{.SOURCE}}'
55
97
IMAGE : ' {{.IMAGE}}'
56
98
cmds :
57
- - buildah manifest push --all '{{.SOURCE}}-manifest' 'docker://{{.IMAGE}}'
99
+ - buildah manifest push --all --retry 3 --retry-delay 10s '{{.SOURCE}}-manifest' 'docker://{{.IMAGE}}'
58
100
59
101
undeploy-helper :
60
102
internal : true
@@ -95,12 +137,23 @@ tasks:
95
137
deps :
96
138
- task : kustomize
97
139
cmds :
140
+ - mkdir -p bin/host bin/dpu
98
141
- >
99
142
go run ./tools/config/config.go
100
- -registry-url {{.REGISTRY }}
143
+ -registry-url {{.REGISTRY_HOST }}
101
144
-template-file config/dev/local-images-template.yaml
102
- -output-file bin/local-images.yaml
103
- - cp config/dev/kustomization.yaml bin
145
+ -output-file bin/host/local-images.yaml
146
+ - >
147
+ go run ./tools/config/config.go
148
+ -registry-url {{.REGISTRY_DPU}}
149
+ -template-file config/dev/local-images-template.yaml
150
+ -output-file bin/dpu/local-images.yaml
151
+ - cp config/dev/kustomization.yaml bin/host/
152
+ - cp config/dev/kustomization.yaml bin/dpu/
153
+ - sed -i 's/local-images-template.yaml/local-images.yaml/' bin/host/kustomization.yaml
154
+ - sed -i 's/local-images-template.yaml/local-images.yaml/' bin/dpu/kustomization.yaml
155
+ - sed -i 's|../config/default|../../config/default|' bin/host/kustomization.yaml
156
+ - sed -i 's|../config/default|../../config/default|' bin/dpu/kustomization.yaml
104
157
105
158
# # Download envtest-setup locally if necessary
106
159
envtest :
@@ -118,8 +171,8 @@ tasks:
118
171
vars :
119
172
KUBECONFIG_DPU : " /root/kubeconfig.microshift"
120
173
KUBECONFIG_HOST : " /root/kubeconfig.ocpcluster"
121
- - bin/kustomize build bin | KUBECONFIG="/root/kubeconfig.microshift" oc apply -f -
122
- - bin/kustomize build bin | KUBECONFIG="/root/kubeconfig.ocpcluster" oc apply -f -
174
+ - bin/kustomize build bin/dpu | KUBECONFIG="/root/kubeconfig.microshift" oc apply -f -
175
+ - bin/kustomize build bin/host | KUBECONFIG="/root/kubeconfig.ocpcluster" oc apply -f -
123
176
- KUBECONFIG="/root/kubeconfig.microshift" oc -n openshift-dpu-operator wait --for=condition=ready pod --all --timeout=300s
124
177
- KUBECONFIG="/root/kubeconfig.ocpcluster" oc -n openshift-dpu-operator wait --for=condition=ready pod --all --timeout=300s
125
178
@@ -130,16 +183,21 @@ tasks:
130
183
- task : undeploy-1c
131
184
vars :
132
185
KUBECONFIG_HOST : " /root/kubeconfig.ocpcluster"
133
- - bin/kustomize build bin | KUBECONFIG="/root/kubeconfig.ocpcluster" oc apply -f -
186
+ - bin/kustomize build bin/host | KUBECONFIG="/root/kubeconfig.ocpcluster" oc apply -f -
134
187
- KUBECONFIG="/root/kubeconfig.ocpcluster" oc -n openshift-dpu-operator wait --for=condition=ready pod --all --timeout=300s
135
188
136
- prepare-e2e-test :
189
+ ensure-test-images-in-both-registries :
190
+ desc : " Ensure test images are available in both registries"
137
191
cmds :
138
- - >
139
- if [ "{{.SUBMODULES}}" = "true" ]; then
140
- hack/prepare-submodules.sh
141
- fi
142
- hack/prepare-venv.sh
192
+ - |
193
+ echo "Ensuring test images are available in both registries..."
194
+ skopeo copy --dest-tls-verify=false \
195
+ docker://ghcr.io/ovn-kubernetes/kubernetes-traffic-flow-tests:latest \
196
+ docker://{{.REGISTRY_HOST}}/kubernetes-traffic-flow-tests:latest
197
+ skopeo copy --dest-tls-verify=false \
198
+ docker://ghcr.io/ovn-kubernetes/kubernetes-traffic-flow-tests:latest \
199
+ docker://{{.REGISTRY_DPU}}/kubernetes-traffic-flow-tests:latest
200
+ echo "Test images copied to both registries"
143
201
144
202
e2e-test :
145
203
deps :
@@ -159,6 +217,7 @@ tasks:
159
217
- task : ginkgo
160
218
- task : envtest
161
219
cmds :
220
+ - task : ensure-test-images-in-both-registries
162
221
- >
163
222
FAST_TEST=true
164
223
REGISTRY={{.REGISTRY}}
0 commit comments