-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support disable profile bundle based on Arch #504
Support disable profile bundle based on Arch #504
Conversation
cmd/manager/operator.go
Outdated
arch := goruntime.GOARCH | ||
archProducts, hasArch := disableProductPerArch[arch] | ||
// build a map of disabled products for this arch | ||
disabledProducts := make(map[string]bool) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of building a separate map, I wonder if we can reuse the getValidPlatform
function by implementing the goruntime.GOARCH
check there. Maybe something like:
func getValidPlatform(p string) PlatformType {
arch := goruntime.GOARCH
switch {
case strings.EqualFold(p, string(PlatformOpenShift)) && (arch == "ppc64le") :
return PlatformOpenShiftOnPower
case strings.EqualFold(p, string(PlatformOpenShift)) && (arch == "s390x") :
return PlatformOpenShiftOnZ
case strings.EqualFold(p, string(PlatformOpenShift)):
return PlatformOpenShift
case strings.EqualFold(p, string(PlatformEKS)):
return PlatformEKS
case strings.EqualFold(p, string(PlatformHyperShift)):
return PlatformHyperShift
case strings.EqualFold(p, string(PlatformGeneric)):
return PlatformGeneric
default:
return PlatformUnknown
}
}
Then we'd have somthing like:
defaultProductsPerPlatform = map[PlatformType][]string{
PlatformOpenShift: {
"rhcos4",
"ocp4",
},
PlatformOpenShiftOnPower: {
"ocp4",
},
PlatformOpenShiftOnZ: {
"ocp4",
},
Then we continue to have a single mapping for default product support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking of having disableProductPerArch
to work as a filter, will we have other platforms supported on P/Z in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I also appreciate about the Lance's suggestion is the increased flexibility.
It also allows us to add/enable arch specific products, not only remove/disable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that makes sense, just updated it
Add support to disable profilebundle creation based on architecture. Disable rhcos4 on ppc64le and s390x
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhmdnd, Vincent056 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:
Approvers can indicate their approval by writing |
3caabdd
into
ComplianceAsCode:master
Add support to disable profilebundle creation based on architecture. Disable rhcos4 on ppc64le and s390x