From 6705982d5388d744ee3fdfe00765ab0487aec977 Mon Sep 17 00:00:00 2001 From: Gergely Brautigam <182850+Skarlso@users.noreply.github.com> Date: Thu, 26 Oct 2023 07:25:07 +0200 Subject: [PATCH] fix: add external secrets as extra component --- cmd/release-bootstrap-component/main.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/release-bootstrap-component/main.go b/cmd/release-bootstrap-component/main.go index 660bcb4..bd8d317 100644 --- a/cmd/release-bootstrap-component/main.go +++ b/cmd/release-bootstrap-component/main.go @@ -102,8 +102,9 @@ func main() { } defer target.Close() + components := append([]string{env.ExternalSecretsName}, env.Components...) ctfPath := fmt.Sprintf("%s/%s", tmpDir, "ctf") - if err := releaseComponents(ctx, octx, token, tmpDir, ctfPath, target); err != nil { + if err := releaseComponents(ctx, octx, token, tmpDir, ctfPath, target, components); err != nil { fmt.Println("Failed to release components: ", err) os.Exit(1) } @@ -127,7 +128,7 @@ func main() { fmt.Println("Release of bootstrap component successful.") } -func releaseComponents(ctx context.Context, octx om.Context, token, tmpDir, ctfPath string, target om.Repository) error { +func releaseComponents(ctx context.Context, octx om.Context, token, tmpDir, ctfPath string, target om.Repository, components []string) error { // create transport archive ctf, err := ocm.CreateCTF(octx, ctfPath, accessio.FormatDirectory) if err != nil { @@ -139,7 +140,7 @@ func releaseComponents(ctx context.Context, octx om.Context, token, tmpDir, ctfP r := release.New(octx, username, token, tmpDir, repositoryURL, ctf) generatedComponents := make(map[string]*ocm.Component) - for _, comp := range env.Components { + for _, comp := range components { var component *ocm.Component switch comp { case env.OcmControllerName: @@ -193,6 +194,7 @@ func releaseComponents(ctx context.Context, octx om.Context, token, tmpDir, ctfP } generatedComponents[comp] = component } + for _, comp := range env.BinaryComponents { var component *ocm.Component switch comp { @@ -209,6 +211,7 @@ func releaseComponents(ctx context.Context, octx om.Context, token, tmpDir, ctfP os.Exit(1) } } + generatedComponents[comp] = component }