Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip Helm test hook resources by default #1467

Merged
merged 6 commits into from
Feb 10, 2021

Conversation

lblackstone
Copy link
Member

@lblackstone lblackstone commented Feb 9, 2021

Proposed changes

Many Helm charts include test hooks that can be
used by the "helm test" command to validate an
installation, but should not be included as part of
a default chart installation. This change disables
the creation of test resources by default, and includes
a new Chart parameter that can be used to override
this default and install the test resources.

Related issues (optional)

Related to #665

Many Helm charts include test hooks that can be
used by the "helm test" command to validate an
installation, but should not be included as part of
a default chart installation. This change disables
the creation of test resources by default, and includes
a new Chart parameter that can be used to override
this default and install the test resources.
@lblackstone
Copy link
Member Author

@jaxxstorm I wanted to make sure that this change makes sense to you as a user. We previously started implementing this change in #666

Here's a before and after example:

     Type                                            Name                                 Plan       Info
 +   pulumi:pulumi:Stack                             pulumi-k8s-test-pulumi-k8s-test-dev  create
 +   ├─ kubernetes:helm.sh/v3:Chart                  wordpress                            create
 +   │  ├─ kubernetes:core/v1:Secret                 wordpress                            create
 +   │  ├─ kubernetes:core/v1:PersistentVolumeClaim  wordpress                            create
 +   │  ├─ kubernetes:core/v1:Secret                 default/wordpress-mariadb            create
 +   │  ├─ kubernetes:core/v1:Service                default/wordpress-mariadb            create
 +   │  ├─ kubernetes:core/v1:ConfigMap              default/wordpress-mariadb            create
 +   │  ├─ kubernetes:core/v1:Pod                    wordpress-credentials-test           create     1 warning
 +   │  ├─ kubernetes:core/v1:Service                wordpress                            create
 +   │  ├─ kubernetes:core/v1:ServiceAccount         default/wordpress-mariadb            create
 +   │  ├─ kubernetes:apps/v1:StatefulSet            default/wordpress-mariadb            create
 +   │  └─ kubernetes:apps/v1:Deployment             wordpress                            create
 +   └─ pulumi:providers:kubernetes                  foo                                  create

Diagnostics:
  kubernetes:core/v1:Pod (wordpress-credentials-test):
    warning: This resource contains Helm hooks that are not currently supported by Pulumi. The resource will be created, but any hooks will not be executed. Hooks support is tracked at https://github.com/pulumi/pulumi-kubernetes/issues/555

$ pulumi up
Previewing update (pulumi-k8s-test-dev)

     Type                                            Name                                 Plan
 +   pulumi:pulumi:Stack                             pulumi-k8s-test-pulumi-k8s-test-dev  create
 +   ├─ kubernetes:helm.sh/v3:Chart                  wordpress                            create
 +   │  ├─ kubernetes:core/v1:PersistentVolumeClaim  wordpress                            create
 +   │  ├─ kubernetes:core/v1:Secret                 wordpress                            create
 +   │  ├─ kubernetes:core/v1:ConfigMap              default/wordpress-mariadb            create
 +   │  ├─ kubernetes:core/v1:ServiceAccount         default/wordpress-mariadb            create
 +   │  ├─ kubernetes:core/v1:Secret                 default/wordpress-mariadb            create
 +   │  ├─ kubernetes:core/v1:Service                default/wordpress-mariadb            create
 +   │  ├─ kubernetes:core/v1:Service                wordpress                            create
 +   │  ├─ kubernetes:apps/v1:Deployment             wordpress                            create
 +   │  └─ kubernetes:apps/v1:StatefulSet            default/wordpress-mariadb            create
 +   └─ pulumi:providers:kubernetes                  foo                                  create

Copy link
Contributor

@viveklak viveklak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The PR description mentioned something about a parameter to disable skipping of the installation but didn't see it in the PR? Did you want to add that separately?

Update - Ah its a draft. Nevermind :)

provider/pkg/provider/invoke_helm_template.go Outdated Show resolved Hide resolved
@lblackstone lblackstone marked this pull request as ready for review February 10, 2021 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants