Skip to content

Commit 33ac3c3

Browse files
author
Ciprian Hacman
committed
Add new flags for node arch
1 parent 19f0a54 commit 33ac3c3

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

test/e2e/framework/skipper/skipper.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,13 @@ func SkipUnlessNodeOSDistroIs(supportedNodeOsDistros ...string) {
213213
}
214214
}
215215

216+
// SkipUnlessNodeOSArchIs skips if the node OS distro is not included in the supportedNodeOsArchs.
217+
func SkipUnlessNodeOSArchIs(supportedNodeOsArchs ...string) {
218+
if !framework.NodeOSArchIs(supportedNodeOsArchs...) {
219+
skipInternalf(1, "Only supported for node OS arch %v (not %s)", supportedNodeOsArchs, framework.TestContext.NodeOSArch)
220+
}
221+
}
222+
216223
// SkipIfNodeOSDistroIs skips if the node OS distro is included in the unsupportedNodeOsDistros.
217224
func SkipIfNodeOSDistroIs(unsupportedNodeOsDistros ...string) {
218225
if framework.NodeOSDistroIs(unsupportedNodeOsDistros...) {

test/e2e/framework/test_context.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ type TestContextType struct {
116116
ImageServiceEndpoint string
117117
MasterOSDistro string
118118
NodeOSDistro string
119+
NodeOSArch string
119120
VerifyServiceAccount bool
120121
DeleteNamespace bool
121122
DeleteNamespaceOnFailure bool
@@ -324,6 +325,7 @@ func RegisterClusterFlags(flags *flag.FlagSet) {
324325
flags.StringVar(&TestContext.Prefix, "prefix", "e2e", "A prefix to be added to cloud resources created during testing.")
325326
flags.StringVar(&TestContext.MasterOSDistro, "master-os-distro", "debian", "The OS distribution of cluster master (debian, ubuntu, gci, coreos, or custom).")
326327
flags.StringVar(&TestContext.NodeOSDistro, "node-os-distro", "debian", "The OS distribution of cluster VM instances (debian, ubuntu, gci, coreos, or custom).")
328+
flags.StringVar(&TestContext.NodeOSArch, "node-os-arch", "amd64", "The OS architecture of cluster VM instances (amd64, arm64, or custom).")
327329
flags.StringVar(&TestContext.ClusterDNSDomain, "dns-domain", "cluster.local", "The DNS Domain of the cluster.")
328330

329331
// TODO: Flags per provider? Rename gce-project/gce-zone?

test/e2e/framework/util.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,16 @@ func NodeOSDistroIs(supportedNodeOsDistros ...string) bool {
203203
return false
204204
}
205205

206+
// NodeOSArchIs returns true if the node OS arch is included in the supportedNodeOsArchs. Otherwise false.
207+
func NodeOSArchIs(supportedNodeOsArchs ...string) bool {
208+
for _, arch := range supportedNodeOsArchs {
209+
if strings.EqualFold(arch, TestContext.NodeOSArch) {
210+
return true
211+
}
212+
}
213+
return false
214+
}
215+
206216
// DeleteNamespaces deletes all namespaces that match the given delete and skip filters.
207217
// Filter is by simple strings.Contains; first skip filter, then delete filter.
208218
// Returns the list of deleted namespaces or an error.

test/e2e/kubectl/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ go_library(
3939
"//test/e2e/framework/node:go_default_library",
4040
"//test/e2e/framework/pod:go_default_library",
4141
"//test/e2e/framework/service:go_default_library",
42+
"//test/e2e/framework/skipper:go_default_library",
4243
"//test/e2e/framework/testfiles:go_default_library",
4344
"//test/e2e/framework/websocket:go_default_library",
4445
"//test/e2e/scheduling:go_default_library",

0 commit comments

Comments
 (0)