From 52117954a83fd2f7deed26d029516fee6b27d077 Mon Sep 17 00:00:00 2001 From: Pavel Sviderski Date: Sat, 1 Mar 2025 22:31:18 +1000 Subject: [PATCH] fix: specs equals ignores replicas --- internal/api/service.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/api/service.go b/internal/api/service.go index 987b17bd..940612b0 100644 --- a/internal/api/service.go +++ b/internal/api/service.go @@ -44,8 +44,13 @@ func (s *ServiceSpec) Validate() error { return nil } +// Equals returns true if the service spec is equal to the given spec ignoring the number of replicas. func (s *ServiceSpec) Equals(spec ServiceSpec) bool { // TODO: ignore order of ports. + sCopy := *s + // Ignore the number of replicas when comparing. + sCopy.Replicas = 0 + spec.Replicas = 0 return reflect.DeepEqual(*s, spec) }