Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
alter check for im operator status
Signed-off-by: Ben Luzarraga <[email protected]>
  • Loading branch information
bluzarraga committed Apr 12, 2023
commit 957f9b1637655507cb5756f614cbf333e5ff1f52
4 changes: 4 additions & 0 deletions api/v1alpha1/operandrequest_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,10 @@ func foundOperand(requests []Request, name string) bool {
return false
}

func (r *OperandRequest) operandRequested(name string) bool {
return foundOperand(r.Spec.Requests, name)
}

func getMemberStatus(status *OperandRequestStatus, name string) (int, *MemberStatus) {
for i, m := range status.Members {
if name == m.Name {
Expand Down
31 changes: 17 additions & 14 deletions controllers/operandrequest/operandrequest_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,24 +158,27 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Re
klog.Info("Waiting for status.services to be instantiated ...")
return ctrl.Result{RequeueAfter: constant.DefaultRequeueDuration}, nil
} else {
var imIndex int
found := false
for i, s := range requestInstance.Status.Services {
if "ibm-im-operator" == s.OperatorName {
found = true
imIndex = i
break
if requestInstance.operandRequested("ibm-im-operator") {
var imIndex int
found := false
for i, s := range requestInstance.Status.Services {
if "ibm-im-operator" == s.OperatorName {
found = true
imIndex = i
break
}
}
}
if found == true {
if requestInstance.Status.Services[imIndex].Status != "Ready" {
klog.Info("Waiting for IM service to be Ready ...")
if found == true {
if requestInstance.Status.Services[imIndex].Status != "Ready" {
klog.Info("Waiting for IM service to be Ready ...")
return ctrl.Result{RequeueAfter: constant.DefaultRequeueDuration}, nil
}
} else {
klog.Info("Waiting for IM service status ...")
return ctrl.Result{RequeueAfter: constant.DefaultRequeueDuration}, nil
}
} else {
klog.Info("Waiting for IM service status ...")
return ctrl.Result{RequeueAfter: constant.DefaultRequeueDuration}, nil
}

}

klog.V(1).Infof("Finished reconciling OperandRequest: %s", req.NamespacedName)
Expand Down