@@ -447,9 +447,8 @@ func (sc *StackContainer) updateFromResources() {
447447 hostnames := sc .stackHostnames (sc .ingressSpec , false )
448448 ingressUpdated = len (hostnames ) == 0
449449 }
450- if sc .Resources .IngressSegment != nil {
451- ingressSegmentUpdated = IsResourceUpToDate (sc .Stack , sc .Resources .IngressSegment .ObjectMeta )
452- }
450+ ingressSegmentUpdated = sc .Resources .IngressSegment != nil &&
451+ IsResourceUpToDate (sc .Stack , sc .Resources .IngressSegment .ObjectMeta )
453452 } else {
454453 // ignore if ingress is not set
455454 ingressUpdated = sc .Resources .Ingress == nil
@@ -466,22 +465,22 @@ func (sc *StackContainer) updateFromResources() {
466465 hostnames := sc .stackHostnames (sc .routeGroupSpec , false )
467466 routeGroupUpdated = len (hostnames ) == 0
468467 }
469-
470- if sc .Resources .RouteGroupSegment != nil {
471- routeGroupSegmentUpdated = IsResourceUpToDate (
468+ routeGroupSegmentUpdated = sc .Resources .RouteGroupSegment != nil &&
469+ IsResourceUpToDate (
472470 sc .Stack ,
473471 sc .Resources .RouteGroupSegment .ObjectMeta ,
474472 )
475- }
476473 } else {
477474 // ignore if route group is not set
478475 routeGroupUpdated = sc .Resources .RouteGroup == nil
479476 routeGroupSegmentUpdated = sc .Resources .RouteGroupSegment == nil
480477 }
481478
482- // hpa not used if we migrate cluster to reduce wasted resources
479+ // hpa
483480 if sc .IsAutoscaled () {
484481 hpaUpdated = sc .Resources .HPA != nil && IsResourceUpToDate (sc .Stack , sc .Resources .HPA .ObjectMeta )
482+ } else {
483+ hpaUpdated = sc .Resources .HPA == nil
485484 }
486485
487486 // aggregated 'resources updated' for the readiness
@@ -495,7 +494,6 @@ func (sc *StackContainer) updateFromResources() {
495494
496495 status := sc .Stack .Status
497496 sc .noTrafficSince = unwrapTime (status .NoTrafficSince )
498-
499497 if status .Prescaling .Active {
500498 sc .prescalingActive = true
501499 sc .prescalingReplicas = status .Prescaling .Replicas
0 commit comments