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

Loose kustomize version requirements #4994

Merged

Conversation

yuwenma
Copy link
Contributor

@yuwenma yuwenma commented Nov 4, 2020

Fixes: #4981 #3904

Description
We warn users if kustomize version is non-official or too old. We don't block users using an old kustomize version since we believe kpt can better deal with the kustomize versioning once using a builtin kustomize .

@yuwenma yuwenma requested a review from a team as a code owner November 4, 2020 11:09
@yuwenma yuwenma requested a review from IsaacPD November 4, 2020 11:09
@google-cla google-cla bot added the cla: yes label Nov 4, 2020
@yuwenma
Copy link
Contributor Author

yuwenma commented Nov 4, 2020

/Assign @MarlonGamez

@yuwenma yuwenma added deploy/kpt kind/bug Something isn't working kind/friction Issues causing user pain that do not have a workaround and removed kind/bug Something isn't working labels Nov 4, 2020
@yuwenma yuwenma added this to the v1.17.0 milestone Nov 4, 2020
@codecov
Copy link

codecov bot commented Nov 4, 2020

Codecov Report

Merging #4994 into master will increase coverage by 0.04%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4994      +/-   ##
==========================================
+ Coverage   72.17%   72.21%   +0.04%     
==========================================
  Files         363      363              
  Lines       12750    12760      +10     
==========================================
+ Hits         9202     9215      +13     
+ Misses       2864     2862       -2     
+ Partials      684      683       -1     
Impacted Files Coverage Δ
pkg/skaffold/deploy/kpt/kpt.go 75.17% <75.00%> (+1.25%) ⬆️
pkg/skaffold/build/jib/jib.go 68.99% <0.00%> (-0.50%) ⬇️
pkg/skaffold/build/jib/types.go 100.00% <0.00%> (ø)
pkg/skaffold/docker/image.go 81.93% <0.00%> (+1.32%) ⬆️

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 e252d0d...b232995. Read the comment docs.

@yuwenma yuwenma force-pushed the kustomize-no-verison-limit branch from 7606e4d to 01749a0 Compare November 4, 2020 11:27
pkg/skaffold/deploy/kpt/kpt.go Outdated Show resolved Hide resolved
@@ -116,15 +124,12 @@ func versionCheck(dir string) error {
re := regexp.MustCompile(kustomizeVersionRegexP)
match := re.FindStringSubmatch(versionInfo)
if len(match) != 2 {
return fmt.Errorf("unknown kustomize version %v\nPlease upgrade your "+
Copy link
Member

Choose a reason for hiding this comment

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

WDYT about moving this kustomize version parsing logic into the kustomize package, similar to how we do kubectl.CompareVersionTo() checks? And similarly extracting the kpt version checking too? Then the version-checking can be tested in isolation and not involve string matching against the warning text.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Very reasonable suggestion. We can add similar logic to kustomize package, but we may want to separate the version check from kpt. This is because we will replace the kustomize CLI to builtin kustomize package in kpt. This is pending until the unified kpt/kustomize design is done in the kpt team.

Comment on lines +64 to +67
kustomizeFurtherGuidance = fmt.Sprintf("Please make sure your local "+
"kustomize version >= the official version %v, otherwise some features may not be "+
"well supported. You can download the official version "+
"from %v", kustomizeMinVersion, kustomizeDownloadLink)
Copy link
Member

Choose a reason for hiding this comment

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

I don't think it makes sense to have this text as a var since the arguments as positional instead of named. I think you're assigning this as a var to be used from the tests.

@tejal29 @PriyaModali here's a possible contribution to build failures that we should report upwards in our metrics: incompatible dependency versions. We have this for kubectl, helm, and now kpt and kustomize.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't have strong opinions on the var usage. Yeah, this is just to save some lines in the unitests.

Copy link
Contributor Author

@yuwenma yuwenma Nov 4, 2020

Choose a reason for hiding this comment

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

Just FYI, for the incompatible dependency versions, I guess it is fine to ignore the conflict if users use kustomize in kpt deployer (like this PR only warns users but doesn't have hard requirements on actions) . This is because we will replace the kustomize here to some kpt builtin functions, so this version check may likely be changed someday in Q1 2021.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ack @briandealwis .
This is something i discussed with @tstromberg internally. Skaffold needs to provide a framework or mechanism to error out with an error code instead of playing this catch up game for new error messages.
Minikube has this implemented here

I am working on this idea. Happy to hear any thoughts.

Co-authored-by: Brian de Alwis <bsd@acm.org>
@MarlonGamez
Copy link
Contributor

I think this is looking good now. +1 to Brian's idea about separating the kustomize version checking into the kustomize package, but that should probably be in a different PR. I'll run kokoro and wait on the result

@MarlonGamez MarlonGamez merged commit d449958 into GoogleContainerTools:master Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes deploy/kpt kind/friction Issues causing user pain that do not have a workaround size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deploy - KPT - kustomizeVersionRegexP does not support non-Zulu BuildDate
4 participants