diff --git a/source/source.go b/source/source.go index c7d46c970..149892853 100644 --- a/source/source.go +++ b/source/source.go @@ -60,6 +60,8 @@ const ( controllerAnnotationValue = "dns-controller" // The annotation used for defining the desired hostname internalHostnameAnnotationKey = "external-dns.alpha.kubernetes.io/internal-hostname" + // New annotation to support wildcard annotations for webhook providers + webhookWildcardAnnotationKey = "external-dns.alpha.kubernetes.io/webhook-*" ) const ( @@ -224,6 +226,13 @@ func getProviderSpecificAnnotations(annotations map[string]string) (endpoint.Pro Name: fmt.Sprintf("ibmcloud-%s", attr), Value: v, }) + } else if strings.HasPrefix(k, webhookWildcardAnnotationKey) { + // Support for wildcard annotations for webhook providers + attr := strings.TrimPrefix(k, "external-dns.alpha.kubernetes.io/webhook-") + providerSpecificAnnotations = append(providerSpecificAnnotations, endpoint.ProviderSpecificProperty{ + Name: fmt.Sprintf("webhook/%s", attr), + Value: v, + }) } } return providerSpecificAnnotations, setIdentifier