kubernetes / system-validators

A set of system-oriented validators for kubeadm preflight checks.
Apache License 2.0
35 stars 27 forks source link

properly perform build verification and skip some tests on non-Linux #14

Closed neolit123 closed 4 years ago

neolit123 commented 4 years ago

fix issues that blocked this PR from merging in k/k: https://github.com/kubernetes/kubernetes/pull/89901

contains 4 commits:

cgroup_validator: don't validate cgroups on non-Linux
package_validator: don't validate packages on non-Linux

this PR added a golang.org/x/sys/unix import, but unix.CGROUP2_SUPER_MAGIC is not defined on windows. cgroup and package validation only makes sense on Linux, thus split the files and no-op the cgroup and package validation for !linux. package validation could be extended one day to support other OSes and package managers, but might be a better idea to remove this code instead..


ValidateSpec: don't include cgroups and package validators on non-Linux

running cgroup and package validation does not make sense for non-Linux OSes.


hack: run govet for all supported OS-es (darwin,linux,windows)

This will catch compile time problems not only for the host OS where the verification is being run.


neolit123 commented 4 years ago

/kind bug /priority important-longterm /assign @odinuge

odinuge commented 4 years ago

Thanks for fixing!

/lgtm

k8s-ci-robot commented 4 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: neolit123, odinuge

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: - ~~[OWNERS](https://github.com/kubernetes/system-validators/blob/master/OWNERS)~~ [neolit123] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment