mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Merge pull request #93000 from hakman/node-os-arch
Skip arch dependent kubectl test for non AMD64 nodes
This commit is contained in:
commit
c2b7aa0353
@ -213,6 +213,13 @@ func SkipUnlessNodeOSDistroIs(supportedNodeOsDistros ...string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SkipUnlessNodeOSArchIs skips if the node OS distro is not included in the supportedNodeOsArchs.
|
||||||
|
func SkipUnlessNodeOSArchIs(supportedNodeOsArchs ...string) {
|
||||||
|
if !framework.NodeOSArchIs(supportedNodeOsArchs...) {
|
||||||
|
skipInternalf(1, "Only supported for node OS arch %v (not %s)", supportedNodeOsArchs, framework.TestContext.NodeOSArch)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// SkipIfNodeOSDistroIs skips if the node OS distro is included in the unsupportedNodeOsDistros.
|
// SkipIfNodeOSDistroIs skips if the node OS distro is included in the unsupportedNodeOsDistros.
|
||||||
func SkipIfNodeOSDistroIs(unsupportedNodeOsDistros ...string) {
|
func SkipIfNodeOSDistroIs(unsupportedNodeOsDistros ...string) {
|
||||||
if framework.NodeOSDistroIs(unsupportedNodeOsDistros...) {
|
if framework.NodeOSDistroIs(unsupportedNodeOsDistros...) {
|
||||||
|
@ -116,6 +116,7 @@ type TestContextType struct {
|
|||||||
ImageServiceEndpoint string
|
ImageServiceEndpoint string
|
||||||
MasterOSDistro string
|
MasterOSDistro string
|
||||||
NodeOSDistro string
|
NodeOSDistro string
|
||||||
|
NodeOSArch string
|
||||||
VerifyServiceAccount bool
|
VerifyServiceAccount bool
|
||||||
DeleteNamespace bool
|
DeleteNamespace bool
|
||||||
DeleteNamespaceOnFailure bool
|
DeleteNamespaceOnFailure bool
|
||||||
@ -324,6 +325,7 @@ func RegisterClusterFlags(flags *flag.FlagSet) {
|
|||||||
flags.StringVar(&TestContext.Prefix, "prefix", "e2e", "A prefix to be added to cloud resources created during testing.")
|
flags.StringVar(&TestContext.Prefix, "prefix", "e2e", "A prefix to be added to cloud resources created during testing.")
|
||||||
flags.StringVar(&TestContext.MasterOSDistro, "master-os-distro", "debian", "The OS distribution of cluster master (debian, ubuntu, gci, coreos, or custom).")
|
flags.StringVar(&TestContext.MasterOSDistro, "master-os-distro", "debian", "The OS distribution of cluster master (debian, ubuntu, gci, coreos, or custom).")
|
||||||
flags.StringVar(&TestContext.NodeOSDistro, "node-os-distro", "debian", "The OS distribution of cluster VM instances (debian, ubuntu, gci, coreos, or custom).")
|
flags.StringVar(&TestContext.NodeOSDistro, "node-os-distro", "debian", "The OS distribution of cluster VM instances (debian, ubuntu, gci, coreos, or custom).")
|
||||||
|
flags.StringVar(&TestContext.NodeOSArch, "node-os-arch", "amd64", "The OS architecture of cluster VM instances (amd64, arm64, or custom).")
|
||||||
flags.StringVar(&TestContext.ClusterDNSDomain, "dns-domain", "cluster.local", "The DNS Domain of the cluster.")
|
flags.StringVar(&TestContext.ClusterDNSDomain, "dns-domain", "cluster.local", "The DNS Domain of the cluster.")
|
||||||
|
|
||||||
// TODO: Flags per provider? Rename gce-project/gce-zone?
|
// TODO: Flags per provider? Rename gce-project/gce-zone?
|
||||||
|
@ -203,6 +203,16 @@ func NodeOSDistroIs(supportedNodeOsDistros ...string) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NodeOSArchIs returns true if the node OS arch is included in the supportedNodeOsArchs. Otherwise false.
|
||||||
|
func NodeOSArchIs(supportedNodeOsArchs ...string) bool {
|
||||||
|
for _, arch := range supportedNodeOsArchs {
|
||||||
|
if strings.EqualFold(arch, TestContext.NodeOSArch) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
// DeleteNamespaces deletes all namespaces that match the given delete and skip filters.
|
// DeleteNamespaces deletes all namespaces that match the given delete and skip filters.
|
||||||
// Filter is by simple strings.Contains; first skip filter, then delete filter.
|
// Filter is by simple strings.Contains; first skip filter, then delete filter.
|
||||||
// Returns the list of deleted namespaces or an error.
|
// Returns the list of deleted namespaces or an error.
|
||||||
|
@ -39,6 +39,7 @@ go_library(
|
|||||||
"//test/e2e/framework/node:go_default_library",
|
"//test/e2e/framework/node:go_default_library",
|
||||||
"//test/e2e/framework/pod:go_default_library",
|
"//test/e2e/framework/pod:go_default_library",
|
||||||
"//test/e2e/framework/service:go_default_library",
|
"//test/e2e/framework/service:go_default_library",
|
||||||
|
"//test/e2e/framework/skipper:go_default_library",
|
||||||
"//test/e2e/framework/testfiles:go_default_library",
|
"//test/e2e/framework/testfiles:go_default_library",
|
||||||
"//test/e2e/framework/websocket:go_default_library",
|
"//test/e2e/framework/websocket:go_default_library",
|
||||||
"//test/e2e/scheduling:go_default_library",
|
"//test/e2e/scheduling:go_default_library",
|
||||||
|
@ -69,6 +69,7 @@ import (
|
|||||||
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
e2eservice "k8s.io/kubernetes/test/e2e/framework/service"
|
e2eservice "k8s.io/kubernetes/test/e2e/framework/service"
|
||||||
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
e2etestfiles "k8s.io/kubernetes/test/e2e/framework/testfiles"
|
e2etestfiles "k8s.io/kubernetes/test/e2e/framework/testfiles"
|
||||||
"k8s.io/kubernetes/test/e2e/scheduling"
|
"k8s.io/kubernetes/test/e2e/scheduling"
|
||||||
testutils "k8s.io/kubernetes/test/utils"
|
testutils "k8s.io/kubernetes/test/utils"
|
||||||
@ -646,6 +647,10 @@ var _ = SIGDescribe("Kubectl client", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should handle in-cluster config", func() {
|
ginkgo.It("should handle in-cluster config", func() {
|
||||||
|
// TODO: Find a way to download and copy the appropriate kubectl binary, or maybe a multi-arch kubectl image
|
||||||
|
// for now this only works on amd64
|
||||||
|
e2eskipper.SkipUnlessNodeOSArchIs("amd64")
|
||||||
|
|
||||||
ginkgo.By("adding rbac permissions")
|
ginkgo.By("adding rbac permissions")
|
||||||
// grant the view permission widely to allow inspection of the `invalid` namespace and the default namespace
|
// grant the view permission widely to allow inspection of the `invalid` namespace and the default namespace
|
||||||
err := e2eauth.BindClusterRole(f.ClientSet.RbacV1(), "view", f.Namespace.Name,
|
err := e2eauth.BindClusterRole(f.ClientSet.RbacV1(), "view", f.Namespace.Name,
|
||||||
|
Loading…
Reference in New Issue
Block a user