Add kubectl config flag to disable validation#3512
Add kubectl config flag to disable validation#3512dgageot merged 1 commit intoGoogleContainerTools:masterfrom zmb3:zb-add-kubectl-validate-flag
Conversation
pkg/skaffold/schema/latest/config.go
Outdated
| // RemoteManifests lists Kubernetes manifests in remote clusters. | ||
| RemoteManifests []string `yaml:"remoteManifests,omitempty"` | ||
|
|
||
| // DisableValidation passes the `--valdiate=false` flag to supported |
| DisableValidation bool `yaml:"validate,omitempty"` | ||
|
|
||
| // Flags are additional flags passed to `kubectl`. | ||
| Flags KubectlFlags `yaml:"flags,omitempty"` |
There was a problem hiding this comment.
I wonder if DisableValidation could be under KubectlFlags somehow?
There was a problem hiding this comment.
I don't think we want it under KubectlFlags, because those flags are applied for any kubectl command we run, and --validate is only a valid option on some commands.
There was a problem hiding this comment.
I meant, could we add a DisableValidation field to KubectlFlags and apply that to supported kubectl commands.
There was a problem hiding this comment.
Oh, right. That makes a lot of sense!
Codecov Report
|
pkg/skaffold/deploy/kubectl.go
Outdated
| CLI: kubectl.NewFromRunContext(runCtx), | ||
| Flags: runCtx.Cfg.Deploy.KubectlDeploy.Flags, | ||
| ForceDeploy: runCtx.Opts.Force, | ||
| DisableValidation: runCtx.Cfg.Deploy.KubectlDeploy.Flags.DisableValidation, |
There was a problem hiding this comment.
This line is not required, now
pkg/skaffold/deploy/kubectl/cli.go
Outdated
| ForceDeploy bool | ||
| previousApply ManifestList | ||
| ForceDeploy bool | ||
| DisableValidation bool |
pkg/skaffold/deploy/kubectl/cli.go
Outdated
| args = append(args, "--force", "--grace-period=0") | ||
| } | ||
|
|
||
| if c.DisableValidation { |
There was a problem hiding this comment.
c. Flags. DisableValidation
pkg/skaffold/deploy/kubectl/cli.go
Outdated
| } | ||
|
|
||
| args := c.args([]string{"--dry-run", "-oyaml"}, list...) | ||
| if c.DisableValidation { |
There was a problem hiding this comment.
c. Flags. DisableValidation
pkg/skaffold/schema/latest/config.go
Outdated
|
|
||
| // DisableValidation passes the `--validate=false` flag to supported | ||
| // `kubectl` commands when enabled. | ||
| DisableValidation bool `yaml:"validate,omitempty"` |
There was a problem hiding this comment.
Thank you for making all the changes!
One more problem and we should be good to go:
DisableValidation can't be called validate in the yaml. The first one is a negation. disableValidation seems an ok name
There was a problem hiding this comment.
Thanks for your review and patience as I try to squeeze this in my mornings :-)
|
Oh, I'm sorry @zmb3, we released the |
|
@zmb3 Should be ready for a rebase |
|
Thanks @dgageot, that was fast for not before Monday! |
|
\o/ |
Fixes #3222
Relates to n/a
Should merge before : n/a
Should merge after : n/a
Description
Add config flag to disable validation when using the kubectl deployer.
When enabled,
--validate=falseis passed to thekubectl applyandkubectl createcommands.User facing changes
n/a
Before
n/a
After
n/a
Next PRs.
n/a
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
Reviewer Notes
Release Notes