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

Unable to import Helm release by specifying import ID #3502

Open
4ux-nbIx opened this issue Feb 19, 2025 · 2 comments
Open

Unable to import Helm release by specifying import ID #3502

4ux-nbIx opened this issue Feb 19, 2025 · 2 comments
Labels
area/helm area/import kind/bug Some behavior is incorrect or out of spec

Comments

@4ux-nbIx
Copy link

4ux-nbIx commented Feb 19, 2025

What happened?

I'm trying to import an existing Helm release inside a custom resource, by providing import resource ID in helm release options.

Get this error when running pulumi preview:

error: kubernetes:helm.sh/v3:Release resource 'd-weu-helm-test-application-with-ingress-helm-release': property chart value {pulumi-package-test-app} has a problem: non-absolute URLs should be in form of repo_name/path_to_chart, got: pulumi-package-test-app; check the chart name and repository configuration.
error: Preview failed: one or more inputs failed to validate

The chart parameter is set to an absolute URL.

I also tried providing chart name only and specifying repositoryOpts. Same error.

Example

const helmRelease = new Release(
      helmReleaseName,
      {
        name: name,
        chart: chartName,
        version: args.version,
        namespace: args.namespace,
        maxHistory: 10,
        atomic: true,
        valueYamlFiles: args.valueYamlFiles,
        values: args.values,
        skipCrds: true,
        createNamespace: false,
        dependencyUpdate: args.dependencyUpdate,
        timeout: args.timeout,
        // repositoryOpts: repositoryOpts
      },
      {
        parent: parent,
        import: args.importId,
        ignoreChanges: args.importId == undefined ? ["name"] : ["*"]
      }
    );

chart parameter has an absolute URL. This code works well when creating new releases (without import specified).

Output of pulumi about

CLI
Version 3.150.0
Go Version go1.23.6
Go Compiler gc

Plugins
KIND NAME VERSION
resource azure-native 2.88.0
resource command 0.0.1-testwindows.signing
language nodejs 3.150.0

Host
OS Microsoft Windows 11 Enterprise
Version 10.0.22631 Build 22631
Arch x86_64

This project is written in nodejs: executable='C:\Program Files\nodejs\node.exe' version='v22.5.1'

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).

@4ux-nbIx 4ux-nbIx added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Feb 19, 2025
@rquitales
Copy link
Member

Thanks for reporting this error, and apologies that you're facing it. I am able to reproduce this error.

Simple repro steps:

  1. Install a helm chart, eg. PKO, by running:
helm install --create-namespace -n pulumi-kubernetes-operator pulumi-kubernetes-operator oci://ghcr.io/pulumi/helm-charts/pulumi-kubernetes-operator
  1. Import using the import resource option
import * as k8s from "@pulumi/kubernetes";
import * as pulumi from "@pulumi/pulumi";

const myRelease = new k8s.helm.v3.Release("myRelease", {
    chart: "pulumi-kubernetes-operator",
    name: "pulumi-kubernetes-operator",
    namespace: "pulumi-kubernetes-operator",
    replace: false,
    skipCrds: true,
    version: "2.0.0",
}, {
  import: "pulumi-kubernetes-operator/pulumi-kubernetes-operator"
});
  1. Observe the error
 error: kubernetes:helm.sh/v3:Release resource 'myRelease': property chart value {pulumi-kubernetes-operator} has a problem: non-absolute URLs should be in form of repo_name/path_to_chart, got: pulumi-kubernetes-operator; check the chart name and repository configuration.
    error: Preview failed: one or more inputs failed to validate

It looks like we need to disable Helm release arg validation if we're trying to import using the import resource option.


As a workaround for now, the CLI import method is working. Please see https://www.pulumi.com/registry/packages/kubernetes/api-docs/helm/v3/release/#import for more details on how to do this.

@rquitales rquitales added area/helm area/import and removed needs-triage Needs attention from the triage team labels Feb 20, 2025
@4ux-nbIx
Copy link
Author

Hi @rquitales,
Thanks for looking into this. CLI import could work, but it'll be difficult to use it for us. We need to import existing Helm releases into a custom component, so we'll have to deploy an empty custom component, pick up it's URN feed it to the CLI import and etc.

We have a lot of Helm releases to import this way, so having it in the code is the only automated way...

When can we expect the fix to be released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/helm area/import kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

2 participants