@@ -32,6 +32,7 @@ assert_contains(
3232oci_push (
3333 name = "push_image" ,
3434 image = ":image" ,
35+ remote_tags = ["tag1" ],
3536 repository = "localhost:1338/image" ,
3637 visibility = ["//visibility:public" ],
3738)
@@ -45,6 +46,15 @@ mirror_image(
4546 visibility = ["//visibility:public" ],
4647)
4748
49+ mirror_image (
50+ name = "image_mirror_with_tag" ,
51+ digest = "sha256:b812c0570a7c369b2863c64e22760dc1b1dbc025a739f02db376bac62862f4cc" ,
52+ dst_prefix = "localhost:1338/mirror2" ,
53+ src_image = "localhost:1338/image:tag1" ,
54+ tags = ["manual" ], # test should be tagged manual since it requires a running registry
55+ visibility = ["//visibility:public" ],
56+ )
57+
4858kustomize (
4959 name = "kustomize1" ,
5060 images = [
@@ -105,13 +115,13 @@ k8s_deploy_rg(
105115assert_contains (
106116 name = "adobe_gitops_deploy_has_mirrored_image" ,
107117 actual = ":adobe_gitops_deploy" ,
108- expected = "image: localhost:1338/mirror/localhost/1338 /image@sha256:b812c0570a7c369b2863c64e22760dc1b1dbc025a739f02db376bac62862f4cc" ,
118+ expected = "image: localhost:1338/mirror/localhost1338 /image@sha256:b812c0570a7c369b2863c64e22760dc1b1dbc025a739f02db376bac62862f4cc" ,
109119)
110120
111121assert_contains (
112122 name = "fasterci_gitops_deploy_has_mirrored_image" ,
113123 actual = ":fasterci_gitops_deploy" ,
114- expected = "image: localhost:1338/mirror/localhost/1338 /image@sha256:b812c0570a7c369b2863c64e22760dc1b1dbc025a739f02db376bac62862f4cc" ,
124+ expected = "image: localhost:1338/mirror/localhost1338 /image@sha256:b812c0570a7c369b2863c64e22760dc1b1dbc025a739f02db376bac62862f4cc" ,
115125)
116126
117127exports_files ([
@@ -159,7 +169,7 @@ sh_test(
159169 name = "adobe_gitops_apply_test" ,
160170 srcs = ["gitops_setup_test.sh" ],
161171 args = [
162- "$(location :adobe_gitops_deploy.apply) localhost:1338/mirror/localhost/1338 /image@sha256:b812c0570a7c369b2863c64e22760dc1b1dbc025a739f02db376bac62862f4cc" ,
172+ "$(location :adobe_gitops_deploy.apply) localhost:1338/mirror/localhost1338 /image@sha256:b812c0570a7c369b2863c64e22760dc1b1dbc025a739f02db376bac62862f4cc" ,
163173 ],
164174 data = [
165175 ":adobe_gitops_deploy.apply" ,
@@ -195,7 +205,7 @@ sh_test(
195205 name = "fasterci_gitops_setup_test" ,
196206 srcs = ["gitops_setup_test.sh" ],
197207 args = [
198- "$(location :fasterci_gitops.setup) localhost:1338/mirror/localhost/1338 /image@sha256:b812c0570a7c369b2863c64e22760dc1b1dbc025a739f02db376bac62862f4cc" ,
208+ "$(location :fasterci_gitops.setup) localhost:1338/mirror/localhost1338 /image@sha256:b812c0570a7c369b2863c64e22760dc1b1dbc025a739f02db376bac62862f4cc" ,
199209 ],
200210 data = [
201211 ":fasterci_gitops.setup" ,
@@ -220,7 +230,7 @@ sh_test(
220230 name = "fasterci_gitops_apply_test" ,
221231 srcs = ["gitops_setup_test.sh" ],
222232 args = [
223- "$(location :fasterci_gitops_deploy.apply) localhost:1338/mirror/localhost/1338 /image@sha256:b812c0570a7c369b2863c64e22760dc1b1dbc025a739f02db376bac62862f4cc" ,
233+ "$(location :fasterci_gitops_deploy.apply) localhost:1338/mirror/localhost1338 /image@sha256:b812c0570a7c369b2863c64e22760dc1b1dbc025a739f02db376bac62862f4cc" ,
224234 ],
225235 data = [
226236 ":fasterci_gitops_deploy.apply" ,
@@ -237,3 +247,47 @@ sh_test(
237247 },
238248 tags = ["exclusive" ], # this test starts a registry on fixed port 1338
239249)
250+
251+ sh_test (
252+ name = "image_mirror_with_tag_test" ,
253+ srcs = ["gitops_setup_test.sh" ],
254+ args = [
255+ "$(location :image_mirror_with_tag) localhost:1338/mirror2/localhost1338/image@sha256:b812c0570a7c369b2863c64e22760dc1b1dbc025a739f02db376bac62862f4cc" ,
256+ ],
257+ data = [
258+ ":image_mirror_with_tag" ,
259+ ":kubectl" ,
260+ ":push_image" ,
261+ "@com_github_google_go_containerregistry//cmd/crane" ,
262+ "@com_github_google_go_containerregistry//cmd/registry" ,
263+ ],
264+ env = {
265+ "KUBECTL" : "$(location :kubectl)" ,
266+ "PUSH_IMAGE" : "$(location :push_image)" ,
267+ "CRANE_BIN" : "$(location @com_github_google_go_containerregistry//cmd/crane)" ,
268+ "REGISTRY_BIN" : "$(location @com_github_google_go_containerregistry//cmd/registry)" ,
269+ },
270+ tags = ["exclusive" ], # this test starts a registry on fixed port 1338
271+ )
272+
273+ sh_test (
274+ name = "image_mirror_with_tag_test2" ,
275+ srcs = ["gitops_setup_test.sh" ],
276+ args = [
277+ "$(location :image_mirror_with_tag) localhost:1338/mirror2/localhost1338/image:tag1" ,
278+ ],
279+ data = [
280+ ":image_mirror_with_tag" ,
281+ ":kubectl" ,
282+ ":push_image" ,
283+ "@com_github_google_go_containerregistry//cmd/crane" ,
284+ "@com_github_google_go_containerregistry//cmd/registry" ,
285+ ],
286+ env = {
287+ "KUBECTL" : "$(location :kubectl)" ,
288+ "PUSH_IMAGE" : "$(location :push_image)" ,
289+ "CRANE_BIN" : "$(location @com_github_google_go_containerregistry//cmd/crane)" ,
290+ "REGISTRY_BIN" : "$(location @com_github_google_go_containerregistry//cmd/registry)" ,
291+ },
292+ tags = ["exclusive" ], # this test starts a registry on fixed port 1338
293+ )
0 commit comments