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 target local helm chart with chartPath in a helm module #1550

Closed
popul opened this issue Jan 27, 2020 · 4 comments
Closed

Unable to target local helm chart with chartPath in a helm module #1550

popul opened this issue Jan 27, 2020 · 4 comments
Labels
bug good first issue priority:medium Medium priority issue or feature

Comments

@popul
Copy link

popul commented Jan 27, 2020

Bug

Current Behavior

I want to use chartPath for helm local charts, but it fails when i run garden run module foo-helm

image

Expected behavior

Be able to target a subfolder when working with local helm charts

Reproducible example

Folder structure:

- garden.yml
- foo/
  - Chart.yaml

garden.yml content

kind: Module
description: foo-helm description
type: helm
name: foo-helm
chartPath: ./foo

chart.yaml content:

apiVersion: v2
name: foo
description: A Helm chart for Kubernetes
type: application
version: 0.1.0
appVersion: 1.0.0

Workaround

Move garden.yml in chart folder

Suggested solution(s)

Additional context

Your environment

garden version : 0.11.1

kubectl version

Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:20:10Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:12:17Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}

docker version

Client: Docker Engine - Community
 Version:           19.03.5
 API version:       1.40
 Go version:        go1.12.12
 Git commit:        633a0ea
 Built:             Wed Nov 13 07:22:34 2019
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.5
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.12
  Git commit:       633a0ea838
  Built:            Wed Nov 13 07:28:45 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.2.10
  GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
 runc:
  Version:          commit: d736ef14f0288d6993a1845745d6756cfc9ddd5a
  GitCommit:        
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683
```
@eysi09
Copy link
Collaborator

eysi09 commented Jan 27, 2020

It might be that Garden is not finding the chart because it's using the default include value for Helm modules.

It basically defaults to ["*", "charts/**/*", "templates/**/*"] if not set explicitly by the user.

The issue here is that we should always make sure that the chartPath value is included. To verify, could you try setting the include field and see if that fixes it? At least it's a better workaround than moving the garden.yml file.

E.g.:

kind: Module
description: foo-helm description
type: helm
name: foo-helm
include: ["foo/**/*"]
chartPath: ./foo

@eysi09 eysi09 added bug priority:medium Medium priority issue or feature good first issue labels Jan 27, 2020
@popul
Copy link
Author

popul commented Jan 27, 2020

This one works (using default include values) 👍

File structure

- garden.yml
- charts/
  - foo/
    - Chart.yaml

with this garden.yml content:

kind: Module
description: foo-helm description
type: helm
name: foo-helm
chartPath: ./charts/foo

But this configuration not 👎

File structure

- garden.yml
- foo/
    - Chart.yaml

with this garden.yml content:

kind: Module
description: foo-helm description
type: helm
name: foo-helm
include: ["foo"]
chartPath: ./foo

@eysi09
Copy link
Collaborator

eysi09 commented Jan 27, 2020

Yeah my bad. The original example I posted was wrong. It's suppose to be include: ["foo/**/*"] and not include: ["foo"].

I though I had gotten away with it because I updated it a couple of minutes later.

@popul
Copy link
Author

popul commented Jan 28, 2020

Perfect thx, it works using globs

Reading this doc,

# Specify a list of POSIX-style paths or globs that should be regarded as the source files for this
# module. Files that do *not* match these paths or globs are excluded when computing the version of the module,
# when responding to filesystem watch events, and when staging builds.

I made the assumption that i can use POSIX-style path to target folder and its content.

Thanks, for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue priority:medium Medium priority issue or feature
Projects
None yet
Development

No branches or pull requests

2 participants