Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1912,9 +1912,11 @@ func (r *HostedControlPlaneReconciler) reconcileOperatorLifecycleManager(ctx con

// Collect Profiles
collectProfilesConfigMap := manifests.CollectProfilesConfigMap(hcp.Namespace)
olm.ReconcileCollectProfilesConfigMap(collectProfilesConfigMap, p.OwnerRef)
if err := r.Create(ctx, collectProfilesConfigMap); err != nil && !apierrors.IsAlreadyExists(err) {
return fmt.Errorf("failed to reconcile collect profiles cronjob: %w", err)
if _, err := r.CreateOrUpdate(ctx, r, collectProfilesConfigMap, func() error {
olm.ReconcileCollectProfilesConfigMap(collectProfilesConfigMap, p.OwnerRef)
return nil
}); err != nil {
return fmt.Errorf("failed to reconcile collect profiles config map: %w", err)
}

collectProfilesCronJob := manifests.CollectProfilesCronJob(hcp.Namespace)
Expand All @@ -1930,29 +1932,31 @@ func (r *HostedControlPlaneReconciler) reconcileOperatorLifecycleManager(ctx con
olm.ReconcileCollectProfilesRole(collectProfilesRole, p.OwnerRef)
return nil
}); err != nil {
return fmt.Errorf("failed to reconcile collect profiles cronjob: %w", err)
return fmt.Errorf("failed to reconcile collect profiles role: %w", err)
}

collectProfilesRoleBinding := manifests.CollectProfilesRoleBinding(hcp.Namespace)
if _, err := r.CreateOrUpdate(ctx, r, collectProfilesRoleBinding, func() error {
olm.ReconcileCollectProfilesRoleBinding(collectProfilesRoleBinding, p.OwnerRef)
return nil
}); err != nil {
return fmt.Errorf("failed to reconcile collect profiles cronjob: %w", err)
return fmt.Errorf("failed to reconcile collect profiles rolebinding: %w", err)
}

collectProfilesSecret := manifests.CollectProfilesSecret(hcp.Namespace)
olm.ReconcileCollectProfilesSecret(collectProfilesSecret, p.OwnerRef)
if err := r.Create(ctx, collectProfilesSecret); err != nil && !apierrors.IsAlreadyExists(err) {
return fmt.Errorf("failed to reconcile collect profiles cronjob: %w", err)
if _, err := r.CreateOrUpdate(ctx, r, collectProfilesSecret, func() error {
olm.ReconcileCollectProfilesSecret(collectProfilesSecret, p.OwnerRef)
return nil
}); err != nil {
return fmt.Errorf("failed to reconcile collect profiles secret: %w", err)
}

collectProfilesServiceAccount := manifests.CollectProfilesServiceAccount(hcp.Namespace)
if _, err := r.CreateOrUpdate(ctx, r, collectProfilesServiceAccount, func() error {
olm.ReconcileCollectProfilesServiceAccount(collectProfilesServiceAccount, p.OwnerRef)
return nil
}); err != nil {
return fmt.Errorf("failed to reconcile collect profiles cronjob: %w", err)
return fmt.Errorf("failed to reconcile collect profiles serviceaccount: %w", err)
}
return nil
}
Expand Down