Skip to content

Commit

Permalink
feat: update Service creation to use PublishNotReadyAddress in favor …
Browse files Browse the repository at this point in the history
…of the old and deprecated 'tolerate-unready-endpoints' annotation
  • Loading branch information
L30Bola committed Sep 5, 2022
1 parent 0dd2622 commit e2bb609
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions pkg/util/k8sutil/k8sutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"net"
"net/url"
"os"
"strconv"
"strings"
"time"

Expand Down Expand Up @@ -75,8 +74,6 @@ const (
defaultDNSTimeout = int64(0)
)

const TolerateUnreadyEndpointsAnnotation = "service.alpha.kubernetes.io/tolerate-unready-endpoints"

func GetEtcdVersion(pod *v1.Pod) string {
return pod.Annotations[etcdVersionAnnotationKey]
}
Expand Down Expand Up @@ -270,14 +267,11 @@ func newEtcdServiceManifest(svcName, clusterName string, ports []v1.ServicePort,
ObjectMeta: metav1.ObjectMeta{
Name: svcName,
Labels: labels,
Annotations: map[string]string{
TolerateUnreadyEndpointsAnnotation: strconv.FormatBool(publishNotReadyAddresses),
},
},
Spec: v1.ServiceSpec{
Ports: ports,
Selector: labels,
// PublishNotReadyAddresses: publishNotReadyAddresses, // TODO(ckoehn): Activate once TolerateUnreadyEndpointsAnnotation is deprecated.
Ports: ports,
Selector: labels,
PublishNotReadyAddresses: publishNotReadyAddresses,
},
}
return svc
Expand Down

0 comments on commit e2bb609

Please sign in to comment.