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

Remove build dep for helm deploy #2121

Merged
merged 4 commits into from May 20, 2019

Conversation

@tejal29
Copy link
Member

tejal29 commented May 14, 2019

On master, skaffold deploy fails with following error.

skaffold deploy -f examples/helm-deployment/skaffold.yaml
Starting deploy...
Error: release: "skaffold-helm" not found
Helm release skaffold-helm not installed. Installing...
FATA[0002] deploying skaffold-helm: matching build results to chart values: no build present for gcr.io/k8s-skaffold/skaffold-helm

This is because in #922, we removed deploy triggering the build. Running
deploy should use the default tag i.e. "latest" when depoying images.

On master, skaffold deploy fails with following error.

```
skaffold deploy -f examples/helm-deployment/skaffold.yaml
Starting deploy...
Error: release: "skaffold-helm" not found
Helm release skaffold-helm not installed. Installing...
FATA[0002] deploying skaffold-helm: matching build results to chart values: no build present for gcr.io/k8s-skaffold/skaffold-helm
```
This is because in #922, we removed deploy triggering the build. Running
deploy should use the default tag i.e. "latest" when depoying images.
@codecov-io

This comment has been minimized.

Copy link

codecov-io commented May 14, 2019

Codecov Report

Merging #2121 into master will increase coverage by 0.46%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2121      +/-   ##
==========================================
+ Coverage   56.29%   56.76%   +0.46%     
==========================================
  Files         180      183       +3     
  Lines        7794     7864      +70     
==========================================
+ Hits         4388     4464      +76     
+ Misses       2989     2988       -1     
+ Partials      417      412       -5
Impacted Files Coverage Δ
pkg/skaffold/deploy/helm.go 63.15% <100%> (+0.6%) ⬆️
pkg/skaffold/debug/transform.go 82.4% <0%> (-3.8%) ⬇️
pkg/skaffold/deploy/kustomize.go 73.91% <0%> (-3.1%) ⬇️
cmd/skaffold/app/cmd/cmd.go 73.33% <0%> (-0.67%) ⬇️
cmd/skaffold/app/cmd/config/flags.go 100% <0%> (ø) ⬆️
cmd/skaffold/man/man.go 77.27% <0%> (ø) ⬆️
pkg/skaffold/docker/image_util.go 0% <0%> (ø) ⬆️
pkg/skaffold/kubernetes/wait.go 0% <0%> (ø) ⬆️
pkg/skaffold/schema/versions.go 74.35% <0%> (ø) ⬆️
pkg/skaffold/config/options.go 90.47% <0%> (ø) ⬆️
... and 17 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 06d01b1...df8a2a0. Read the comment docs.

Copy link
Collaborator

balopat left a comment

I wonder - are certain error classes going to be discovered later?
Specifically, if the helm values in the helm release config are not matching up with the artifact name due to a typo - are we just going to print a warning and fail during deployment time as we are assuming that the image was built and pushed?
Can we somehow discern between the two modes? i.e. when builds are empty (~ we are in deploy mode) then we don't check for matching, but if we are in dev/run (we do build) then we are?

@tejal29

This comment has been minimized.

Copy link
Member Author

tejal29 commented May 14, 2019

@balopat Thats a good point!
Updated the review and the tests.

@tejal29 tejal29 dismissed balopat’s stale review May 15, 2019

spoke with balint and he said the changes looked good.

if !ok {
return nil, fmt.Errorf("no build present for %s", imageName)
if len(builds) == 0 {
logrus.Warnf("no build artifacts present. Assuming skaffold deploy. Continuing with %s", imageName)

This comment has been minimized.

Copy link
@balopat

balopat May 16, 2019

Collaborator

I would make this a Debug statement instead.

This comment has been minimized.

Copy link
@nkubala

nkubala May 16, 2019

Member

I would actually just remove this altogether.

if len(builds) > 0 {
  return nil, fmt.Errorf("no build present for %s", imageName)
}
b = build.Artifact{ImageName: imageName, Tag: imageName}

This comment has been minimized.

Copy link
@tejal29

tejal29 May 20, 2019

Author Member

@nkubala I wanted to print a warn or a debug message to just give users more insight in to what is happening.

This comment has been minimized.

Copy link
@nkubala

nkubala May 20, 2019

Member

right, this would do that. I'm just proposing that you remove the log message since I don't really think it's necessary. the change I proposed is logically equivalent, just a bit easier to read IMO.

if we didn't find the build in the build map:
  * if build map is not empty -> error out because we couldn't find the specified artifact
  * continue, because we want to allow deploying without anything being built
Copy link
Collaborator

balopat left a comment

LGTM - but please change the Warning to a Debug

if !ok {
return nil, fmt.Errorf("no build present for %s", imageName)
if len(builds) == 0 {
logrus.Warnf("no build artifacts present. Assuming skaffold deploy. Continuing with %s", imageName)

This comment has been minimized.

Copy link
@nkubala

nkubala May 16, 2019

Member

I would actually just remove this altogether.

if len(builds) > 0 {
  return nil, fmt.Errorf("no build present for %s", imageName)
}
b = build.Artifact{ImageName: imageName, Tag: imageName}
@tejal29 tejal29 merged commit fd8ac69 into GoogleContainerTools:master May 20, 2019
4 checks passed
4 checks passed
cla/google All necessary CLAs are signed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
kokoro CI build successful.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.