Skip to content

Commit

Permalink
Adjustments to support new sa name in kustomize
Browse files Browse the repository at this point in the history
Supporting changes in fluxcd/kustomize-controller#180

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
  • Loading branch information
relu committed Nov 20, 2020
1 parent 2a789ec commit 53a1db0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
9 changes: 2 additions & 7 deletions cmd/flux/create_kustomization.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ var (
ksHealthCheck []string
ksHealthTimeout time.Duration
ksSAName string
ksSANamespace string
ksDecryptionProvider flags.DecryptionProvider
ksDecryptionSecret string
ksTargetNamespace string
Expand All @@ -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().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(&ksSANamespace, "sa-namespace", "", "service account namespace")
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(&ksTargetNamespace, "target-namespace", "", "overrides the namespace of all Kustomization objects reconciled by this Kustomization")
Expand Down Expand Up @@ -189,11 +187,8 @@ func createKsCmdRun(cmd *cobra.Command, args []string) error {
}
}

if ksSAName != "" && ksSANamespace != "" {
kustomization.Spec.ServiceAccount = &kustomizev1.ServiceAccount{
Name: ksSAName,
Namespace: ksSANamespace,
}
if ksSAName != "" {
kustomization.Spec.ServiceAccountName = ksSAName
}

if ksDecryptionProvider != "" {
Expand Down
1 change: 0 additions & 1 deletion docs/cmd/flux_create_kustomization.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ flux create kustomization [name] [flags]
--path string path to the directory containing the Kustomization file (default "./")
--prune enable garbage collection
--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
--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'
Expand Down

0 comments on commit 53a1db0

Please # to comment.