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

Error on invalid artifact workspace #4492

Merged
merged 3 commits into from
Jul 20, 2020

Conversation

briandealwis
Copy link
Member

Fixes: #4491

Description

Adds a validation step to ensure that all artifact workspaces exist.

Invalid location

--- examples/getting-started/skaffold.yaml
+++ examples/getting-started/skaffold.yaml
@@ -3,6 +3,7 @@ kind: Config
 build:
   artifacts:
   - image: skaffold-example
+    context: this/path/does/not/exist
 deploy:
   kubectl:
     manifests:
$ skaffold build
invalid skaffold config: image "skaffold-example" context "this/path/does/not/exist" does not exist

File

diff --git examples/getting-started/skaffold.yaml examples/getting-started/skaffold.yaml
index cbf95a1a7..3cd2940ac 100644
--- examples/getting-started/skaffold.yaml
+++ examples/getting-started/skaffold.yaml
@@ -3,6 +3,7 @@ kind: Config
 build:
   artifacts:
   - image: skaffold-example
+    context: main.go
 deploy:
   kubectl:
     manifests:
$ skaffold build
invalid skaffold config: image "skaffold-example" context "main.go" is not a directory

@briandealwis briandealwis requested a review from a team as a code owner July 17, 2020 20:18
@codecov
Copy link

codecov bot commented Jul 20, 2020

Codecov Report

Merging #4492 into master will decrease coverage by 0.00%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4492      +/-   ##
==========================================
- Coverage   72.37%   72.36%   -0.01%     
==========================================
  Files         333      333              
  Lines       12944    12956      +12     
==========================================
+ Hits         9368     9376       +8     
- Misses       2980     2982       +2     
- Partials      596      598       +2     
Impacted Files Coverage Δ
pkg/skaffold/schema/validation/validation.go 93.89% <83.33%> (-1.07%) ⬇️
...affold/kubernetes/portforward/kubectl_forwarder.go 60.97% <0.00%> (-2.44%) ⬇️

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 6732e44...7ce054f. Read the comment docs.

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.

This LGTM!

@briandealwis briandealwis merged commit b2b5258 into GoogleContainerTools:master Jul 20, 2020
@briandealwis briandealwis deleted the i4491 branch July 20, 2020 20:39
briandealwis added a commit to briandealwis/skaffold that referenced this pull request Aug 13, 2020
gsquared94 pushed a commit that referenced this pull request Aug 18, 2020
…ploy (#4657)

* Revert #4492

* Error in build when encountering an invalid artifact context

* gofmt

* Add tests

* Hide util.Copy; fix up stray local testing bogons

* revert to origin/master

* gofmt
nkubala pushed a commit to nkubala/skaffold that referenced this pull request Aug 20, 2020
…ploy (GoogleContainerTools#4657)

* Revert GoogleContainerTools#4492

* Error in build when encountering an invalid artifact context

* gofmt

* Add tests

* Hide util.Copy; fix up stray local testing bogons

* revert to origin/master

* gofmt
nkubala pushed a commit to nkubala/skaffold that referenced this pull request Aug 20, 2020
…ploy (GoogleContainerTools#4657)

* Revert GoogleContainerTools#4492

* Error in build when encountering an invalid artifact context

* gofmt

* Add tests

* Hide util.Copy; fix up stray local testing bogons

* revert to origin/master

* gofmt
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.

Skaffold should error on an invalid context directory
3 participants