Skip to content

Commit

Permalink
Changed override of all spec to just be spec.ports
Browse files Browse the repository at this point in the history
  • Loading branch information
missylbytes committed Feb 12, 2024
1 parent b3f0bc5 commit 1c2e6fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions control-plane/api-gateway/gatekeeper/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ func (g *Gatekeeper) service(gateway gwv1beta1.Gateway, gcc v1alpha1.GatewayClas
// Kubernetes adds this configuration back in.
func mergeService(existing, desired *corev1.Service) {

existing.Spec = desired.Spec

// Only overwrite fields if the Service doesn't exist yet
if existing.ObjectMeta.CreationTimestamp.IsZero() {
existing.ObjectMeta.OwnerReferences = desired.ObjectMeta.OwnerReferences
Expand All @@ -125,6 +123,8 @@ func mergeService(existing, desired *corev1.Service) {
return
}

existing.Spec.Ports = desired.Spec.Ports

// If the Service already exists, add any desired annotations + labels to existing set
for k, v := range desired.ObjectMeta.Annotations {
existing.ObjectMeta.Annotations[k] = v
Expand Down

0 comments on commit 1c2e6fa

Please sign in to comment.