Adjustments to support new sa name in kustomize

Supporting changes in fluxcd/kustomize-controller#180

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
pull/474/head
Aurel Canciu 4 years ago
parent 2a789ec705
commit 53a1db0703
No known key found for this signature in database
GPG Key ID: AB25339971E6F81E

@ -81,7 +81,6 @@ var (
ksHealthCheck []string ksHealthCheck []string
ksHealthTimeout time.Duration ksHealthTimeout time.Duration
ksSAName string ksSAName string
ksSANamespace string
ksDecryptionProvider flags.DecryptionProvider ksDecryptionProvider flags.DecryptionProvider
ksDecryptionSecret string ksDecryptionSecret string
ksTargetNamespace string ksTargetNamespace string
@ -96,7 +95,6 @@ func init() {
createKsCmd.Flags().StringVar(&ksValidation, "validation", "", "validate the manifests before applying them on the cluster, can be 'client' or 'server'") createKsCmd.Flags().StringVar(&ksValidation, "validation", "", "validate the manifests before applying them on the cluster, can be 'client' or 'server'")
createKsCmd.Flags().StringArrayVar(&ksDependsOn, "depends-on", nil, "Kustomization that must be ready before this Kustomization can be applied, supported formats '<name>' and '<namespace>/<name>'") createKsCmd.Flags().StringArrayVar(&ksDependsOn, "depends-on", nil, "Kustomization that must be ready before this Kustomization can be applied, supported formats '<name>' and '<namespace>/<name>'")
createKsCmd.Flags().StringVar(&ksSAName, "sa-name", "", "service account name") createKsCmd.Flags().StringVar(&ksSAName, "sa-name", "", "service account name")
createKsCmd.Flags().StringVar(&ksSANamespace, "sa-namespace", "", "service account namespace")
createKsCmd.Flags().Var(&ksDecryptionProvider, "decryption-provider", ksDecryptionProvider.Description()) createKsCmd.Flags().Var(&ksDecryptionProvider, "decryption-provider", ksDecryptionProvider.Description())
createKsCmd.Flags().StringVar(&ksDecryptionSecret, "decryption-secret", "", "set the Kubernetes secret name that contains the OpenPGP private keys used for sops decryption") createKsCmd.Flags().StringVar(&ksDecryptionSecret, "decryption-secret", "", "set the Kubernetes secret name that contains the OpenPGP private keys used for sops decryption")
createKsCmd.Flags().StringVar(&ksTargetNamespace, "target-namespace", "", "overrides the namespace of all Kustomization objects reconciled by this Kustomization") createKsCmd.Flags().StringVar(&ksTargetNamespace, "target-namespace", "", "overrides the namespace of all Kustomization objects reconciled by this Kustomization")
@ -189,11 +187,8 @@ func createKsCmdRun(cmd *cobra.Command, args []string) error {
} }
} }
if ksSAName != "" && ksSANamespace != "" { if ksSAName != "" {
kustomization.Spec.ServiceAccount = &kustomizev1.ServiceAccount{ kustomization.Spec.ServiceAccountName = ksSAName
Name: ksSAName,
Namespace: ksSANamespace,
}
} }
if ksDecryptionProvider != "" { if ksDecryptionProvider != "" {

@ -53,7 +53,6 @@ flux create kustomization [name] [flags]
--path string path to the directory containing the Kustomization file (default "./") --path string path to the directory containing the Kustomization file (default "./")
--prune enable garbage collection --prune enable garbage collection
--sa-name string service account name --sa-name string service account name
--sa-namespace string service account namespace
--source kustomizationSource source that contains the Kubernetes manifests in the format '[<kind>/]<name>',where kind can be one of: (GitRepository, Bucket), if kind is not specified it defaults to GitRepository --source kustomizationSource source that contains the Kubernetes manifests in the format '[<kind>/]<name>',where kind can be one of: (GitRepository, Bucket), if kind is not specified it defaults to GitRepository
--target-namespace string overrides the namespace of all Kustomization objects reconciled by this Kustomization --target-namespace string overrides the namespace of all Kustomization objects reconciled by this Kustomization
--validation string validate the manifests before applying them on the cluster, can be 'client' or 'server' --validation string validate the manifests before applying them on the cluster, can be 'client' or 'server'

Loading…
Cancel
Save