Merge pull request #15474 from umohnani8/gen-kube

Remove duplicate annotations in generated service yaml
This commit is contained in:
Daniel J Walsh
2022-08-26 05:25:21 -04:00
committed by GitHub

View File

@ -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,