Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
fix: add external secrets as extra component
Browse files Browse the repository at this point in the history
  • Loading branch information
Skarlso committed Oct 26, 2023
1 parent 243c80c commit 6705982
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmd/release-bootstrap-component/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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 {
Expand All @@ -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:
Expand Down Expand Up @@ -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 {
Expand All @@ -209,6 +211,7 @@ func releaseComponents(ctx context.Context, octx om.Context, token, tmpDir, ctfP
os.Exit(1)
}
}

generatedComponents[comp] = component
}

Expand Down

0 comments on commit 6705982

Please sign in to comment.