-
Notifications
You must be signed in to change notification settings - Fork 39.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
Add Windows support to the system verification check #53730
Add Windows support to the system verification check #53730
Conversation
@bsteciuk: Adding do-not-merge/release-note-label-needed because the release note process has not been followed. One of the following labels is required "release-note", "release-note-action-required", or "release-note-none". Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi @bsteciuk. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
PTAL @kubernetes/sig-node-pr-reviews |
/release-note |
@luxas: the
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@Random-Liu Yeah, a build tag is even better. Let's do that instead, thanks ;-) |
@luxas @Random-Liu - 👍 on it |
} | ||
|
||
// DefaultKernelValidatorHelper is the 'linux' implementation of KernelValidatorHelper | ||
type DefaultKernelValidatorHelper struct { |
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.
nit: prefer empty struct on one line
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.
updated.
} | ||
|
||
// WindowsKernelValidatorHelper is the 'windows' implementation of KernelValidatorHelper | ||
type WindowsKernelValidatorHelper struct { |
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.
nit: prefer empty struct on one line
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.
updated.
/retest |
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.
Thanks @bsteciuk
After these changes, this PR LGTM
|
||
func (o *WindowsKernelValidatorHelper) GetKernelRelease() ([]byte, error) { | ||
args := []string{"(Get-CimInstance Win32_OperatingSystem).Version"} | ||
kernel, err := exec.Command("powershell", args...).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.
nit, you can just write return exec.Command("powershell", args...).Output()
here directly
} | ||
|
||
// DefaultKernelValidatorHelper is the 'linux' implementation of KernelValidatorHelper | ||
type DefaultKernelValidatorHelper struct{} |
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 would call this LinuxKernelValidatorHelper
// DefaultKernelValidatorHelper is the 'linux' implementation of KernelValidatorHelper | ||
type DefaultKernelValidatorHelper struct{} | ||
|
||
func (o *DefaultKernelValidatorHelper) GetKernelRelease() ([]byte, error) { |
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.
comment
type DefaultKernelValidatorHelper struct{} | ||
|
||
func (o *DefaultKernelValidatorHelper) GetKernelRelease() ([]byte, error) { | ||
kernel, err := exec.Command("uname", "-r").CombinedOutput() |
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.
return this directly
// WindowsKernelValidatorHelper is the 'windows' implementation of KernelValidatorHelper | ||
type WindowsKernelValidatorHelper struct{} | ||
|
||
func (o *WindowsKernelValidatorHelper) GetKernelRelease() ([]byte, error) { |
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.
comment
|
||
package system | ||
|
||
// GetSysSpec returns os specific SysSpec |
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.
// DefaultSysSpec...
test/e2e_node/system/types_unix.go
Outdated
|
||
package system | ||
|
||
// DefaultSysSpec is the default SysSpec. |
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.
... for 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.
/lgtm
/retest |
/assign @Random-Liu |
var DefaultSysSpec = SysSpec{ | ||
OS: "Microsoft Windows Server 2016", | ||
KernelSpec: KernelSpec{ | ||
Versions: []string{`10\.[0-9]\.1439[3-9]*`, `10\.[0-9]\.144[0-9]*`, `10\.[0-9]\.15[0-9]*`, `10\.[0-9]\.2[0-9]*`}, //requires >= '10.0.14393' |
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.
10\.[0-9]\.1439[3-9]*
will match also10.2.1439
.10\.[0-9]\.144[0-9]*
will match10.0.144
which is lower than '10.0.14393'10\.[0-9]\.15[0-9]*
, same here. will match10.0.15
, which is lower than '10.0.14393'10\.[0-9]\.2[0-9]*
, will match10.0.200
, , which is lower than '10.0.14393'
Something that you probably want to have here is:
Versions: []string{`10\.0\.1439[3-9]`, `10\.0\.14[4-9][0-9]{2}`, `10\.0\.1[5-9][0-9]{3}`, `10\.0\.[2-9][0-9]{4}`,`10\.[1-9]+\.[0-9]+}, //requires >= '10.0.14393'
That would match ranges:
- 10.0.14393 -- 10.0.14399
- 10.0.14400 -- 10.0.14999
- 10.0.15000 -- 10.0.19999
- 10.0.20000 -- 10.0.99999
- 10.1.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.
good catch!
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.
updated
b8a4ed9
to
38507b3
Compare
@Random-Liu PTAL |
@brendandburns Please take a look at this one and approve. |
test/e2e_node/system/types_unix.go
Outdated
import "os/exec" | ||
|
||
// DockerEndpoint is the os specific endpoint for docker communication | ||
const DockerEndpoint = "unix:///var/run/docker.sock" |
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.
Why exporting the variable?
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.
yup, export was not necessary
// KernelValidatorHelper is an interface intended to help with os specific kernel validation | ||
type KernelValidatorHelper interface { | ||
// GetKernelRelease gets the current kernel release version of the system | ||
GetKernelRelease() ([]byte, error) |
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.
GetKernelVersion
or GetKernelReleaseVersion
is more precise.
Also, I think the function should just return a string. Any trimming and byte array conversation should be done in the function.
/retest |
Didn't review the Windows spec closely, but the rest LGTM |
/retest |
please don't forget to squash commits. |
Pulled SysSpecs out of types.go and created two os specific implementations with build tags Similarly created conditionally compiled implementations of KernelValidationHelper to get Kernel version in os specific manner, as well as os specific docker endpoints (socket vs named pipes)
8c7bd27
to
94db64f
Compare
squashed |
@brendanburns @yujuhong This ok to approve now? |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns, bsteciuk, luxas Associated issue: 364 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
@bsteciuk: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here. |
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Kubeadm - Added initial support for Windows worker nodes to join cluster using kubeadm **What this PR does / why we need it**: This PR adds initial support for adding a Windows worker node to a Kubernetes cluster with kubeadm. Also adds Windows build of kubeadm to node build targets. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes kubernetes/kubeadm#364 **Special notes for your reviewer**: Depends on kubernetes#53730 **Release note**: ```release-note kubeadm: Add support for adding a Windows node ```
What this PR does / why we need it: This PR (in conjunction with #53553 ) adds initial support for adding a Windows worker node to a Kubernetes cluster using
kubeadm. It was suggested on that PR to open a separate PR for the changes in test/e2e_node for review by sig-node devs.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #364 in conjuction with #53553Special notes for your reviewer:
Release note: