Skip to content

Commit

Permalink
Support disable profile bundle based on Arch
Browse files Browse the repository at this point in the history
Add support to disable profilebundle creation based on architecture. Disable rhcos4 on ppc64le and s390x
  • Loading branch information
Vincent056 committed Apr 16, 2024
1 parent 5b4e351 commit 2a17ed8
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 2a17ed8

Please sign in to comment.