-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
set umask on linux and darwin when testing kubeadm copycerts #104284
Conversation
/sig cluster-lifecycle |
Tested on Linux and macOS locally. |
@@ -0,0 +1,27 @@ | |||
//+build darwin linux |
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.
+++ b/cmd/kubeadm/app/phases/copycerts/testutil_umask.go
@@ -1,4 +1,4 @@
-//+build darwin linux
+// +build darwin linux
+++ b/cmd/kubeadm/app/phases/copycerts/testutil_umask_noop.go
@@ -1,4 +1,4 @@
-//+build !darwin,!linux
+// +build !darwin,!linux
to pass hack/verify-boilerplate.sh
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 will appease the robots! 🙃
@@ -0,0 +1,27 @@ | |||
// +build darwin linux |
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.
there's no // +build unix
(I hallucinated it I swear) and we don't currently actively support platforms other than these + windows, with these two being the only known platforms we support that do.
I didn't find many comparable examples in the existing codebase, mostly code that targets linux or windows specifically (for e.g. kubelet).
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 think we usually just do !windows in such a case, which is not enrirely accurate.
|
||
package copycerts | ||
|
||
func setNoUmask() { |
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.
Like i've mentioned on the issue these file mask unit tests are broken on windows, since the OS simply does not have mode bits for files. Some of the go stdlib logic is no-op on windows. I think we cross compile the kubeadm binary for windows, but we never run unit tests on windows.
If we do, this change is accurate and probably more tests would fail in cmd/kubeadm.
Thanks
/approve
/triage accepted
/priority backlog
@pacoxu please apply LGTM given you were already reviewing.
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, I think maybe some limited windows unit test running occurs, but not in CI or the release and I would be surprised if it didn't have many issues similar to #102607 already ...
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BenTheElder, neolit123 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
What type of PR is this?
/kind failing-test
What this PR does / why we need it:
Makes the kubeadm copycerts unit tests independent of the system umask.
Which issue(s) this PR fixes:
Fixes #104265
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: