-
Notifications
You must be signed in to change notification settings - Fork 216
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
MGMT-18561: MGMT-18562: Add kube api support for adding per cluster mirror registry in AgentClusterInstall #6965
base: master
Are you sure you want to change the base?
Conversation
@eliorerz: This pull request references MGMT-18561 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.18.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
@eliorerz: GitHub didn't allow me to request PR reviews from the following users: eliorerz. Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: eliorerz 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 |
/retest |
67b98f8
to
fd90bbd
Compare
/cc @carbonin @CrystalChun |
Retested and verified it's pulling from the mirror registry 👍
|
a1af42c
to
8ec7bc2
Compare
/retest |
1 similar comment
/retest |
8ec7bc2
to
cc43d9f
Compare
cc43d9f
to
eddba1a
Compare
…cluster mirror registry # Conflicts: # internal/controller/controllers/clusterdeployments_controller_test.go
…MirrorRegistryConfig
…rorRegistryConfig
eddba1a
to
98c1f6e
Compare
98c1f6e
to
b97b322
Compare
b97b322
to
015f338
Compare
@eliorerz: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
@@ -16,3 +18,12 @@ type ValidationsStatus map[string]ValidationResults | |||
|
|||
// +kubebuilder:object:generate=true | |||
type ValidationResults []ValidationResult | |||
|
|||
// MirrorRegistryConfiguration holds the given mirror registry configuration | |||
type MirrorRegistryConfiguration struct { |
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 still think this doesn't belong in the api module.
It's not a user-facing API. Let's put it in internal/common/db.go
with the functions that manage it's representation in the db.
@@ -0,0 +1,102 @@ | |||
package mirror_registry |
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 generally the convention is to avoid underscores in package names. I think this one would be fine without it.
@@ -548,7 +548,7 @@ func (r *PreprovisioningImageReconciler) AddIronicAgentToInfraEnv(ctx context.Co | |||
|
|||
updated := false | |||
if string(conf) != infraEnvInternal.InternalIgnitionConfigOverride { | |||
_, err = r.Installer.UpdateInfraEnvInternal(ctx, installer.UpdateInfraEnvParams{InfraEnvID: *infraEnvInternal.ID, InfraEnvUpdateParams: &models.InfraEnvUpdateParams{}}, swag.String(string(conf))) | |||
_, err = r.Installer.UpdateInfraEnvInternal(ctx, installer.UpdateInfraEnvParams{InfraEnvID: *infraEnvInternal.ID, InfraEnvUpdateParams: &models.InfraEnvUpdateParams{}}, swag.String(string(conf)), nil) |
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.
Won't this unset the mirror registries?
clusterPkg "github.com/openshift/assisted-service/internal/cluster" | ||
"github.com/openshift/assisted-service/internal/common" | ||
"github.com/openshift/assisted-service/internal/constants" | ||
"github.com/openshift/assisted-service/internal/controller/controllers/mirror_registry" |
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.
Can we use an alias for these to differentiate between pkg/mirrorregistries
and controllers/mirror_registry
(or whatever it ends up being called)
mirrorRegistriesConfigKey := "MirrorRegistriesConfig" | ||
mirrorRegistriesCAConfigKey := "MirrorRegistriesCAConfig" |
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.
Should these be constants?
(ignitionParams)[mirrorRegistriesConfigKey] = base64.StdEncoding.EncodeToString([]byte(configuration.RegistriesConf)) | ||
(ignitionParams)[mirrorRegistriesCAConfigKey] = base64.StdEncoding.EncodeToString([]byte(configuration.CaBundleCrt)) |
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.
Why parens here?
mirrorRegistriesConfigKey := "MirrorRegistriesConfig" | ||
mirrorRegistriesCAConfigKey := "MirrorRegistriesCAConfig" | ||
|
||
if mirror_registry.IsMirrorConfigurationSet(configuration) { |
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.
Maybe a comment here that this is the config from the infraenv, vs the following one which is defined in the environment.
(ignitionParams)[mirrorRegistriesConfigKey] = base64.StdEncoding.EncodeToString(registriesContents) | ||
(ignitionParams)[mirrorRegistriesCAConfigKey] = base64.StdEncoding.EncodeToString(caContents) |
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.
Same here, not sure why this needs parens
func (i *installConfigBuilder) setImageDigestMirrorSet(cfg *installcfg.InstallerConfigBaremetal, configuration *common_api.MirrorRegistryConfiguration) error { | ||
var imageDigestSourceList []installcfg.ImageDigestSource | ||
|
||
if mirror_registry.IsMirrorConfigurationSet(configuration) { |
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.
Same in here, can we have a comment in these functions saying which block is the cluster config and which is the environmental one?
} | ||
registriesConfList[i] = RegistriesConf{Location: location, Mirror: mirrors} | ||
for _, i := range idmsMirrors { | ||
mirrors := *(*[]string)(unsafe.Pointer(&i.Mirrors)) |
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 is going on here? Feels like this shouldn't be necessary. If it is please add a comment of some sort.
List all the issues related to this PR
What environments does this code impact?
How was this code tested?
/cc @eliorerz