Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions assets/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -4918,6 +4918,10 @@
"type": "string",
"title": "ReleaseName is the Helm release name to use. If omitted it will use the application name"
},
"skipCrds": {
"type": "boolean",
"title": "SkipCrds skips custom resource definition installation step (Helm's --skip-crds)"
},
"valueFiles": {
"type": "array",
"title": "ValuesFiles is a list of Helm value files to use when generating a template",
Expand Down
8 changes: 8 additions & 0 deletions cmd/util/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type AppOptions struct {
helmSetFiles []string
helmVersion string
helmPassCredentials bool
helmSkipCrds bool
project string
syncPolicy string
syncOptions []string
Expand Down Expand Up @@ -95,6 +96,7 @@ func AddAppFlags(command *cobra.Command, opts *AppOptions) {
command.Flags().StringArrayVar(&opts.helmSets, "helm-set", []string{}, "Helm set values on the command line (can be repeated to set several values: --helm-set key1=val1 --helm-set key2=val2)")
command.Flags().StringArrayVar(&opts.helmSetStrings, "helm-set-string", []string{}, "Helm set STRING values on the command line (can be repeated to set several values: --helm-set-string key1=val1 --helm-set-string key2=val2)")
command.Flags().StringArrayVar(&opts.helmSetFiles, "helm-set-file", []string{}, "Helm set values from respective files specified via the command line (can be repeated to set several values: --helm-set-file key1=path1 --helm-set-file key2=path2)")
command.Flags().BoolVar(&opts.helmSkipCrds, "helm-skip-crds", false, "Skip helm crd installation step")
command.Flags().StringVar(&opts.project, "project", "", "Application project name")
command.Flags().StringVar(&opts.syncPolicy, "sync-policy", "", "Set the sync policy (one of: none, automated (aliases of automated: auto, automatic))")
command.Flags().StringArrayVar(&opts.syncOptions, "sync-option", []string{}, "Add or remove a sync option, e.g add `Prune=false`. Remove using `!` prefix, e.g. `!Prune=false`")
Expand Down Expand Up @@ -175,6 +177,8 @@ func SetAppSpecOptions(flags *pflag.FlagSet, spec *argoappv1.ApplicationSpec, ap
setHelmOpt(&spec.Source, helmOpts{helmSetStrings: appOpts.helmSetStrings})
case "helm-set-file":
setHelmOpt(&spec.Source, helmOpts{helmSetFiles: appOpts.helmSetFiles})
case "helm-skip-crds":
setHelmOpt(&spec.Source, helmOpts{skipCrds: appOpts.helmSkipCrds})
case "directory-recurse":
if spec.Source.Directory != nil {
spec.Source.Directory.Recurse = appOpts.directoryRecurse
Expand Down Expand Up @@ -394,6 +398,7 @@ type helmOpts struct {
helmSetStrings []string
helmSetFiles []string
passCredentials bool
skipCrds bool
}

func setHelmOpt(src *argoappv1.ApplicationSource, opts helmOpts) {
Expand All @@ -418,6 +423,9 @@ func setHelmOpt(src *argoappv1.ApplicationSource, opts helmOpts) {
if opts.passCredentials {
src.Helm.PassCredentials = opts.passCredentials
}
if opts.skipCrds {
src.Helm.SkipCrds = opts.skipCrds
}
for _, text := range opts.helmSets {
p, err := argoappv1.NewHelmParameter(text, false)
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions cmd/util/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ func Test_setHelmOpt(t *testing.T) {
setHelmOpt(&src, helmOpts{passCredentials: true})
assert.Equal(t, true, src.Helm.PassCredentials)
})
t.Run("HelmSkipCrds", func(t *testing.T) {
src := v1alpha1.ApplicationSource{}
setHelmOpt(&src, helmOpts{skipCrds: true})
assert.Equal(t, true, src.Helm.SkipCrds)
})
}

func Test_setKustomizeOpt(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ argocd admin app generate-spec APPNAME [flags]
--helm-set stringArray Helm set values on the command line (can be repeated to set several values: --helm-set key1=val1 --helm-set key2=val2)
--helm-set-file stringArray Helm set values from respective files specified via the command line (can be repeated to set several values: --helm-set-file key1=path1 --helm-set-file key2=path2)
--helm-set-string stringArray Helm set STRING values on the command line (can be repeated to set several values: --helm-set-string key1=val1 --helm-set-string key2=val2)
--helm-skip-crds Skip helm crd installation step
--helm-version string Helm version
-h, --help help for generate-spec
--ignore-missing-value-files Ignore locally missing valueFiles when setting helm template --values
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_app_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ argocd app create APPNAME [flags]
--helm-set stringArray Helm set values on the command line (can be repeated to set several values: --helm-set key1=val1 --helm-set key2=val2)
--helm-set-file stringArray Helm set values from respective files specified via the command line (can be repeated to set several values: --helm-set-file key1=path1 --helm-set-file key2=path2)
--helm-set-string stringArray Helm set STRING values on the command line (can be repeated to set several values: --helm-set-string key1=val1 --helm-set-string key2=val2)
--helm-skip-crds Skip helm crd installation step
--helm-version string Helm version
-h, --help help for create
--ignore-missing-value-files Ignore locally missing valueFiles when setting helm template --values
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_app_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ argocd app set APPNAME [flags]
--helm-set stringArray Helm set values on the command line (can be repeated to set several values: --helm-set key1=val1 --helm-set key2=val2)
--helm-set-file stringArray Helm set values from respective files specified via the command line (can be repeated to set several values: --helm-set-file key1=path1 --helm-set-file key2=path2)
--helm-set-string stringArray Helm set STRING values on the command line (can be repeated to set several values: --helm-set-string key1=val1 --helm-set-string key2=val2)
--helm-skip-crds Skip helm crd installation step
--helm-version string Helm version
-h, --help help for set
--ignore-missing-value-files Ignore locally missing valueFiles when setting helm template --values
Expand Down
20 changes: 20 additions & 0 deletions docs/user-guide/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,3 +296,23 @@ spec:
helm:
passCredentials: true
```

## Helm `--skip-crds`

Helm installs custom resource definitions in the `crds` folder by default if they are not existing.
See the [CRD best practices](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/) for details.

If needed, it is possible to skip the CRD installation step with the `helm-skip-crds` flag on the cli:

```bash
argocd app set helm-guestbook --helm-skip-crds
```

Or using declarative syntax:

```yaml
spec:
source:
helm:
skipCrds: true
```
24 changes: 24 additions & 0 deletions manifests/core-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ spec:
description: ReleaseName is the Helm release name to use.
If omitted it will use the application name
type: string
skipCrds:
description: SkipCrds skips custom resource definition
installation step (Helm's --skip-crds)
type: boolean
valueFiles:
description: ValuesFiles is a list of Helm value files
to use when generating a template
Expand Down Expand Up @@ -636,6 +640,10 @@ spec:
description: ReleaseName is the Helm release name to use.
If omitted it will use the application name
type: string
skipCrds:
description: SkipCrds skips custom resource definition installation
step (Helm's --skip-crds)
type: boolean
valueFiles:
description: ValuesFiles is a list of Helm value files to
use when generating a template
Expand Down Expand Up @@ -1011,6 +1019,10 @@ spec:
description: ReleaseName is the Helm release name to
use. If omitted it will use the application name
type: string
skipCrds:
description: SkipCrds skips custom resource definition
installation step (Helm's --skip-crds)
type: boolean
valueFiles:
description: ValuesFiles is a list of Helm value files
to use when generating a template
Expand Down Expand Up @@ -1403,6 +1415,10 @@ spec:
to use. If omitted it will use the application
name
type: string
skipCrds:
description: SkipCrds skips custom resource definition
installation step (Helm's --skip-crds)
type: boolean
valueFiles:
description: ValuesFiles is a list of Helm value
files to use when generating a template
Expand Down Expand Up @@ -1771,6 +1787,10 @@ spec:
description: ReleaseName is the Helm release name
to use. If omitted it will use the application name
type: string
skipCrds:
description: SkipCrds skips custom resource definition
installation step (Helm's --skip-crds)
type: boolean
valueFiles:
description: ValuesFiles is a list of Helm value files
to use when generating a template
Expand Down Expand Up @@ -2127,6 +2147,10 @@ spec:
description: ReleaseName is the Helm release name
to use. If omitted it will use the application name
type: string
skipCrds:
description: SkipCrds skips custom resource definition
installation step (Helm's --skip-crds)
type: boolean
valueFiles:
description: ValuesFiles is a list of Helm value files
to use when generating a template
Expand Down
24 changes: 24 additions & 0 deletions manifests/crds/application-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ spec:
description: ReleaseName is the Helm release name to use.
If omitted it will use the application name
type: string
skipCrds:
description: SkipCrds skips custom resource definition
installation step (Helm's --skip-crds)
type: boolean
valueFiles:
description: ValuesFiles is a list of Helm value files
to use when generating a template
Expand Down Expand Up @@ -635,6 +639,10 @@ spec:
description: ReleaseName is the Helm release name to use.
If omitted it will use the application name
type: string
skipCrds:
description: SkipCrds skips custom resource definition installation
step (Helm's --skip-crds)
type: boolean
valueFiles:
description: ValuesFiles is a list of Helm value files to
use when generating a template
Expand Down Expand Up @@ -1010,6 +1018,10 @@ spec:
description: ReleaseName is the Helm release name to
use. If omitted it will use the application name
type: string
skipCrds:
description: SkipCrds skips custom resource definition
installation step (Helm's --skip-crds)
type: boolean
valueFiles:
description: ValuesFiles is a list of Helm value files
to use when generating a template
Expand Down Expand Up @@ -1402,6 +1414,10 @@ spec:
to use. If omitted it will use the application
name
type: string
skipCrds:
description: SkipCrds skips custom resource definition
installation step (Helm's --skip-crds)
type: boolean
valueFiles:
description: ValuesFiles is a list of Helm value
files to use when generating a template
Expand Down Expand Up @@ -1770,6 +1786,10 @@ spec:
description: ReleaseName is the Helm release name
to use. If omitted it will use the application name
type: string
skipCrds:
description: SkipCrds skips custom resource definition
installation step (Helm's --skip-crds)
type: boolean
valueFiles:
description: ValuesFiles is a list of Helm value files
to use when generating a template
Expand Down Expand Up @@ -2126,6 +2146,10 @@ spec:
description: ReleaseName is the Helm release name
to use. If omitted it will use the application name
type: string
skipCrds:
description: SkipCrds skips custom resource definition
installation step (Helm's --skip-crds)
type: boolean
valueFiles:
description: ValuesFiles is a list of Helm value files
to use when generating a template
Expand Down
24 changes: 24 additions & 0 deletions manifests/ha/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ spec:
description: ReleaseName is the Helm release name to use.
If omitted it will use the application name
type: string
skipCrds:
description: SkipCrds skips custom resource definition
installation step (Helm's --skip-crds)
type: boolean
valueFiles:
description: ValuesFiles is a list of Helm value files
to use when generating a template
Expand Down Expand Up @@ -636,6 +640,10 @@ spec:
description: ReleaseName is the Helm release name to use.
If omitted it will use the application name
type: string
skipCrds:
description: SkipCrds skips custom resource definition installation
step (Helm's --skip-crds)
type: boolean
valueFiles:
description: ValuesFiles is a list of Helm value files to
use when generating a template
Expand Down Expand Up @@ -1011,6 +1019,10 @@ spec:
description: ReleaseName is the Helm release name to
use. If omitted it will use the application name
type: string
skipCrds:
description: SkipCrds skips custom resource definition
installation step (Helm's --skip-crds)
type: boolean
valueFiles:
description: ValuesFiles is a list of Helm value files
to use when generating a template
Expand Down Expand Up @@ -1403,6 +1415,10 @@ spec:
to use. If omitted it will use the application
name
type: string
skipCrds:
description: SkipCrds skips custom resource definition
installation step (Helm's --skip-crds)
type: boolean
valueFiles:
description: ValuesFiles is a list of Helm value
files to use when generating a template
Expand Down Expand Up @@ -1771,6 +1787,10 @@ spec:
description: ReleaseName is the Helm release name
to use. If omitted it will use the application name
type: string
skipCrds:
description: SkipCrds skips custom resource definition
installation step (Helm's --skip-crds)
type: boolean
valueFiles:
description: ValuesFiles is a list of Helm value files
to use when generating a template
Expand Down Expand Up @@ -2127,6 +2147,10 @@ spec:
description: ReleaseName is the Helm release name
to use. If omitted it will use the application name
type: string
skipCrds:
description: SkipCrds skips custom resource definition
installation step (Helm's --skip-crds)
type: boolean
valueFiles:
description: ValuesFiles is a list of Helm value files
to use when generating a template
Expand Down
Loading