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

new operater of type=helm fails with template sub directories #1286

Closed
pplavetzki opened this issue Apr 4, 2019 · 4 comments
Closed

new operater of type=helm fails with template sub directories #1286

pplavetzki opened this issue Apr 4, 2019 · 4 comments

Comments

@pplavetzki
Copy link

Bug Report

What did you do?
I was trying to generate a new operator using the operator-sdk new command:
operator-sdk new simple-operator --helm-chart=ps-helm/simple-chart --api-version=ps.net/v1alpha1 --kind=Simple --type=helm

What did you expect to see?
A successful project creation.

$ operator-sdk new jedi-operator --helm-chart=/tmp/simple-without --api-version=ps.net/v1alpha1 --kind=Simple --type=helm
INFO[0000] Creating new Helm operator 'simple-operator'.  
INFO[0000] Created helm-charts/jedi-core/               
INFO[0000] Created build/Dockerfile                     
INFO[0000] Created watches.yaml                         
INFO[0000] Created deploy/service_account.yaml          
INFO[0000] Created deploy/role.yaml                     
INFO[0000] Created deploy/role_binding.yaml             
INFO[0000] Created deploy/operator.yaml                 
INFO[0000] Created deploy/crds/ps_v1alpha1_jedi_crd.yaml 
INFO[0000] Created deploy/crds/ps_v1alpha1_jedi_cr.yaml 
INFO[0000] Run git init ...                             
Initialized empty Git repository in ./simple-operator/.git/
INFO[0000] Run git init done                            
INFO[0000] Project creation complete. 

What did you see instead? Under which circumstances?

INFO[0000] Creating new Helm operator 'simple-operator'.  
Error: failed to create helm chart: open simple-operator/helm-charts/simple-chat/templates/mongo/deployment.yaml: no such file or directory
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
      --cluster-scoped              Generate cluster-scoped resources instead of namespace-scoped
      --generate-playbook           Generate a playbook skeleton. (Only used for --type ansible)
      --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
      --skip-git-init               Do not init the directory as a git repository
      --type string                 Type of operator to initialize (choices: "go", "ansible" or "helm") (default "go")

Environment

  • operator-sdk version:

    6d26d94

  • kubernetes version output

Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-07T23:17:28Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.5", GitCommit:"2166946f41b36dea2c4626f90a77706f426cdea2", GitTreeState:"clean", BuildDate:"2019-03-25T15:19:22Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
  • Are you writing your operator in ansible, helm, or go?
    helm

Additional context
The simple-chart that I was using had sub directories under the template directory:
Screen Shot 2019-04-03 at 5 33 04 PM

@joelanford
Copy link
Member

@pplavetzki This was recently fixed in helm/helm#5423 and #1235. Can you try again with the latest master build of operator-sdk?

@pplavetzki
Copy link
Author

@joelanford Yes running from master build of operator-sdk built the project successfully. I was using the Homebrew installation.

@joelanford
Copy link
Member

Glad to hear it! If you want to switch back to a release version with this included, we're planning to cut v0.7.0 tomorrow afternoon.

@pplavetzki
Copy link
Author

Cool looking forward to the next release!

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