Skip to content

Commit

Permalink
Merge pull request #504 from Vincent056/s390x_off
Browse files Browse the repository at this point in the history
Support disable profile bundle based on Arch
  • Loading branch information
openshift-merge-bot[bot] authored Apr 17, 2024
2 parents 27b813a + 2a17ed8 commit 3caabdd
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions cmd/manager/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,13 @@ func init() {
type PlatformType string

const (
PlatformOpenShift PlatformType = "OpenShift"
PlatformEKS PlatformType = "EKS"
PlatformGeneric PlatformType = "Generic"
PlatformHyperShift PlatformType = "HyperShift"
PlatformUnknown PlatformType = "Unknown"
PlatformOpenShift PlatformType = "OpenShift"
PlatformEKS PlatformType = "EKS"
PlatformGeneric PlatformType = "Generic"
PlatformHyperShift PlatformType = "HyperShift"
PlatformOpenShiftOnPower PlatformType = "OpenShiftOnPower"
PlatformOpenShiftOnZ PlatformType = "OpenShiftOnZ"
PlatformUnknown PlatformType = "Unknown"
)

// Change below variables to serve metrics on different host or port.
Expand All @@ -98,6 +100,8 @@ var (
"rhcos4",
"ocp4",
},
PlatformOpenShiftOnPower: {"ocp4"},
PlatformOpenShiftOnZ: {"ocp4"},
PlatformEKS: {
"eks",
},
Expand All @@ -106,6 +110,7 @@ var (
"ocp4",
},
}

defaultRolesPerPlatform = map[PlatformType][]string{
PlatformOpenShift: {
"master",
Expand Down Expand Up @@ -341,9 +346,17 @@ func RunOperator(cmd *cobra.Command, args []string) {
}

func getValidPlatform(p string) PlatformType {
arch := goruntime.GOARCH
switch {
case strings.EqualFold(p, string(PlatformOpenShift)):
return PlatformOpenShift
switch {
case strings.EqualFold(arch, "ppc64le"):
return PlatformOpenShiftOnPower
case strings.EqualFold(arch, "s390x"):
return PlatformOpenShiftOnZ
default:
return PlatformOpenShift
}
case strings.EqualFold(p, string(PlatformEKS)):
return PlatformEKS
case strings.EqualFold(p, string(PlatformHyperShift)):
Expand Down

0 comments on commit 3caabdd

Please sign in to comment.