Skip to content

0.16.0 requires helm chart to be helm 3 chart #2806

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

Closed
depohmel opened this issue Apr 8, 2020 · 3 comments
Closed

0.16.0 requires helm chart to be helm 3 chart #2806

depohmel opened this issue Apr 8, 2020 · 3 comments

Comments

@depohmel
Copy link

depohmel commented Apr 8, 2020

Bug Report

What did you do?
operator-sdk new for helm2 chart version with dependencies

What did you expect to see?
don't excpect operator to be created without errors

What did you see instead? Under which circumstances?
I see the error:

NFO[0000] Creating new Helm operator 'test-operator'.  

Error: failed to create helm chart: failed to fetch chart dependencies: Chart.lock is out of sync with Chart.yaml
Usage:
  operator-sdk new <project-name> [flags]

Environment

  • operator-sdk version:
    ```operator-sdk version: "v0.16.0", commit: "55f1446c5f472e7d8e308dcdf36d0d7fc44fc4fd", go version: "go1.13.8 linux/amd64"````

  • go version:
    go version go1.12.9 linux/amd64

  • Kubernetes version information:
    Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-19T16:40:16Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}

  • Kubernetes cluster kind:
    N/A

  • Are you writing your operator in ansible, helm, or go?

helm

Additional context
Helm 2 dependencies are described in requirements.yaml and lock file is requirements.lock
in Helm 3 dependencies were moved into Chart.yaml and lock file is Chart.lock

This issue only presented for helm2 charts with dependencies.

steps to reproduce:

RELEASE_VERSION=v0.16.0

curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu

chmod +x operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu && sudo mkdir -p /usr/local/bin/ && sudo cp operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu /usr/local/bin/operator-sdk && 
rm operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu

mkdir test-helmoperator

helm init -c

helm repo add kasten https://charts.kasten.io/
helm fetch kasten/k10 --untar

cd test-helmoperator/
operator-sdk new test-operator --api-version=test.testk10/v1alpha1 --type=helm --kind=K10 --helm-chart=../k10

error:

INFO[0000] Creating new Helm operator 'test-operator'.  

Error: failed to create helm chart: failed to fetch chart dependencies: Chart.lock is out of sync with Chart.yaml
Usage:
  operator-sdk new <project-name> [flags]

Flags:
      --api-version string          Kubernetes apiVersion and has a format of $GROUP_NAME/$VERSION (e.g app.example.com/v1alpha1) - used with "ansible" or "helm" types
      --generate-playbook           Generate a playbook skeleton. (Only used for --type ansible)
      --git-init                    Initialize the project directory as a git repository (default false)
      --header-file string          Path to file containing headers for generated Go files. Copied to hack/boilerplate.go.txt
      --helm-chart string           Initialize helm operator with existing helm chart (<URL>, <repo>/<name>, or local path)
      --helm-chart-repo string      Chart repository URL for the requested helm chart
      --helm-chart-version string   Specific version of the helm chart (default is latest version)
  -h, --help                        help for new
      --kind string                 Kubernetes CustomResourceDefintion kind. (e.g AppService) - used with "ansible" or "helm" types
      --repo string                 Project repository path for Go operators. Used as the project's Go import path. This must be set if outside of $GOPATH/src (e.g. github.com/example-inc/my-operator)
      --skip-validation             Do not validate the resulting project's structure and dependencies. (Only used for --type go)
      --type string                 Type of operator to initialize (choices: "go", "ansible" or "helm") (default "go")
      --vendor                      Use a vendor directory for dependencies

Global Flags:
      --verbose   Enable verbose logging

@depohmel depohmel changed the title 0.16.0 requires helm chart to be helm 3 0.16.0 requires helm chart to be helm 3 chart Apr 8, 2020
@joelanford
Copy link
Member

I think you're running into this: helm/helm#7464

I can confirm that this issue is fixed on master (where we've bumped to v3.1.0 with the kubernetes 1.17 changes).

Unfortunately it doesn't seem like there is a Helm release that fixes it before the Kubernetes deps are bumped to 1.17, so I don't think there's a fix we can make in to backport to v0.16.1.

As a workaround, can you try using a build from master to generate the project. Your helm-operator base image in ./build/Dockerfile should still be set to v0.16.0, so if this is just an issue during generation, that should fix it.

@depohmel
Copy link
Author

depohmel commented Apr 9, 2020

yeap, as workaround that one worked.

@joelanford
Copy link
Member

Alright, great! I'm going to close this one since there's nothing else we can do as far as I can tell.

When we release v0.17.0 (should be in the next week or so), this should be fixed again! Sorry about that!

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

No branches or pull requests

2 participants