Skip to content

Commit

Permalink
Remove duplicate annotations in generated service yaml
Browse files Browse the repository at this point in the history
Don't add the same annotations as the pod yaml to the
service yaml as it is not needed.

[NO NEW TESTS NEEDED]

Signed-off-by: Urvashi Mohnani <[email protected]>
  • Loading branch information
umohnani8 authored and mheon committed Sep 6, 2022
1 parent 063f332 commit d4b62e3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libpod/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ func GenerateKubeServiceFromV1Pod(pod *v1.Pod, servicePorts []v1.ServicePort) (Y
}
service.Spec = serviceSpec
service.ObjectMeta = pod.ObjectMeta
// Reset the annotations for the service as the pod annotations are not needed for the service
service.ObjectMeta.Annotations = nil
tm := v12.TypeMeta{
Kind: "Service",
APIVersion: pod.TypeMeta.APIVersion,
Expand Down

0 comments on commit d4b62e3

Please sign in to comment.