diff --git a/cmd/flux/bootstrap_git.go b/cmd/flux/bootstrap_git.go index 243a8e3a..92485f34 100644 --- a/cmd/flux/bootstrap_git.go +++ b/cmd/flux/bootstrap_git.go @@ -69,6 +69,7 @@ type gitFlags struct { path flags.SafeRelativePath username string password string + silent bool } var gitArgs gitFlags @@ -79,6 +80,7 @@ func init() { bootstrapGitCmd.Flags().Var(&gitArgs.path, "path", "path relative to the repository root, when specified the cluster sync will be scoped to this path") bootstrapGitCmd.Flags().StringVarP(&gitArgs.username, "username", "u", "git", "basic authentication username") bootstrapGitCmd.Flags().StringVarP(&gitArgs.password, "password", "p", "", "basic authentication password") + bootstrapGitCmd.Flags().BoolVarP(&gitArgs.silent, "silent", "s", false, "assumes the deploy key is already setup, skips confirmation") bootstrapCmd.AddCommand(bootstrapGitCmd) } @@ -247,13 +249,16 @@ func promptPublicKey(ctx context.Context, secret corev1.Secret, _ sourcesecret.O } logger.Successf("public key: %s", strings.TrimSpace(ppk)) - prompt := promptui.Prompt{ - Label: "Please give the key access to your repository", - IsConfirm: true, - } - _, err := prompt.Run() - if err != nil { - return fmt.Errorf("aborting") + + if !gitArgs.silent { + prompt := promptui.Prompt{ + Label: "Please give the key access to your repository", + IsConfirm: true, + } + _, err := prompt.Run() + if err != nil { + return fmt.Errorf("aborting") + } } return nil } diff --git a/go.mod b/go.mod index 40074a26..6239bc98 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/fluxcd/pkg/ssh v0.0.5 github.com/fluxcd/pkg/untar v0.0.5 github.com/fluxcd/pkg/version v0.0.1 - github.com/fluxcd/source-controller/api v0.14.0 + github.com/fluxcd/source-controller/api v0.15.0 github.com/go-git/go-git/v5 v5.4.2 github.com/google/go-containerregistry v0.2.0 github.com/manifoldco/promptui v0.7.0 diff --git a/go.sum b/go.sum index 3bf133e2..6ef749a8 100644 --- a/go.sum +++ b/go.sum @@ -224,8 +224,9 @@ github.com/fluxcd/pkg/untar v0.0.5 h1:UGI3Ch1UIEIaqQvMicmImL1s9npQa64DJ/ozqHKB7g github.com/fluxcd/pkg/untar v0.0.5/go.mod h1:O6V9+rtl8c1mHBafgqFlJN6zkF1HS5SSYn7RpQJ/nfw= github.com/fluxcd/pkg/version v0.0.1 h1:/8asQoDXSThz3csiwi4Qo8Zb6blAxLXbtxNgeMJ9bCg= github.com/fluxcd/pkg/version v0.0.1/go.mod h1:WAF4FEEA9xyhngF8TDxg3UPu5fA1qhEYV8Pmi2Il01Q= -github.com/fluxcd/source-controller/api v0.14.0 h1:BiRhSF13RAcDzAi9k/HzOgzdobcDhEATYINr7Dn+wiE= github.com/fluxcd/source-controller/api v0.14.0/go.mod h1:P1pIkaoIsiCJ/NLC7IBXPb9XEime9NvA1WN4hZu2Of4= +github.com/fluxcd/source-controller/api v0.15.0 h1:EhuBZb+gLFbOWxX+UQzXqnAO0wUSViJEDcuVscmRoHc= +github.com/fluxcd/source-controller/api v0.15.0/go.mod h1:P1pIkaoIsiCJ/NLC7IBXPb9XEime9NvA1WN4hZu2Of4= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= diff --git a/manifests/bases/source-controller/kustomization.yaml b/manifests/bases/source-controller/kustomization.yaml index 13b22794..a5f84e86 100644 --- a/manifests/bases/source-controller/kustomization.yaml +++ b/manifests/bases/source-controller/kustomization.yaml @@ -1,8 +1,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: -- https://github.com/fluxcd/source-controller/releases/download/v0.14.0/source-controller.crds.yaml -- https://github.com/fluxcd/source-controller/releases/download/v0.14.0/source-controller.deployment.yaml +- https://github.com/fluxcd/source-controller/releases/download/v0.15.0/source-controller.crds.yaml +- https://github.com/fluxcd/source-controller/releases/download/v0.15.0/source-controller.deployment.yaml - account.yaml patchesJson6902: - target: diff --git a/manifests/crds/kustomization.yaml b/manifests/crds/kustomization.yaml index e991b582..f0cf5fc0 100644 --- a/manifests/crds/kustomization.yaml +++ b/manifests/crds/kustomization.yaml @@ -1,7 +1,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: -- https://github.com/fluxcd/source-controller/releases/download/v0.14.0/source-controller.crds.yaml +- https://github.com/fluxcd/source-controller/releases/download/v0.15.0/source-controller.crds.yaml - https://github.com/fluxcd/kustomize-controller/releases/download/v0.13.0/kustomize-controller.crds.yaml - https://github.com/fluxcd/helm-controller/releases/download/v0.11.0/helm-controller.crds.yaml - https://github.com/fluxcd/notification-controller/releases/download/v0.15.0/notification-controller.crds.yaml