Skip to content
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

NO-ISSUE: InfraEnv controller code cleanup #5690

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions internal/controller/controllers/infraenv_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ func (r *InfraEnvReconciler) ensureISO(ctx context.Context, log logrus.FieldLogg
infraEnvInternal, err := r.Installer.GetInfraEnvByKubeKey(key)
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
infraEnvInternal, err = r.createInfraEnv(ctx, log, &key, infraEnv, cluster, infraEnv.Spec.AdditionalTrustBundle)
infraEnvInternal, err = r.createInfraEnv(ctx, log, &key, infraEnv, cluster)
if err != nil {
log.Errorf("fail to create InfraEnv: %s, ", infraEnv.Name)
return r.handleEnsureISOErrors(ctx, log, infraEnv, err, nil)
Expand Down Expand Up @@ -458,7 +458,7 @@ func (r *InfraEnvReconciler) getOSImageVersion(log logrus.FieldLogger, infraEnv
}

func (r *InfraEnvReconciler) createInfraEnv(ctx context.Context, log logrus.FieldLogger, key *types.NamespacedName,
infraEnv *aiv1beta1.InfraEnv, cluster *common.Cluster, additionalTrustBundle string) (*common.InfraEnv, error) {
infraEnv *aiv1beta1.InfraEnv, cluster *common.Cluster) (*common.InfraEnv, error) {

osImageVersion, err := r.getOSImageVersion(log, infraEnv, cluster)
if err != nil {
Expand Down Expand Up @@ -598,7 +598,7 @@ func (r *InfraEnvReconciler) populateEventsURL(log logrus.FieldLogger, infraEnv
return nil
}

func (r *InfraEnvReconciler) setSignedBootArtifactURLs(infraEnv *aiv1beta1.InfraEnv, initrdURL, infraEnvID, version, arch string) error {
func (r *InfraEnvReconciler) setSignedBootArtifactURLs(infraEnv *aiv1beta1.InfraEnv, initrdURL, infraEnvID string) error {
signedInitrdURL, err := signURL(initrdURL, r.AuthType, infraEnvID, gencrypto.InfraEnvKey)
if err != nil {
return err
Expand Down Expand Up @@ -707,7 +707,7 @@ func (r *InfraEnvReconciler) updateInfraEnvStatus(
return r.handleEnsureISOErrors(ctx, log, infraEnv, err, internalInfraEnv)
}
if schemeUpdated || isoUpdated {
if err := r.setSignedBootArtifactURLs(infraEnv, bootArtifactURLs.InitrdURL, internalInfraEnv.ID.String(), *osImage.OpenshiftVersion, *osImage.CPUArchitecture); err != nil {
if err = r.setSignedBootArtifactURLs(infraEnv, bootArtifactURLs.InitrdURL, internalInfraEnv.ID.String()); err != nil {
return r.handleEnsureISOErrors(ctx, log, infraEnv, err, internalInfraEnv)
}
}
Expand Down