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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions cmd/util/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ type AppOptions struct {
helmVersion string
helmPassCredentials bool
helmSkipCrds bool
helmSkipTests bool
helmNamespace string
helmKubeVersion string
helmApiVersions []string
Expand Down Expand Up @@ -109,6 +110,7 @@ func AddAppFlags(command *cobra.Command, opts *AppOptions) {
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().BoolVar(&opts.helmSkipTests, "helm-skip-tests", false, "Skip helm test manifests installation step")
command.Flags().StringVar(&opts.helmNamespace, "helm-namespace", "", "Helm namespace to use when running helm template. If not set, use app.spec.destination.namespace")
command.Flags().StringVar(&opts.helmKubeVersion, "helm-kube-version", "", "Helm kube-version to use when running helm template. If not set, use the kube version from the destination cluster")
command.Flags().StringArrayVar(&opts.helmApiVersions, "helm-api-versions", []string{}, "Helm api-versions (in format [group/]version/kind) to use when running helm template (Can be repeated to set several values: --helm-api-versions traefik.io/v1alpha1/TLSOption --helm-api-versions v1/Service). If not set, use the api-versions from the destination cluster")
Expand Down Expand Up @@ -358,6 +360,7 @@ type helmOpts struct {
helmSetFiles []string
passCredentials bool
skipCrds bool
skipTests bool
namespace string
kubeVersion string
apiVersions []string
Expand Down Expand Up @@ -391,6 +394,9 @@ func setHelmOpt(src *argoappv1.ApplicationSource, opts helmOpts) {
if opts.skipCrds {
src.Helm.SkipCrds = opts.skipCrds
}
if opts.skipTests {
src.Helm.SkipTests = opts.skipTests
}
if opts.namespace != "" {
src.Helm.Namespace = opts.namespace
}
Expand Down Expand Up @@ -658,6 +664,8 @@ func ConstructSource(source *argoappv1.ApplicationSource, appOpts AppOptions, fl
setHelmOpt(source, helmOpts{helmSetFiles: appOpts.helmSetFiles})
case "helm-skip-crds":
setHelmOpt(source, helmOpts{skipCrds: appOpts.helmSkipCrds})
case "helm-skip-tests":
setHelmOpt(source, helmOpts{skipTests: appOpts.helmSkipTests})
case "helm-namespace":
setHelmOpt(source, helmOpts{namespace: appOpts.helmNamespace})
case "helm-kube-version":
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 @@ -65,6 +65,11 @@ func Test_setHelmOpt(t *testing.T) {
setHelmOpt(&src, helmOpts{skipCrds: true})
assert.True(t, src.Helm.SkipCrds)
})
t.Run("HelmSkipTests", func(t *testing.T) {
src := v1alpha1.ApplicationSource{}
setHelmOpt(&src, helmOpts{skipTests: true})
assert.True(t, src.Helm.SkipTests)
})
t.Run("HelmNamespace", func(t *testing.T) {
src := v1alpha1.ApplicationSource{}
setHelmOpt(&src, helmOpts{namespace: "custom-namespace"})
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_app_add-source.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_app_create.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_app_set.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions docs/user-guide/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,3 +498,23 @@ spec:
helm:
skipCrds: true
```


## Helm `--skip-tests`

By default, Helm includes test manifests when rendering templates. Argo CD currently skips manifests that include hooks not supported by Argo CD, including [Helm test hooks](https://helm.sh/docs/topics/chart_tests/). While this feature covers many testing use cases, it is not totally congruent with --skip-tests, so the --skip-tests option can be used.

If needed, it is possible to skip the test manifests installation step with the `helm-skip-tests` flag on the cli:

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

Or using declarative syntax:

```yaml
spec:
source:
helm:
skipTests: true # or false
```
Loading