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 says all is well even when there were validation errors #1738

Closed
andsens opened this issue Mar 6, 2019 · 7 comments
Closed

skaffold says all is well even when there were validation errors #1738

andsens opened this issue Mar 6, 2019 · 7 comments
Labels
area/deploy good first issue Good for newcomers help wanted We would love to have this done, but don't have the bandwidth, need help from contributors kind/bug Something isn't working

Comments

@andsens
Copy link

andsens commented Mar 6, 2019

While examining the error from #1737 I noticed that skaffold said all was fine and that the deployment completed, even though the manifest failed to validate.

Expected behavior

skaffold returns with a non-zero exit code when manifest validation fails.

Actual behavior

skaffold return with 0 and actually says "Deploy complete"

Information

  • Skaffold version: 0.24.0
  • Operating system: MacOS 10.14.3
  • Contents of skaffold.yaml:
apiVersion: skaffold/v1beta6
kind: Config
deploy:
  kustomize:
    path: .

Steps to reproduce the behavior

  1. skaffold run this gist.

Full log

$ skaffold run
Starting build...
Build complete in 40.014µs
Starting test...
Test complete in 7.814µs
Starting deploy...
kubectl client version: 1.13
error: error validating "STDIN": error validating data: ValidationError(CustomResourceDefinition.spec.validation.openAPIV3Schema.properties.metadata): unknown field "labels" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps; if you choose to ignore these errors, turn validation off with --validate=false
Deploy complete in 644.45351ms
You can also run [skaffold run --tail] to get the logs
@tejal29 tejal29 added kind/bug Something isn't working good first issue Good for newcomers labels Mar 6, 2019
@tejal29
Copy link
Contributor

tejal29 commented Mar 6, 2019

Thanks @andsens for this bug report. Just to confirm, kubectl deploy end up deploying any other resources?

@andsens
Copy link
Author

andsens commented Mar 6, 2019

The log is from the manifest in the gist, which only contains the one resource. I haven't actually checked what happens when the manifests partially validate. Let me check on Friday and I'll report back.

@tejal29
Copy link
Contributor

tejal29 commented Mar 7, 2019

no problem!

@andsens
Copy link
Author

andsens commented Mar 8, 2019

@tejal29 no other resources seem to deploy. I tested by adding this pod.yaml

---
apiVersion: v1
kind: Pod
metadata:
  name: busybox
spec:
  containers:
  - name: busybox
    image: busybox:1.28
    command:
    - sleep
    - "3600"
    imagePullPolicy: IfNotPresent
  restartPolicy: Always

I tried adding pod.yaml both before and after crd.yaml in kustomization.yaml with the same result. The output was identical to the one above.

When removing crd.yaml from kustomization.yaml the pod deploys as expected of course :-)

@tejal29
Copy link
Contributor

tejal29 commented Mar 12, 2019

Thanks @andsens. Someone from the team will pick it up once triaged.

@nkubala nkubala added the help wanted We would love to have this done, but don't have the bandwidth, need help from contributors label Mar 26, 2019
@nkubala
Copy link
Contributor

nkubala commented May 7, 2019

closed via #2076

@nkubala nkubala closed this as completed May 7, 2019
@andsens
Copy link
Author

andsens commented May 7, 2019

Awesome stuff. Thanks @pyaillet!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/deploy good first issue Good for newcomers help wanted We would love to have this done, but don't have the bandwidth, need help from contributors kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants