-
Notifications
You must be signed in to change notification settings - Fork 881
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
Add Kustomize dependency #2366
base: main
Are you sure you want to change the base?
Add Kustomize dependency #2366
Conversation
@@ -32,10 +32,12 @@ | |||
default_network = "kind" | |||
extra_network = "network2" | |||
controller_gen_version = "v0.14.0" | |||
kubectl_version = "v1.27.0" | |||
kustomize_version = "v5.4.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should verify that this is actually the version needed, I could not find which exact version metallb uses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the latest should work. What's important is pinning so we'll have reproducible behaviour.
@@ -32,10 +32,12 @@ | |||
default_network = "kind" | |||
extra_network = "network2" | |||
controller_gen_version = "v0.14.0" | |||
kubectl_version = "v1.27.0" | |||
kustomize_version = "v5.4.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the latest should work. What's important is pinning so we'll have reproducible behaviour.
build_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "build") | ||
kubectl_path = os.path.join(build_path, "kubectl") | ||
controller_gen_path = os.path.join(build_path, "bin", "controller-gen") | ||
kubectl_version = "v1.27.0" | ||
kustomize_path = os.path.join(build_path, "bin", "kustomize") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you also use this in place where we currently call kustomize straight? IIUC should only be here
Line 324 in 28b13e3
fetch_controller_gen() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I've added the fetch_kustomize on top of the function as requested,
For what concerns the comment
can you also use this in place where we currently call kustomize straight
I may be misunderstanding, but as it is now I should be already using that kustomize_path
when we call kustomize. Did you find any place where I'm missing it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, apologies. I did a quick search and found
Line 335 in 28b13e3
res = run("{} kustomize config/{} > {}".format(kubectl_path, layer, output)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And checking again, I can't find a place where kustomize_path is used, so it maybe makes sense just to drop it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I'm using it in my fetch_kustomize
function to run the get version command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep but the point of fetch_kustomize
is to fetch it to use it :-)
If we use kubectl kustomize
there is no point in even fetching it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, let's use kustomize in
Line 335 in 28b13e3
res = run("{} kustomize config/{} > {}".format(kubectl_path, layer, output)) |
instead of kubectl kustomize.
Does it make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah it makes sense, so I keep the variable kustomize_path
and will modify this line of code.
Sorry for the delay. Left a couple of comments. Can you also sign the commit? |
64fdac5
to
1085bd0
Compare
/kind dependencies |
Signed-off-by: Fulvio Denza <fulviodenza823@gmail.com>
Signed-off-by: Fulvio Denza <fulviodenza823@gmail.com>
I will fix the commit sign at the end so that I don't have to do it at any rebase |
Tried locally, getting the following error:
|
Can i ask you how you are testing it locally? @fedepaol |
I just run |
I was looking at the error from the pipeline and I actually wanted to test it locally. Will fix this and back to you |
Is this a BUG FIX or a FEATURE ?:
/kind dependencies
What this PR does / why we need it:
This PR adds the dependency for Kustomize as requested in #1307 in the python script to fetch dependencies, the controller-gen was not required anymore.
We can use this PR also to update the tasks.py file in case there are some dependencies to update. Further we should verify the kustomize version.
Release note: