Skip to content

Commit

Permalink
fix: don't mark all previou zoneinsight subs disconnected
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Beaumont <[email protected]>
  • Loading branch information
michaelbeaumont committed Oct 27, 2023
1 parent cf9173c commit ec44c13
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions api/system/v1alpha1/zone_insight_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
timestamppb "google.golang.org/protobuf/types/known/timestamppb"

"github.com/kumahq/kuma/api/generic"
util_proto "github.com/kumahq/kuma/pkg/util/proto"
)

var _ generic.Insight = &ZoneInsight{}
Expand Down Expand Up @@ -78,7 +77,6 @@ func (x *ZoneInsight) UpdateSubscription(s generic.Subscription) error {
return nil
}
}
x.finalizeSubscriptions()
x.Subscriptions = append(x.Subscriptions, kdsSubscription)
return nil
}
Expand All @@ -94,18 +92,6 @@ func (x *ZoneInsight) CompactFinished() {
}
}

// If Global CP was killed ungracefully then we can get a subscription without a DisconnectTime.
// Because of the way we process subscriptions the lack of DisconnectTime on old subscription
// will cause wrong status.
func (x *ZoneInsight) finalizeSubscriptions() {
now := util_proto.Now()
for _, subscription := range x.GetSubscriptions() {
if subscription.DisconnectTime == nil {
subscription.DisconnectTime = now
}
}
}

func NewVersion() *Version {
return &Version{
KumaCp: &KumaCpVersion{
Expand Down

0 comments on commit ec44c13

Please sign in to comment.