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

Chart v4 fails on update #3045

Closed
EronWright opened this issue Jun 4, 2024 · 1 comment · Fixed by #3046
Closed

Chart v4 fails on update #3045

EronWright opened this issue Jun 4, 2024 · 1 comment · Fixed by #3046
Assignees
Labels
area/helm kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team resolution/fixed This issue was fixed

Comments

@EronWright
Copy link
Contributor

What happened?

I tried to use Chart v4 to install cert-manager and saw an unexpected error during a subsequent update.

error: an unhandled error occurred: waiting for RPCs: rpc error: code = Unknown desc = Unable to continue with install: NetworkPolicy "certman-oci" in namespace "cert-manager" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "certman-oci"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "cert-manager"

Example

name: example
runtime: yaml
resources:
  certman-ns:
    type: kubernetes:core/v1:Namespace
    properties:
      metadata:
        name: cert-manager
  certman-oci:
    type: kubernetes:helm.sh/v4:Chart
    properties:
      namespace: ${certman-ns.metadata.name}
      chart: oci://registry-1.docker.io/bitnamicharts/cert-manager
      version: "1.1.0"

Output of pulumi about

CLI          
Version      3.117.0
Go Version   go1.22.3
Go Compiler  gc

Plugins
KIND      NAME        VERSION
resource  kubernetes  unknown
language  yaml        unknown

Host     
OS       darwin
Version  14.4.1
Arch     arm64

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@EronWright EronWright added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Jun 4, 2024
@EronWright EronWright self-assigned this Jun 4, 2024
EronWright added a commit that referenced this issue Jun 4, 2024
<!--Thanks for your contribution. See [CONTRIBUTING](CONTRIBUTING.md)
    for Pulumi's contribution guidelines.

    Help us merge your changes more quickly by adding more details such
    as labels, milestones, and reviewers.-->

### Proposed changes

<!--Give us a brief description of what you've done and what it solves.
-->

This PR fixes a problem with how Chart v4 uses the Helm library. The
design goal is to allow for connectivity during template rendering, to
support the lookup function (see helm/helm#9426)
and to provide an accurate [Capabilities
object](https://helm.sh/docs/chart_template_guide/builtin_objects/).
Unfortunately we were slightly too aggressive and caused some of Helm's
"non-template" code to execute.

This fix works by turning off the `helm template --validation` flag, so
that the internal `ClientOnly` flag is true thus avoiding [this block of
code](https://github.com/helm/helm/blob/6f32a8f9d338bacc3c6a1c0c3610012b01edb3d1/pkg/action/install.go#L345-L350)
that causes the unexpected error. A side-effect of `ClientOnly` being
true is that the capabilities aren't automatically set, and so we set
them using the provider's kube client (akin to using `--kube-version`).

Detailed changes:
- (chart.go) use ClientOnly mode, set KubeVersion and APIVersions
- (tool.go) remove redundant KubeVersion and ExtraAPIs 
- (testdata/reference) add a version check
- (chart_test.go) unit tests for `.Capabilities`
- integration test to install cert-manager

### Related issues (optional)

<!--Refer to related PRs or issues: #1234, or 'Fixes #1234' or 'Closes
#1234'.
Or link to full URLs to issues or pull requests in other GitHub
repositories. -->
Closes #3045
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Jun 4, 2024
@pulumi-bot
Copy link
Contributor

This issue has been addressed in PR #3046 and shipped in release v4.13.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/helm kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants