@ -73,15 +73,17 @@ var createKsCmd = &cobra.Command{
}
}
var (
var (
ksSource string
ksSource string
ksPath string
ksPath string
ksPrune bool
ksPrune bool
ksDependsOn [ ] string
ksDependsOn [ ] string
ksValidation string
ksValidation string
ksHealthCheck [ ] string
ksHealthCheck [ ] string
ksHealthTimeout time . Duration
ksHealthTimeout time . Duration
ksSAName string
ksSAName string
ksSANamespace string
ksSANamespace string
ksDecryptionProvider string
ksDecryptionSecret string
)
)
func init ( ) {
func init ( ) {
@ -94,6 +96,8 @@ func init() {
createKsCmd . Flags ( ) . StringArrayVar ( & ksDependsOn , "depends-on" , nil , "Kustomization that must be ready before this Kustomization can be applied" )
createKsCmd . Flags ( ) . StringArrayVar ( & ksDependsOn , "depends-on" , nil , "Kustomization that must be ready before this Kustomization can be applied" )
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 ( ) . StringVar ( & ksSANamespace , "sa-namespace" , "" , "service account namespace" )
createKsCmd . Flags ( ) . StringVar ( & ksDecryptionProvider , "decryption-provider" , "" , "enables secrets decryption, provider can be 'sops'" )
createKsCmd . Flags ( ) . StringVar ( & ksDecryptionSecret , "decryption-secret" , "" , "set the Kubernetes secret name that contains the OpenPGP private keys used for sops decryption" )
createCmd . AddCommand ( createKsCmd )
createCmd . AddCommand ( createKsCmd )
}
}
@ -178,6 +182,21 @@ func createKsCmdRun(cmd *cobra.Command, args []string) error {
}
}
}
}
if ksDecryptionProvider != "" {
if ! utils . containsItemString ( supportedDecryptionProviders , ksDecryptionProvider ) {
return fmt . Errorf ( "decryption provider %s is not supported, can be %v" ,
ksDecryptionProvider , supportedDecryptionProviders )
}
kustomization . Spec . Decryption = & kustomizev1 . Decryption {
Provider : ksDecryptionProvider ,
}
if ksDecryptionSecret != "" {
kustomization . Spec . Decryption . SecretRef = & corev1 . LocalObjectReference { Name : ksDecryptionSecret }
}
}
if export {
if export {
return exportKs ( kustomization )
return exportKs ( kustomization )
}
}