From 5a48117e91f901a9a76ae91e1bde879a7c6fe9cb Mon Sep 17 00:00:00 2001 From: Jerry Jackson Date: Fri, 21 May 2021 16:32:34 -0600 Subject: [PATCH] dry run was missing secret creation within source manifest generation --- pkg/cmdimpl/add.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pkg/cmdimpl/add.go b/pkg/cmdimpl/add.go index c44d7f4599..19e7591e4f 100644 --- a/pkg/cmdimpl/add.go +++ b/pkg/cmdimpl/add.go @@ -106,9 +106,12 @@ func generateWegoSourceManifest() []byte { fluxRepoName, params.PrivateKey, params.Namespace) - fmt.Println("debug3", cmd) - _, err = fluxops.CallFlux(cmd) - checkAddError(err) + if params.DryRun { + fmt.Printf(cmd + "\n") + } else { + _, err = fluxops.CallFlux(cmd) + checkAddError(err) + } cmd = fmt.Sprintf(`create source git "wego" \ --url="ssh://git@github.com/%s/%s" \ @@ -121,7 +124,6 @@ func generateWegoSourceManifest() []byte { fluxRepoName, params.Branch, params.Namespace) - fmt.Println("debug2", cmd) sourceManifest, err := fluxops.CallFlux(cmd) checkAddError(err) return sourceManifest @@ -153,8 +155,12 @@ func generateSourceManifest() []byte { params.Url, params.PrivateKey, params.Namespace) - _, err := fluxops.CallFlux(cmd) - checkAddError(err) + if params.DryRun { + fmt.Printf(cmd + "\n") + } else { + _, err := fluxops.CallFlux(cmd) + checkAddError(err) + } cmd = fmt.Sprintf(`create source git "%s" \ --url="%s" \ @@ -168,14 +174,12 @@ func generateSourceManifest() []byte { params.Branch, secretName, params.Namespace) - fmt.Println("debug1", cmd) sourceManifest, err := fluxops.CallFlux(cmd) checkAddError(err) return sourceManifest } func generateKustomizeManifest() []byte { - cmd := fmt.Sprintf(`create kustomization "%s" \ --path="%s" \ --source="%s" \