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

Fix 4979 render should validate manifests #6043

Conversation

aaron-prindle
Copy link
Contributor

@aaron-prindle aaron-prindle commented Jun 18, 2021

Fixes #4979

examples/getting-started/k8s-pod.yaml Outdated Show resolved Hide resolved
pkg/skaffold/parser/config.go Outdated Show resolved Hide resolved
@aaron-prindle aaron-prindle force-pushed the fix-4979_render-should-validate-manifests branch from 6ebce74 to f24c4a2 Compare June 18, 2021 19:14
@aaron-prindle aaron-prindle marked this pull request as ready for review June 18, 2021 19:16
@aaron-prindle aaron-prindle requested a review from a team as a code owner June 18, 2021 19:16
@aaron-prindle aaron-prindle requested a review from nkubala June 18, 2021 19:16
@aaron-prindle
Copy link
Contributor Author

This is ready for review now (moved out of draft)

@aaron-prindle aaron-prindle force-pushed the fix-4979_render-should-validate-manifests branch 2 times, most recently from 18cf820 to a2f3f55 Compare June 18, 2021 19:18
@codecov
Copy link

codecov bot commented Jun 18, 2021

Codecov Report

Merging #6043 (acadbad) into master (9cd80d3) will decrease coverage by 0.00%.
The diff coverage is 58.06%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6043      +/-   ##
==========================================
- Coverage   70.20%   70.19%   -0.01%     
==========================================
  Files         475      475              
  Lines       18157    18187      +30     
==========================================
+ Hits        12747    12767      +20     
- Misses       4473     4481       +8     
- Partials      937      939       +2     
Impacted Files Coverage Δ
cmd/skaffold/app/cmd/runner.go 57.14% <0.00%> (ø)
pkg/skaffold/schema/validation/validation.go 84.44% <58.62%> (-2.62%) ⬇️
cmd/skaffold/app/cmd/fix.go 75.55% <100.00%> (ø)
pkg/skaffold/access/provider.go 26.66% <0.00%> (-23.34%) ⬇️
pkg/skaffold/docker/parse.go 86.19% <0.00%> (-0.96%) ⬇️
pkg/skaffold/deploy/kpt/kpt.go 80.85% <0.00%> (ø)
pkg/skaffold/deploy/helm/deploy.go 78.22% <0.00%> (ø)
pkg/skaffold/deploy/kubectl/cli.go 88.09% <0.00%> (ø)
pkg/skaffold/schema/latest/v1/config.go 58.82% <0.00%> (ø)
...affold/kubernetes/portforward/forwarder_manager.go 47.91% <0.00%> (ø)
... 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 9cd80d3...acadbad. Read the comment docs.

@aaron-prindle aaron-prindle force-pushed the fix-4979_render-should-validate-manifests branch from a2f3f55 to 142062f Compare June 18, 2021 20:50
pkg/skaffold/parser/config.go Outdated Show resolved Hide resolved
@aaron-prindle aaron-prindle force-pushed the fix-4979_render-should-validate-manifests branch 6 times, most recently from 7e18335 to 7f16c84 Compare June 21, 2021 20:50
@tejal29 tejal29 enabled auto-merge (squash) June 21, 2021 21:08
@aaron-prindle aaron-prindle force-pushed the fix-4979_render-should-validate-manifests branch 2 times, most recently from bc2d183 to 29665c2 Compare June 22, 2021 04:59
Copy link
Contributor

@gsquared94 gsquared94 left a comment

Choose a reason for hiding this comment

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

@tejal29
Copy link
Contributor

tejal29 commented Jun 23, 2021

we should move these changes inside the individual Deployer.Render methods:
https://github.com/gsquared94/skaffold/blob/71ece9d2e37b11a88379c4aa97b5f0e0ec1e2b82/pkg/skaffold/deploy/kubectl/kubectl.go#L245

Is there a reason why? I though this is validating the schema and hence should be done for every flow. "Deploy, render"

@tejal29
Copy link
Contributor

tejal29 commented Jun 23, 2021

Please rebase!!

@aaron-prindle aaron-prindle force-pushed the fix-4979_render-should-validate-manifests branch from 29665c2 to 05bfd83 Compare June 24, 2021 01:22
@aaron-prindle
Copy link
Contributor Author

I've rebased now. I'm currently leaving the validation as is for the config, lmk if I should modify this to a different design.

@gsquared94
Copy link
Contributor

we should move these changes inside the individual Deployer.Render methods:

https://github.com/gsquared94/skaffold/blob/71ece9d2e37b11a88379c4aa97b5f0e0ec1e2b82/pkg/skaffold/deploy/kubectl/kubectl.go#L245

Is there a reason why? I though this is validating the schema and hence should be done for every flow. "Deploy, render"

We want to avoid these checks for inspect and diagnose commands. Those are (will be) frequently by the IDEs and we want to keep them fast.

@gsquared94
Copy link
Contributor

I've rebased now. I'm currently leaving the validation as is for the config, lmk if I should modify this to a different design.

Putting this in parser/config.go is definitely not the right place. As you can see you're having to manage the multi config scenario yourself. Please move this to the validations package.

@gsquared94
Copy link
Contributor

there are a few empty files. Should those be removed?

@aaron-prindle
Copy link
Contributor Author

there are a few empty files. Should those be removed?

The empty files are there because the GeneratePipeline test currently violates the validation - it has manifests that do not exist. The empty files are to make the validation pass

I will move the code the validations.go and do the validation in Render, thanks Gaurav

@aaron-prindle aaron-prindle force-pushed the fix-4979_render-should-validate-manifests branch from 05bfd83 to 590b650 Compare June 28, 2021 17:45
@aaron-prindle
Copy link
Contributor Author

Requested changes made, rebased to #6087 so that manifest values can be specified for better errors

@aaron-prindle aaron-prindle force-pushed the fix-4979_render-should-validate-manifests branch 4 times, most recently from 1a09cfc to ebfd85d Compare June 29, 2021 01:08
@aaron-prindle aaron-prindle added the kokoro:force-run forces a kokoro re-run on a PR label Jun 29, 2021
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Jun 29, 2021
@aaron-prindle aaron-prindle force-pushed the fix-4979_render-should-validate-manifests branch 2 times, most recently from 807316b to 66136e3 Compare June 29, 2021 05:09
@briandealwis
Copy link
Member

Tests are failing.

@aaron-prindle aaron-prindle force-pushed the fix-4979_render-should-validate-manifests branch 2 times, most recently from 243acdb to 1dc8ace Compare June 29, 2021 17:46
@aaron-prindle aaron-prindle force-pushed the fix-4979_render-should-validate-manifests branch from 1dc8ace to acadbad Compare June 29, 2021 17:54
@aaron-prindle aaron-prindle added the kokoro:force-run forces a kokoro re-run on a PR label Jun 29, 2021
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Jun 29, 2021
@tejal29 tejal29 merged commit a66f869 into GoogleContainerTools:master Jun 29, 2021
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 render exits normally when no inputs are found
5 participants