fix: add upgrade logic to inject a kubectl deployer when an old kustomize deployer is detected#8457
Conversation
Codecov Report
@@ Coverage Diff @@
## main #8457 +/- ##
==========================================
- Coverage 70.48% 65.26% -5.22%
==========================================
Files 515 602 +87
Lines 23150 29935 +6785
==========================================
+ Hits 16317 19537 +3220
- Misses 5776 8932 +3156
- Partials 1057 1466 +409
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
b5a6970 to
e95b016
Compare
| kubectlDeployerWasInjected = true | ||
| } | ||
|
|
||
| if err := mergeKustomizeIntoKubectlDeployer(newPL.Deploy.KubectlDeploy, oldPL.Deploy.KustomizeDeploy, kubectlDeployerWasInjected); err != nil { |
There was a problem hiding this comment.
will doing mergeKustomizeIntoKubectlDeployer(oldPL *Pipeline, newPL *next.Pipeline) simplify this?
There was a problem hiding this comment.
Done! I moved all the logic to the new function I created, removing the third parameter used before. Let me know what do you think.
| } | ||
| } | ||
|
|
||
| func mergeKustomizeIntoKubectlDeployer(newKubectlDeployer *next.KubectlDeploy, oldKustomizeDeployer *KustomizeDeploy, kubectlDeployerWasInjected bool) error { |
There was a problem hiding this comment.
Awesome! Thanks for the reference, I changed the variables name. Let me know what do you think.
…mize deployer is detected
|
We upgraded our Skaffold verstion to latest version 2.3 and Max Schema version is v4beat4. Our Kustomization's max schema version is "kustomize.config.k8s.io/v1beta1". Please help us to fix this issue. The current version we are using is 1.39 which accepts the above skaffold file with the kustomization version. |
|
Hey @BabuRajan002, could you please open a new issue in the Skaffold repo with the details of the error you are getting? Also, it will be great if you can include a repo with a minimal version that can be use to reproduce the problem. I think for this case the content of the Kustomization file will be good to understand what's happening. Also, we can use that new issue to continue the discussion. Thanks a lot! |
|
@renzodavid9 As you mentioned above, I've created a new issue here - #8802. But I did not get any response. |
Fixes: #8423
Description
New logic to create a kubectl deployer when an old kustomize deployer is present during upgrade. The logic creates a new kubectl deployer and merge the values from the old kustomize deployer into it. When a kubectl deployer is already present, we try to merge it with the configuration from the old kustomize deployer. Code will error if the
defaultNamespaceorflags.disableValidationare present in both and are different.