mirror of
https://github.com/fluxcd/flux2.git
synced 2026-04-24 12:28:52 +00:00
Add service account arg to create commands
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
parent
5e51f51449
commit
d2df9ccf33
4 changed files with 11 additions and 4 deletions
|
|
@ -107,6 +107,7 @@ var (
|
|||
hrTargetNamespace string
|
||||
hrValuesFile string
|
||||
hrValuesFrom flags.HelmReleaseValuesFrom
|
||||
hrSAName string
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
|
@ -116,6 +117,7 @@ func init() {
|
|||
createHelmReleaseCmd.Flags().StringVar(&hrChartVersion, "chart-version", "", "Helm chart version, accepts a semver range (ignored for charts from GitRepository sources)")
|
||||
createHelmReleaseCmd.Flags().StringArrayVar(&hrDependsOn, "depends-on", nil, "HelmReleases that must be ready before this release can be installed, supported formats '<name>' and '<namespace>/<name>'")
|
||||
createHelmReleaseCmd.Flags().StringVar(&hrTargetNamespace, "target-namespace", "", "namespace to install this release, defaults to the HelmRelease namespace")
|
||||
createHelmReleaseCmd.Flags().StringVar(&hrSAName, "service-account", "", "the name of the service account to impersonate when reconciling this HelmRelease")
|
||||
createHelmReleaseCmd.Flags().StringVar(&hrValuesFile, "values", "", "local path to the values.yaml file")
|
||||
createHelmReleaseCmd.Flags().Var(&hrValuesFrom, "values-from", hrValuesFrom.Description())
|
||||
createCmd.AddCommand(createHelmReleaseCmd)
|
||||
|
|
@ -167,6 +169,10 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
|
|||
},
|
||||
}
|
||||
|
||||
if hrSAName != "" {
|
||||
helmRelease.Spec.ServiceAccountName = hrSAName
|
||||
}
|
||||
|
||||
if hrValuesFile != "" {
|
||||
data, err := ioutil.ReadFile(hrValuesFile)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue