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

Skaffold should error on an invalid context directory #4491

Closed
briandealwis opened this issue Jul 17, 2020 · 0 comments · Fixed by #4492
Closed

Skaffold should error on an invalid context directory #4491

briandealwis opened this issue Jul 17, 2020 · 0 comments · Fixed by #4492
Assignees
Labels
area/build area/errors kind/usability priority/p0 Highest priority. We are actively looking at delivering it.

Comments

@briandealwis
Copy link
Member

Expected behavior

Noticed by Rune FS on StackOverflow: Skaffold does not raise an error on startup if an artifact has an invalid context directory, and instead produces a difficult to decipher error.

Actual behavior

--- 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
Generating tags...
 - skaffold-example -> skaffold-example:latest
Some taggers failed. Rerun with -vdebug for errors.
Checking cache...
 - skaffold-example: Error checking cache.
getting hash for artifact "skaffold-example": getting dependencies for "skaffold-example": file pattern [main.go] must match at least one file

Try without the build-cache:

$ skaffold  build --cache-artifacts=false
Generating tags...
 - skaffold-example -> skaffold-example:latest
Some taggers failed. Rerun with -vdebug for errors.
Found [minikube] context, using local docker daemon.
Building [skaffold-example]...
Sending build context to Docker daemon 

couldn't build "skaffold-example": docker build: error during connect: Post "https://192.168.192.145:2376/v1.40/build?buildargs=null&cachefrom=null&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&forcerm=1&labels=null&memory=0&memswap=0&networkmode=&rm=0&shmsize=0&t=skaffold-example%3Alatest&target=&ulimits=null&version=": creating docker context: getting relative tar paths: file pattern [main.go] must match at least one file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build area/errors kind/usability priority/p0 Highest priority. We are actively looking at delivering it.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant