Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
p0lyn0mial committed Jan 24, 2020
1 parent 4b544c0 commit 69c961d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/operator2/workload/workload_controller.go
Expand Up @@ -175,9 +175,6 @@ func (c *Controller) shouldSync(operatorSpec *operatorv1.OperatorSpec) (bool, er
// preconditionFulfilled checks if kube-apiserver is present and available
func (c *Controller) preconditionFulfilled(operatorSpec *operatorv1.OperatorSpec) (bool, error) {
kubeAPIServerClusterOperator, err := c.openshiftClusterConfigClient.Get("kube-apiserver", metav1.GetOptions{})
if apierrors.IsNotFound(err) {
kubeAPIServerClusterOperator, err = c.openshiftClusterConfigClient.Get("openshift-kube-apiserver-operator", metav1.GetOptions{})
}
if apierrors.IsNotFound(err) {
message := "clusteroperator/kube-apiserver not found"
c.eventRecorder.Warning("PrereqNotReady", message)
Expand Down Expand Up @@ -247,6 +244,13 @@ func (c *Controller) updateOperatorStatus(workload *appsv1.DaemonSet, errs []err
dsDegradedCondition.Reason = "NoDaemon"
dsDegradedCondition.Message = message

if _, _, updateError := v1helpers.UpdateStatus(c.operatorClient,
v1helpers.UpdateConditionFn(dsAvailableCondition),
v1helpers.UpdateConditionFn(workloadDegradedCondition),
v1helpers.UpdateConditionFn(dsDegradedCondition),
v1helpers.UpdateConditionFn(dsProgressingCondition)); updateError != nil {
return updateError
}
return errors.NewAggregate(errs)
}

Expand Down

0 comments on commit 69c961d

Please sign in to comment.