Skip to content

Commit 5b32efd

Browse files
author
speruri
committed
deprecate alb annotation and promote new one
1 parent d8b5cb4 commit 5b32efd

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

kubernetes/adapter.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,18 @@ func (a *Adapter) newIngress(typ IngressType, metadata kubeItemMetadata, host st
203203
}
204204

205205
ipAddressType := a.ingressIpAddressType
206-
if annotation := getAnnotationsString(annotations, ingressALBIPAddressType, ""); annotation == aws.IPAddressTypeDualstack {
207-
ipAddressType = aws.IPAddressTypeDualstack
208-
} else if annotation == aws.IPAddressTypeIPV4 {
209-
ipAddressType = aws.IPAddressTypeIPV4
206+
ingressALBAnnotation := getAnnotationsString(annotations, ingressALBIPAddressType, "")
207+
if ingressALBAnnotation != "" {
208+
log.Warnf("Deprecated annotation %q in use for %q resource named %q in namespace %q", ingressALBIPAddressType, typ, metadata.Name, metadata.Namespace)
209+
switch ingressALBAnnotation {
210+
case aws.IPAddressTypeDualstack:
211+
ipAddressType = aws.IPAddressTypeDualstack
212+
case aws.IPAddressTypeIPV4:
213+
ipAddressType = aws.IPAddressTypeIPV4
214+
}
210215
}
211216

212-
if annotation := getAnnotationsString(annotations, ingressNLBIPAddressType, ""); annotation == aws.IPAddressTypeDualstack {
217+
if annotation := getAnnotationsString(annotations, ingressIPAddressType, ""); annotation == aws.IPAddressTypeDualstack {
213218
ipAddressType = aws.IPAddressTypeDualstack
214219
} else if annotation == aws.IPAddressTypeIPV4 {
215220
ipAddressType = aws.IPAddressTypeIPV4

kubernetes/ingress.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ type ingressLoadBalancer struct {
6060
}
6161

6262
const (
63+
// deprecated, use ingressIPAddressType instead
6364
// ingressALBIPAddressType is used in external-dns, https://github.com/kubernetes-incubator/external-dns/pull/1079
6465
ingressALBIPAddressType = "alb.ingress.kubernetes.io/ip-address-type"
65-
ingressNLBIPAddressType = "nlb.ingress.kubernetes.io/ip-address-type"
66+
ingressIPAddressType = "ingress.kubernetes.io/ip-address-type"
6667
IngressAPIVersionExtensions = "extensions/v1beta1"
6768
IngressAPIVersionNetworking = "networking.k8s.io/v1"
6869
ingressListResource = "/apis/%s/ingresses"

0 commit comments

Comments
 (0)