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

decouple helm deployer chartPath into chartPath and remoteChart #5482

Merged
merged 5 commits into from Mar 10, 2021

Conversation

gsquared94
Copy link
Collaborator

@gsquared94 gsquared94 commented Mar 3, 2021

Fixes: #5459


Description

Currently the helm deployer's chartPath property can be used to specify the path to a local Helm chart (packaged or unpacked) or a Helm chart reference (like stable/nginx) or even a URL (like https://example.com/charts/nginx-1.2.3.tgz). It uses the additional remote property to hint skaffold about this.

This PR replaces chartPath and remote properties with explicit chartPath and remoteChart properties.


User facing changes (remove if N/A)

Before

deploy:
  helm:
    releases:
    - name: foo1
      chartPath: ./path/to/chart
    - name: foo2
      chartPath: foo2/bar
      remote: true

After

deploy:
  helm:
    releases:
    - name: foo1
      chartPath: ./path/to/chart
    - name: foo2
      remoteChart: foo2/bar

@gsquared94 gsquared94 requested a review from tejal29 March 3, 2021 04:45
@gsquared94 gsquared94 requested a review from a team as a code owner March 3, 2021 04:45
@google-cla google-cla bot added the cla: yes label Mar 3, 2021
@gsquared94 gsquared94 added this to the v1.21.0 milestone Mar 3, 2021
@codecov
Copy link

codecov bot commented Mar 3, 2021

Codecov Report

Merging #5482 (1471947) into master (2e55bec) will increase coverage by 0.21%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5482      +/-   ##
==========================================
+ Coverage   71.42%   71.64%   +0.21%     
==========================================
  Files         398      399       +1     
  Lines       14654    14749      +95     
==========================================
+ Hits        10467    10567     +100     
+ Misses       3409     3404       -5     
  Partials      778      778              
Impacted Files Coverage Δ
pkg/skaffold/schema/latest/config.go 58.82% <ø> (ø)
pkg/skaffold/deploy/helm/deploy.go 75.48% <62.50%> (-0.62%) ⬇️
pkg/skaffold/schema/v2beta12/upgrade.go 100.00% <100.00%> (ø)
pkg/skaffold/util/tar.go 50.66% <0.00%> (-5.34%) ⬇️
pkg/skaffold/errors/errors.go 87.23% <0.00%> (ø)
pkg/skaffold/errors/build_problems.go 100.00% <0.00%> (ø)
cmd/skaffold/app/cmd/parse_config.go
pkg/skaffold/parser/config.go 78.68% <0.00%> (ø)
pkg/skaffold/schema/errors/errors.go 100.00% <0.00%> (ø)
cmd/skaffold/app/cmd/runner.go 60.71% <0.00%> (+0.71%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2e55bec...1471947. Read the comment docs.

Copy link
Member

@tejal29 tejal29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a nit

pkg/skaffold/deploy/helm/deploy.go Outdated Show resolved Hide resolved
@gsquared94 gsquared94 requested a review from tejal29 March 3, 2021 07:24
@gsquared94 gsquared94 added the kokoro:force-run forces a kokoro re-run on a PR label Mar 3, 2021
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Mar 3, 2021
@MarlonGamez
Copy link
Contributor

I have a question about this since #5410 just got merged. Would it be possible to keep just the chartPath field, remove the remote field, and basically toggle on/off the remote functionality based on whether or not the user sets the repo field (introduced in #5410)?

@gsquared94
Copy link
Collaborator Author

I have a question about this since #5410 just got merged. Would it be possible to keep just the chartPath field, remove the remote field, and basically toggle on/off the remote functionality based on whether or not the user sets the repo field (introduced in #5410)?

I think that approach won't work because the chartPath can be remote without specifying --repo if the user has already manually pulled it. Also it can be an absolute url in which case the --repo is not required as it is part of that url.

Copy link
Member

@briandealwis briandealwis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remoteChartPath isn't actually a path. Could we try the following:

  • keep chartPath for local charts
  • remoteChartPathchartRef or remoteChart?

@gsquared94 gsquared94 changed the title decouple helm deployer chartPath into localChartPath and remoteChartPath decouple helm deployer chartPath into chartPath and remoteChart Mar 9, 2021
Copy link
Contributor

@MarlonGamez MarlonGamez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Do we have anything in examples/ that uses remote helm charts? If not I think that would be a good follow up for this

@gsquared94 gsquared94 merged commit 1cc7613 into GoogleContainerTools:master Mar 10, 2021
@gsquared94
Copy link
Collaborator Author

LGTM. Do we have anything in examples/ that uses remote helm charts? If not I think that would be a good follow up for this

Good idea. Added #5517

@zestrells
Copy link

zestrells commented Apr 7, 2021

Hello @gsquared94 , It looks like when we I try and use the remoteChart variable, it does not work. I verified I am using the Skaffold version 1.21.0

deploy:
  helm:
    releases:
      - name: mysql
        namespace: platcore
        remoteChart: https://gitlab.io/helm-charts/devops/simple-template
        valuesFiles: [ helm/mysql-values.yaml ]

Error I am receiving:
parsing skaffold config: error parsing skaffold configuration file

@briandealwis
Copy link
Member

@zestrells try skaffold fix: it provides more detail on the issue. I filed #5659 to improve this error message.

@briandealwis
Copy link
Member

Oh and more specifically, that error often indicates that you need to update the version of your skaffold.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

helm remote deploy fails when "required" by another config
6 participants