feat: allow prefix to image names
This is in order to support proxy/caching without
needing to maintain separate inventory override of
each and every image.
Closes-Bug: CLOUDOPS-761
Change-Id: I7585377939ac7e6757f1cdbcfcdffae02bab2715
(cherry picked from commit 26476249921e41b82926b2eec33a6f8d85e8769d)
diff --git a/roles/defaults/vars.go b/roles/defaults/vars.go
index 0799e7d..38b6b22 100644
--- a/roles/defaults/vars.go
+++ b/roles/defaults/vars.go
@@ -16,14 +16,13 @@
// Define a global variable for the release value.
var release = "main"
-// Function to replace the {{ release }} placeholders
-func replaceReleaseInYAML(yamlContent []byte, release string) []byte {
- return []byte(strings.ReplaceAll(string(yamlContent), "{{ atmosphere_release }}", release))
-}
-
func GetImages() (map[string]string, error) {
// Replace {{ release }} with the actual release value
- modifiedVarsFile := replaceReleaseInYAML(varsFile, release)
+ modifiedVarsFile := []byte(strings.ReplaceAll(string(varsFile), "{{ atmosphere_release }}", release))
+
+ // Fix prefixes for images to allow tests to run
+ modifiedVarsFile = []byte(strings.ReplaceAll(string(modifiedVarsFile), "{{ atmosphere_image_prefix }}registry.atmosphere.dev", "harbor.atmosphere.dev"))
+ modifiedVarsFile = []byte(strings.ReplaceAll(string(modifiedVarsFile), "{{ atmosphere_image_prefix }}", "harbor.atmosphere.dev/"))
path, err := yaml.PathString("$._atmosphere_images")
if err != nil {