File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -68,12 +68,12 @@ func (r *MachinePoolReconciler) reconcilePhase(mp *expv1.MachinePool) {
68
68
}
69
69
70
70
// Set the phase to "running" if the number of ready replicas is equal to desired replicas.
71
- if mp .Status .InfrastructureReady && * mp .Spec .Replicas == mp .Status .ReadyReplicas {
71
+ if mp .Status .InfrastructureReady && mp . Spec . Replicas != nil && * mp .Spec .Replicas == mp .Status .ReadyReplicas {
72
72
mp .Status .SetTypedPhase (expv1 .MachinePoolPhaseRunning )
73
73
}
74
74
75
75
// Set the appropriate phase in response to the MachinePool replica count being greater than the observed infrastructure replicas.
76
- if mp .Status .InfrastructureReady && * mp .Spec .Replicas > mp .Status .ReadyReplicas {
76
+ if mp .Status .InfrastructureReady && mp . Spec . Replicas != nil && * mp .Spec .Replicas > mp .Status .ReadyReplicas {
77
77
// If we are being managed by an external autoscaler and can't predict scaling direction, set to "Scaling".
78
78
if annotations .ReplicasManagedByExternalAutoscaler (mp ) {
79
79
mp .Status .SetTypedPhase (expv1 .MachinePoolPhaseScaling )
@@ -84,7 +84,7 @@ func (r *MachinePoolReconciler) reconcilePhase(mp *expv1.MachinePool) {
84
84
}
85
85
86
86
// Set the appropriate phase in response to the MachinePool replica count being less than the observed infrastructure replicas.
87
- if mp .Status .InfrastructureReady && * mp .Spec .Replicas < mp .Status .ReadyReplicas {
87
+ if mp .Status .InfrastructureReady && mp . Spec . Replicas != nil && * mp .Spec .Replicas < mp .Status .ReadyReplicas {
88
88
// If we are being managed by an external autoscaler and can't predict scaling direction, set to "Scaling".
89
89
if annotations .ReplicasManagedByExternalAutoscaler (mp ) {
90
90
mp .Status .SetTypedPhase (expv1 .MachinePoolPhaseScaling )
You can’t perform that action at this time.
0 commit comments