Allow log check only for 1.7.0
As you may guess from title the operator tries to check
pod logs even for 1.5.0 cr version. It leads to errors since
the corresponding RBAC rule was introduced only for 1.7.0.
As a result cluster status is stucked in initializing state.
@@ -325,13 +325,12 @@ func (r *ReconcilePerconaXtraDBCluster) appStatus(app api.StatefulApp, podSpec *
if !isPXC(app) {
status.Ready++
} else {
- isPodWaitingForRecovery, _, err := r.isPodWaitingForRecovery(namespace, pod.Name)
+ isPodReady := true
+ if cr170OrGreater {
+ isPodReady, _, err := r.isPodWaitingForRecovery(namespace, pod.Name)
if err != nil {
return api.AppStatus{}, fmt.Errorf("parse %s pod logs: %v", pod.Name, err)
}
-
- isPodReady := !isPodWaitingForRecovery
- if cr170OrGreater {
isPodReady = isPodReady && pod.ObjectMeta.Labels["controller-revision-hash"] == sfs.Status.UpdateRevision
}
