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
28 changes: 16 additions & 12 deletions controllers/operandrequest/reconcile_operand.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,21 +141,25 @@ func (r *Reconciler) reconcileOperand(ctx context.Context, requestInstance *oper
// Merge and Generate CR
if operand.Kind == "" {
configInstance, err := r.GetOperandConfig(ctx, registryKey)
if err != nil {
if err == nil {
// Check the requested Service Config if exist in specific OperandConfig
opdConfig := configInstance.GetService(operand.Name)
if opdConfig == nil {
klog.V(2).Infof("There is no service: %s from the OperandConfig instance: %s/%s, Skip creating CR for it", operand.Name, req.RegistryNamespace, req.Registry)
continue
}
err = r.reconcileCRwithConfig(ctx, opdConfig, opdRegistry.Namespace, csv)
if err != nil {
merr.Add(err)
requestInstance.SetMemberStatus(operand.Name, "", operatorv1alpha1.ServiceFailed, &r.Mutex)
}
} else if apierrors.IsNotFound(err) {
klog.Infof("Not Found OperandConfig: %s/%s", operand.Name, err)
} else if err != nil {
merr.Add(errors.Wrapf(err, "failed to get the OperandConfig %s", registryKey.String()))
continue
}
// Check the requested Service Config if exist in specific OperandConfig
opdConfig := configInstance.GetService(operand.Name)
if opdConfig == nil {
klog.V(2).Infof("There is no service: %s from the OperandConfig instance: %s/%s, Skip creating CR for it", operand.Name, req.RegistryNamespace, req.Registry)
continue
}
err = r.reconcileCRwithConfig(ctx, opdConfig, opdRegistry.Namespace, csv)
if err != nil {
merr.Add(err)
requestInstance.SetMemberStatus(operand.Name, "", operatorv1alpha1.ServiceFailed, &r.Mutex)
}

} else {
err = r.reconcileCRwithRequest(ctx, requestInstance, operand, types.NamespacedName{Name: requestInstance.Name, Namespace: requestInstance.Namespace}, i)
if err != nil {
Expand Down
6 changes: 5 additions & 1 deletion controllers/operandrequest/reconcile_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,11 @@ func (r *Reconciler) absentOperatorsAndOperands(ctx context.Context, requestInst
}
configInstance, err := r.GetOperandConfig(ctx, registryKey)
if err != nil {
return err
if apierrors.IsNotFound(err) {
configInstance = &operatorv1alpha1.OperandConfig{}
} else {
return err
}
}
merr := &util.MultiErr{}
remainingOp := needDeletedOperands.Clone()
Expand Down