Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions controllers/operandrequest/operandrequest_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Re
if reflect.DeepEqual(existingInstance.Status, requestInstance.Status) {
return
}

// Update requestInstance's resource version to avoid conflicts
requestInstance.ResourceVersion = existingInstance.ResourceVersion
if err := r.Client.Status().Patch(ctx, requestInstance, client.MergeFrom(existingInstance)); err != nil && !apierrors.IsNotFound(err) {
reconcileErr = utilerrors.NewAggregate([]error{reconcileErr, fmt.Errorf("error while patching OperandRequest.Status: %v", err)})
}
Expand Down
4 changes: 2 additions & 2 deletions controllers/operandrequest/reconcile_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ func (r *Reconciler) generateClusterObjects(o *operatorv1alpha1.Operator, regist
// Subscription Object
sub := &olmv1alpha1.Subscription{
ObjectMeta: metav1.ObjectMeta{
Name: o.Name,
Name: o.PackageName,
Namespace: namespace,
Labels: labels,
Annotations: annotations,
Expand All @@ -683,7 +683,7 @@ func (r *Reconciler) generateClusterObjects(o *operatorv1alpha1.Operator, regist
},
}
sub.SetGroupVersionKind(schema.GroupVersionKind{Group: olmv1alpha1.SchemeGroupVersion.Group, Kind: "Subscription", Version: olmv1alpha1.SchemeGroupVersion.Version})
klog.V(3).Info("Generating Subscription: ", o.Name, " in the Namespace: ", namespace)
klog.V(3).Info("Generating Subscription: ", o.PackageName, " in the Namespace: ", namespace)
co.subscription = sub
return co
}
Expand Down