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

fix: create api helm panic #6708

Conversation

meimeitou
Copy link

Description of the change:

helm downloader.Manager not initialized correctly. in operator-sdk/internal/plugins/helm/v1/chartutil/chart.go:186

Motivation for the change:

  1. Init project
operator-sdk init --plugins=hybrid.helm.sdk.operatorframework.io --project-version="3" --repo=github.com/meimeitou/db-operator 
  1. Create api
operator-sdk create api --plugins helm.sdk.operatorframework.io/v1 --group dns --version v1alpha1 --kind Postgres --helm-chart=postgresql --helm-chart-version=12.12.10 --helm-chart-repo=https://charts.bitnami.com/bitnami

than got panic:

NFO[0026] Writing kustomize manifests for you to edit... 
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x17df48b]

goroutine 1 [running]:
helm.sh/helm/v3/pkg/registry.(*Client).Tags(0x0, {0xc0008f5830?, 0xc002b07210?})
        /home/runner/go/pkg/mod/helm.sh/helm/v3@v3.13.3/pkg/registry/client.go:671 +0x12b
helm.sh/helm/v3/internal/resolver.(*Resolver).Resolve(0xc002b07458, {0xc001e8ed10, 0x1, 0x1}, 0x1?)
        /home/runner/go/pkg/mod/helm.sh/helm/v3@v3.13.3/internal/resolver/resolver.go:153 +0x588
helm.sh/helm/v3/pkg/downloader.(*Manager).resolve(0xc003eb9dd0?, {0xc001e8ed10?, 0xc001e8ed10?, 0x1?}, 0x0?)
        /home/runner/go/pkg/mod/helm.sh/helm/v3@v3.13.3/pkg/downloader/manager.go:235 +0x5f
helm.sh/helm/v3/pkg/downloader.(*Manager).Update(0xc003eb9dd0)
        /home/runner/go/pkg/mod/helm.sh/helm/v3@v3.13.3/pkg/downloader/manager.go:194 +0xdc
helm.sh/helm/v3/pkg/downloader.(*Manager).Build(0xc003eb9dd0)
        /home/runner/go/pkg/mod/helm.sh/helm/v3@v3.13.3/pkg/downloader/manager.go:95 +0x3d2
github.com/operator-framework/operator-sdk/internal/plugins/helm/v1/chartutil.fetchChartDependencies({0xc003eccdc0, 0x3b})
        internal/plugins/helm/v1/chartutil/chart.go:193 +0x273
github.com/operator-framework/operator-sdk/internal/plugins/helm/v1/chartutil.ScaffoldChart(0xc003c8a140, {0xc000058004?, 0xc0007ec6b0?})
        internal/plugins/helm/v1/chartutil/chart.go:168 +0x127
github.com/operator-framework/operator-sdk/internal/plugins/helm/v1/scaffolds.(*apiScaffolder).Scaffold(0xc003c8b4a0)
        internal/plugins/helm/v1/scaffolds/api.go:77 +0xd4
github.com/operator-framework/operator-sdk/internal/plugins/helm/v1.(*createAPISubcommand).Scaffold(0xc0007ee410, {{0x2d03700?, 0x4353920?}})
        internal/plugins/helm/v1/api.go:228 +0x1de
sigs.k8s.io/kubebuilder/v3/pkg/cli.(*CLI).applySubcommandHooks.(*executionHooksFactory).runEFunc.func2.1({0x7fe14a077728?, 0xc0007ee410?})
        /home/runner/go/pkg/mod/sigs.k8s.io/kubebuilder/v3@v3.13.1-0.20240119130530-7fba82c768f8/pkg/cli/cmd_helpers.go:308 +0x2f
sigs.k8s.io/kubebuilder/v3/pkg/cli.(*executionHooksFactory).forEach(0xc0004c2b60, 0xc002b07b70, {0x28796c4, 0x17})
        /home/runner/go/pkg/mod/sigs.k8s.io/kubebuilder/v3@v3.13.1-0.20240119130530-7fba82c768f8/pkg/cli/cmd_helpers.go:198 +0xad
sigs.k8s.io/kubebuilder/v3/pkg/cli.(*CLI).applySubcommandHooks.(*executionHooksFactory).runEFunc.func2(0xc000505600, {0xc0007b8420, 0x0, 0xb})
        /home/runner/go/pkg/mod/sigs.k8s.io/kubebuilder/v3@v3.13.1-0.20240119130530-7fba82c768f8/pkg/cli/cmd_helpers.go:307 +0x3f
github.com/spf13/cobra.(*Command).execute(0xc000902000, {0xc0007b8370, 0xb, 0xb})
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:983 +0xabc
github.com/spf13/cobra.(*Command).ExecuteC(0xc0007d1b00)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039
sigs.k8s.io/kubebuilder/v3/pkg/cli.CLI.Run(...)
        /home/runner/go/pkg/mod/sigs.k8s.io/kubebuilder/v3@v3.13.1-0.20240119130530-7fba82c768f8/pkg/cli/cli.go:463
github.com/operator-framework/operator-sdk/internal/cmd/operator-sdk/cli.Run()
        internal/cmd/operator-sdk/cli/cli.go:76 +0x45
main.main()
        cmd/operator-sdk/main.go:28 +0x13
  1. more info

operator-sdk version:

operator-sdk version: "v1.34.1", commit: "edaed1e5057db0349568e0b02df3743051b54e68", kubernetes version: "1.28.0", go version: "go1.21.7", GOOS: "linux", GOARCH: "amd64"

Checklist

If the pull request includes user-facing changes, extra documentation is required:

@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 20, 2024
@openshift-bot
Copy link

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jul 20, 2024
@openshift-bot
Copy link

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

@openshift-ci openshift-ci bot closed this Aug 20, 2024
Copy link

openshift-ci bot commented Aug 20, 2024

@openshift-bot: Closed this PR.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants