Merge pull request #434 from fluxcd/target-namespace-ks

Add target namespace to create ks cmd
pull/435/head
Stefan Prodan 4 years ago committed by GitHub
commit 1911766b7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -83,6 +83,7 @@ var (
ksSANamespace string ksSANamespace string
ksDecryptionProvider flags.DecryptionProvider ksDecryptionProvider flags.DecryptionProvider
ksDecryptionSecret string ksDecryptionSecret string
ksTargetNamespace string
) )
func init() { func init() {
@ -97,6 +98,7 @@ func init() {
createKsCmd.Flags().StringVar(&ksSANamespace, "sa-namespace", "", "service account namespace") 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")
createCmd.AddCommand(createKsCmd) createCmd.AddCommand(createKsCmd)
} }
@ -139,8 +141,9 @@ func createKsCmdRun(cmd *cobra.Command, args []string) error {
Kind: ksSource.Kind, Kind: ksSource.Kind,
Name: ksSource.Name, Name: ksSource.Name,
}, },
Suspend: false, Suspend: false,
Validation: ksValidation, Validation: ksValidation,
TargetNamespace: ksTargetNamespace,
}, },
} }

@ -55,6 +55,7 @@ flux create kustomization [name] [flags]
--sa-name string service account name --sa-name string service account name
--sa-namespace string service account namespace --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
--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