-
Notifications
You must be signed in to change notification settings - Fork 1
ROX-35435: Support differing versions of Central and SecuredCluster #246
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
base: main
Are you sure you want to change the base?
Changes from all commits
85ebd0d
05bd699
c89ec22
ca14c02
d63b2af
e96547a
1e43049
3fd9d1e
8b86e83
23f70af
9169418
80adfab
c765e2a
a7a6b9e
570f0e2
114c96f
d1c85ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,30 +7,51 @@ import ( | |
| ) | ||
|
|
||
| func imagesForConfig(config Config) []string { | ||
| images := make([]string, 0) | ||
| var images []string | ||
| prefix := "" | ||
| if config.Roxie.KonfluxImagesEnabled() { | ||
| prefix = "release-" | ||
| } | ||
|
|
||
| imageRegistry := constants.DefaultRegistry | ||
| images = append(images, fmt.Sprintf("%s/%s%s:%s", imageRegistry, prefix, "main", config.Roxie.Version)) | ||
| images = append(images, fmt.Sprintf("%s/%s%s:%s", imageRegistry, prefix, "central-db", config.Roxie.Version)) | ||
| images = append(images, fmt.Sprintf("%s/%s%s:%s", imageRegistry, prefix, "scanner-v4-db", config.Roxie.Version)) | ||
| images = append(images, fmt.Sprintf("%s/%s%s:%s", imageRegistry, prefix, "scanner-v4", config.Roxie.Version)) | ||
|
|
||
| for _, mainTag := range uniqueMainVersions(config) { | ||
| images = append(images, | ||
| fmt.Sprintf("%s/%s%s:%s", imageRegistry, prefix, "main", mainTag), | ||
| fmt.Sprintf("%s/%s%s:%s", imageRegistry, prefix, "central-db", mainTag), | ||
| fmt.Sprintf("%s/%s%s:%s", imageRegistry, prefix, "scanner-v4-db", mainTag), | ||
| fmt.Sprintf("%s/%s%s:%s", imageRegistry, prefix, "scanner-v4", mainTag), | ||
| ) | ||
| } | ||
|
|
||
| operatorPrefix := prefix | ||
| if !config.Roxie.KonfluxImagesEnabled() { | ||
| prefix = "stackrox-" | ||
| operatorPrefix = "stackrox-" | ||
| } | ||
| for _, instance := range config.OperatorInstances() { | ||
| images = append(images, | ||
| fmt.Sprintf("%s/%s%s:%s", imageRegistry, operatorPrefix, "operator", instance.Version), | ||
| OperatorBundleImage(instance.Version, config.Roxie.KonfluxImagesEnabled()), | ||
| ) | ||
| } | ||
| images = append(images, fmt.Sprintf("%s/%s%s:%s", imageRegistry, prefix, "operator", config.Operator.Version)) | ||
| images = append(images, OperatorBundleImage(config)) | ||
|
|
||
| return images | ||
| } | ||
|
|
||
| func OperatorBundleImage(config Config) string { | ||
| func uniqueMainVersions(config Config) []string { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My feeling is that this can be simplified.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done in 9169418 |
||
| central := config.CentralVersion() | ||
| sc := config.SecuredClusterVersion() | ||
| if central == sc { | ||
| return []string{central} | ||
| } | ||
| return []string{central, sc} | ||
| } | ||
|
|
||
| // OperatorBundleImage returns the operator bundle image for a specific operator version. | ||
| func OperatorBundleImage(operatorVersion string, konflux bool) string { | ||
| imageRegistry := constants.DefaultRegistry | ||
| if config.Roxie.KonfluxImagesEnabled() { | ||
| return fmt.Sprintf("%s/release-operator-bundle:v%s", imageRegistry, config.Operator.Version) | ||
| if konflux { | ||
| return fmt.Sprintf("%s/release-operator-bundle:v%s", imageRegistry, operatorVersion) | ||
| } | ||
| return fmt.Sprintf("%s/stackrox-operator-bundle:v%s", imageRegistry, config.Operator.Version) | ||
| return fmt.Sprintf("%s/stackrox-operator-bundle:v%s", imageRegistry, operatorVersion) | ||
| } | ||
|
mclasmeier marked this conversation as resolved.
|
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 need to think a bit about this PR from a conceptual viewpoint. But, looking at the concrete changes, I can already provide limited feedback.
For example, I don't think we need these flags. Direct CLI flags (IMHO) are remnants from the time before we had the unified roxie config. Everything can be set there and these settings specifically are not settings that we need every day (outside of automation), hence I think it's perfectly fine to drop these and let users configure those in the roxie config if they need to.
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.
As a roxie user I'd actually like to have them.
To give you an example, for cert refresh and CA rotation I had to do a lot of mixed version testing. It was quite tedious to do and because of that I didn't do as much compatibility testing as I should have. And these flags would make it quite easy to be able to switch around versions easily.
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.
If they are important for you, fine.
But you do know that you can do the same with
--set, right?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.
Oh, didn't think about that. Then I'm inclined to agree with you.
Having a flag is still somewhat useful because it makes the feature more easily discoverable, that's the only argument I have for it now.