mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-08-06 01:26:59 +02:00
fix: do not expose vars
This commit is contained in:
parent
fdb2475892
commit
4fcc726863
@ -44,10 +44,10 @@ import (
|
||||
const (
|
||||
gatewayGroup = "gateway.networking.k8s.io"
|
||||
gatewayKind = "Gateway"
|
||||
// GatewayAPIDualstackAnnotationKey is the annotation used for determining if a Gateway Route is dualstack
|
||||
GatewayAPIDualstackAnnotationKey = "external-dns.alpha.kubernetes.io/dualstack"
|
||||
// GatewayAPIDualstackAnnotationValue is the value of the Gateway Route dualstack annotation that indicates it is dualstack
|
||||
GatewayAPIDualstackAnnotationValue = "true"
|
||||
// gatewayAPIDualstackAnnotationKey is the annotation used for determining if a Gateway Route is dualstack
|
||||
gatewayAPIDualstackAnnotationKey = "external-dns.alpha.kubernetes.io/dualstack"
|
||||
// gatewayAPIDualstackAnnotationValue is the value of the Gateway Route dualstack annotation that indicates it is dualstack
|
||||
gatewayAPIDualstackAnnotationValue = "true"
|
||||
)
|
||||
|
||||
type gatewayRoute interface {
|
||||
@ -616,8 +616,8 @@ func selectorsEqual(a, b labels.Selector) bool {
|
||||
}
|
||||
|
||||
func setDualstackLabel(rt gatewayRoute, endpoints []*endpoint.Endpoint) {
|
||||
val, ok := rt.Metadata().Annotations[GatewayAPIDualstackAnnotationKey]
|
||||
if ok && val == GatewayAPIDualstackAnnotationValue {
|
||||
val, ok := rt.Metadata().Annotations[gatewayAPIDualstackAnnotationKey]
|
||||
if ok && val == gatewayAPIDualstackAnnotationValue {
|
||||
log.Debugf("Adding dualstack label to GatewayRoute %s/%s.", rt.Metadata().Namespace, rt.Metadata().Name)
|
||||
for _, ep := range endpoints {
|
||||
ep.Labels[endpoint.DualstackLabelKey] = "true"
|
||||
|
@ -259,17 +259,17 @@ func TestDualStackLabel(t *testing.T) {
|
||||
},
|
||||
{
|
||||
desc: "correct-annotation-key-and-value",
|
||||
in: map[string]string{GatewayAPIDualstackAnnotationKey: GatewayAPIDualstackAnnotationValue},
|
||||
in: map[string]string{gatewayAPIDualstackAnnotationKey: gatewayAPIDualstackAnnotationValue},
|
||||
setsLabel: true,
|
||||
},
|
||||
{
|
||||
desc: "correct-annotation-key-incorrect-value",
|
||||
in: map[string]string{GatewayAPIDualstackAnnotationKey: "foo"},
|
||||
in: map[string]string{gatewayAPIDualstackAnnotationKey: "foo"},
|
||||
setsLabel: false,
|
||||
},
|
||||
{
|
||||
desc: "incorrect-annotation-key-correct-value",
|
||||
in: map[string]string{"FOO": GatewayAPIDualstackAnnotationValue},
|
||||
in: map[string]string{"FOO": gatewayAPIDualstackAnnotationValue},
|
||||
setsLabel: false,
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user