mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-23 16:11:48 +00:00
Add source namespace arg to create commands
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
parent
bd41406aaa
commit
9984eb78fa
4 changed files with 12 additions and 4 deletions
|
|
@ -104,6 +104,7 @@ var createHelmReleaseCmd = &cobra.Command{
|
||||||
type helmReleaseFlags struct {
|
type helmReleaseFlags struct {
|
||||||
name string
|
name string
|
||||||
source flags.HelmChartSource
|
source flags.HelmChartSource
|
||||||
|
sourceNamespace string
|
||||||
dependsOn []string
|
dependsOn []string
|
||||||
chart string
|
chart string
|
||||||
chartVersion string
|
chartVersion string
|
||||||
|
|
@ -118,6 +119,7 @@ var helmReleaseArgs helmReleaseFlags
|
||||||
func init() {
|
func init() {
|
||||||
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.name, "release-name", "", "name used for the Helm release, defaults to a composition of '[<target-namespace>-]<HelmRelease-name>'")
|
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.name, "release-name", "", "name used for the Helm release, defaults to a composition of '[<target-namespace>-]<HelmRelease-name>'")
|
||||||
createHelmReleaseCmd.Flags().Var(&helmReleaseArgs.source, "source", helmReleaseArgs.source.Description())
|
createHelmReleaseCmd.Flags().Var(&helmReleaseArgs.source, "source", helmReleaseArgs.source.Description())
|
||||||
|
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.sourceNamespace, "source-namespace", "", "the namespace of the source, defaults to the HelmRelease namespace")
|
||||||
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.chart, "chart", "", "Helm chart name or path")
|
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.chart, "chart", "", "Helm chart name or path")
|
||||||
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.chartVersion, "chart-version", "", "Helm chart version, accepts a semver range (ignored for charts from GitRepository sources)")
|
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.chartVersion, "chart-version", "", "Helm chart version, accepts a semver range (ignored for charts from GitRepository sources)")
|
||||||
createHelmReleaseCmd.Flags().StringArrayVar(&helmReleaseArgs.dependsOn, "depends-on", nil, "HelmReleases that must be ready before this release can be installed, supported formats '<name>' and '<namespace>/<name>'")
|
createHelmReleaseCmd.Flags().StringArrayVar(&helmReleaseArgs.dependsOn, "depends-on", nil, "HelmReleases that must be ready before this release can be installed, supported formats '<name>' and '<namespace>/<name>'")
|
||||||
|
|
@ -165,8 +167,9 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
|
||||||
Chart: helmReleaseArgs.chart,
|
Chart: helmReleaseArgs.chart,
|
||||||
Version: helmReleaseArgs.chartVersion,
|
Version: helmReleaseArgs.chartVersion,
|
||||||
SourceRef: helmv2.CrossNamespaceObjectReference{
|
SourceRef: helmv2.CrossNamespaceObjectReference{
|
||||||
Kind: helmReleaseArgs.source.Kind,
|
Kind: helmReleaseArgs.source.Kind,
|
||||||
Name: helmReleaseArgs.source.Name,
|
Name: helmReleaseArgs.source.Name,
|
||||||
|
Namespace: helmReleaseArgs.sourceNamespace,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,7 @@ var createKsCmd = &cobra.Command{
|
||||||
|
|
||||||
type kustomizationFlags struct {
|
type kustomizationFlags struct {
|
||||||
source flags.KustomizationSource
|
source flags.KustomizationSource
|
||||||
|
sourceNamespace string
|
||||||
path flags.SafeRelativePath
|
path flags.SafeRelativePath
|
||||||
prune bool
|
prune bool
|
||||||
dependsOn []string
|
dependsOn []string
|
||||||
|
|
@ -91,6 +92,7 @@ var kustomizationArgs = NewKustomizationFlags()
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
createKsCmd.Flags().Var(&kustomizationArgs.source, "source", kustomizationArgs.source.Description())
|
createKsCmd.Flags().Var(&kustomizationArgs.source, "source", kustomizationArgs.source.Description())
|
||||||
|
createKsCmd.Flags().StringVar(&kustomizationArgs.sourceNamespace, "source-namespace", "", "the namespace of the source, defaults to the Kustomization namespace")
|
||||||
createKsCmd.Flags().Var(&kustomizationArgs.path, "path", "path to the directory containing a kustomization.yaml file")
|
createKsCmd.Flags().Var(&kustomizationArgs.path, "path", "path to the directory containing a kustomization.yaml file")
|
||||||
createKsCmd.Flags().BoolVar(&kustomizationArgs.prune, "prune", false, "enable garbage collection")
|
createKsCmd.Flags().BoolVar(&kustomizationArgs.prune, "prune", false, "enable garbage collection")
|
||||||
createKsCmd.Flags().StringArrayVar(&kustomizationArgs.healthCheck, "health-check", nil, "workload to be included in the health assessment, in the format '<kind>/<name>.<namespace>'")
|
createKsCmd.Flags().StringArrayVar(&kustomizationArgs.healthCheck, "health-check", nil, "workload to be included in the health assessment, in the format '<kind>/<name>.<namespace>'")
|
||||||
|
|
@ -146,8 +148,9 @@ func createKsCmdRun(cmd *cobra.Command, args []string) error {
|
||||||
Path: filepath.ToSlash(kustomizationArgs.path.String()),
|
Path: filepath.ToSlash(kustomizationArgs.path.String()),
|
||||||
Prune: kustomizationArgs.prune,
|
Prune: kustomizationArgs.prune,
|
||||||
SourceRef: kustomizev1.CrossNamespaceSourceReference{
|
SourceRef: kustomizev1.CrossNamespaceSourceReference{
|
||||||
Kind: kustomizationArgs.source.Kind,
|
Kind: kustomizationArgs.source.Kind,
|
||||||
Name: kustomizationArgs.source.Name,
|
Name: kustomizationArgs.source.Name,
|
||||||
|
Namespace: kustomizationArgs.sourceNamespace,
|
||||||
},
|
},
|
||||||
Suspend: false,
|
Suspend: false,
|
||||||
Validation: kustomizationArgs.validation,
|
Validation: kustomizationArgs.validation,
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,7 @@ flux create helmrelease [name] [flags]
|
||||||
--release-name string name used for the Helm release, defaults to a composition of '[<target-namespace>-]<HelmRelease-name>'
|
--release-name string name used for the Helm release, defaults to a composition of '[<target-namespace>-]<HelmRelease-name>'
|
||||||
--service-account string the name of the service account to impersonate when reconciling this HelmRelease
|
--service-account string the name of the service account to impersonate when reconciling this HelmRelease
|
||||||
--source helmChartSource source that contains the chart in the format '<kind>/<name>', where kind must be one of: (HelmRepository, GitRepository, Bucket)
|
--source helmChartSource source that contains the chart in the format '<kind>/<name>', where kind must be one of: (HelmRepository, GitRepository, Bucket)
|
||||||
|
--source-namespace string the namespace of the source, defaults to the HelmRelease namespace
|
||||||
--target-namespace string namespace to install this release, defaults to the HelmRelease namespace
|
--target-namespace string namespace to install this release, defaults to the HelmRelease namespace
|
||||||
--values stringArray local path to values.yaml files
|
--values stringArray local path to values.yaml files
|
||||||
--values-from helmReleaseValuesFrom Kubernetes object reference that contains the values.yaml data key in the format '<kind>/<name>', where kind must be one of: (Secret, ConfigMap)
|
--values-from helmReleaseValuesFrom Kubernetes object reference that contains the values.yaml data key in the format '<kind>/<name>', where kind must be one of: (Secret, ConfigMap)
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ flux create kustomization [name] [flags]
|
||||||
--prune enable garbage collection
|
--prune enable garbage collection
|
||||||
--service-account string the name of the service account to impersonate when reconciling this Kustomization
|
--service-account string the name of the service account to impersonate when reconciling this Kustomization
|
||||||
--source kustomizationSource source that contains the Kubernetes manifests in the format '[<kind>/]<name>', where kind must 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 must be one of: (GitRepository, Bucket), if kind is not specified it defaults to GitRepository
|
||||||
|
--source-namespace string the namespace of the source, defaults to the Kustomization namespace
|
||||||
--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…
Reference in a new issue