diff --git a/pkg/combustion/registry.go b/pkg/combustion/registry.go index 79fc8da8..bfba8659 100644 --- a/pkg/combustion/registry.go +++ b/pkg/combustion/registry.go @@ -36,9 +36,6 @@ const ( ) var ( - //go:embed templates/hauler-manifest.yaml.tpl - haulerManifest string - //go:embed templates/26-embedded-registry.sh.tpl registryScript string @@ -74,25 +71,6 @@ func configureRegistry(ctx *image.Context) ([]string, error) { return []string{script}, nil } -func writeHaulerManifest(ctx *image.Context, images []string) error { - haulerManifestYamlFile := filepath.Join(ctx.BuildDir, haulerManifestYamlName) - haulerDef := struct { - ContainerImages []string - }{ - ContainerImages: images, - } - data, err := template.Parse(haulerManifestYamlName, haulerManifest, haulerDef) - if err != nil { - return fmt.Errorf("applying template to %s: %w", haulerManifestYamlName, err) - } - - if err = os.WriteFile(haulerManifestYamlFile, []byte(data), fileio.NonExecutablePerms); err != nil { - return fmt.Errorf("writing file %s: %w", haulerManifestYamlName, err) - } - - return nil -} - func addImageToHauler(ctx *image.Context, containerImage string) error { args := []string{"store", "add", "image", containerImage, "-p", fmt.Sprintf("linux/%s", ctx.ImageDefinition.Image.Arch.Short())} @@ -361,6 +339,7 @@ func registryArtefactsPath(ctx *image.Context) string { func populateRegistry(ctx *image.Context, images []string) error { bar := progressbar.Default(int64(len(images)), "Populating Embedded Artifact Registry...") + zap.S().Infof("Adding the following images to the embedded artifact registry:\n%s", images) for _, i := range images { if err := addImageToHauler(ctx, i); err != nil { diff --git a/pkg/combustion/registry_test.go b/pkg/combustion/registry_test.go index 85b76bdc..e9dfd839 100644 --- a/pkg/combustion/registry_test.go +++ b/pkg/combustion/registry_test.go @@ -11,33 +11,6 @@ import ( "github.com/suse-edge/edge-image-builder/pkg/registry" ) -func TestWriteHaulerManifestValidManifest(t *testing.T) { - // Setup - ctx, teardown := setupContext(t) - defer teardown() - - images := []string{ - "hello-world:latest", - "ghcr.io/fluxcd/flux-cli@sha256:02aa820c3a9c57d67208afcfc4bce9661658c17d15940aea369da259d2b976dd", - } - - // Test - err := writeHaulerManifest(ctx, images) - - // Verify - require.NoError(t, err) - - manifestFileName := filepath.Join(ctx.BuildDir, haulerManifestYamlName) - _, err = os.Stat(manifestFileName) - require.NoError(t, err) - - foundBytes, err := os.ReadFile(manifestFileName) - require.NoError(t, err) - found := string(foundBytes) - assert.Contains(t, found, "- name: hello-world:latest") - assert.Contains(t, found, "- name: ghcr.io/fluxcd/flux-cli@sha256:02aa820c3a9c57d67208afcfc4bce9661658c17d15940aea369da259d2b976dd") -} - func TestCreateRegistryCommand(t *testing.T) { // Setup ctx, teardown := setupContext(t) diff --git a/pkg/combustion/templates/hauler-manifest.yaml.tpl b/pkg/combustion/templates/hauler-manifest.yaml.tpl deleted file mode 100644 index a30007f8..00000000 --- a/pkg/combustion/templates/hauler-manifest.yaml.tpl +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: content.hauler.cattle.io/v1alpha1 -kind: Images -metadata: - name: embedded-registry-images -spec: - images: - {{- range .ContainerImages }} - - name: {{ . }} - {{- end }}