Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
cd52a9c
docs(sources): surface provider-specific annotations support it in so…
ivankatliarchuk Feb 27, 2026
cdc1e0b
docs(sources): surface provider-specific annotations support it in so…
ivankatliarchuk Feb 27, 2026
f37beec
docs(sources): surface provider-specific annotations support it in so…
ivankatliarchuk Feb 27, 2026
4a88d53
docs(sources): surface provider-specific annotations support it in so…
ivankatliarchuk Mar 13, 2026
dc07dab
docs(sources): surface provider-specific annotations support it in so…
ivankatliarchuk Mar 13, 2026
3f104ec
docs(sources): surface provider-specific annotations support it in so…
ivankatliarchuk Mar 13, 2026
8c3ea63
Merge branch 'kubernetes-sigs:master' into feat-sources-support-provi…
ivankatliarchuk Mar 14, 2026
7cdc0c6
Merge branch 'kubernetes-sigs:master' into feat-sources-support-provi…
ivankatliarchuk Mar 15, 2026
c4c0e4a
Merge branch 'master' into feat-sources-support-provider-specific
ivankatliarchuk Mar 16, 2026
0e52a2c
docs(sources): surface provider-specific annotations support it in so…
ivankatliarchuk Mar 16, 2026
497b3f6
docs(sources): surface provider-specific annotations support in docum…
ivankatliarchuk Mar 17, 2026
8cc7470
Merge branch 'master' into feat-sources-support-provider-specific
ivankatliarchuk Mar 18, 2026
f2f8e69
docs(sources): surface provider-specific annotations support in docum…
ivankatliarchuk Mar 18, 2026
1fe664e
docs(sources): surface provider-specific annotations support in docum…
ivankatliarchuk Mar 18, 2026
d87ae77
docs(sources): surface provider-specific annotations support in docum…
ivankatliarchuk Mar 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions docs/sources/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,33 @@ Sources are responsible for:

## Available Sources

| **Source Name** | Resources | Filters | Namespace | FQDN Template | Events | Category |
|:-------------------------|:--------------------------------------------------------------------------------------|:-----------------|:-----------|:--------------|:-------|:--------------------|
| **ambassador-host** | Host.getambassador.io | annotation,label | all,single | false | false | ingress controllers |
| **connector** | Remote TCP Server | | | false | false | special |
| **contour-httpproxy** | HTTPProxy.projectcontour.io | annotation | all,single | true | false | ingress controllers |
| **crd** | DNSEndpoint.externaldns.k8s.io | annotation,label | all,single | false | true | externaldns |
| **empty** | None | | | false | false | testing |
| **f5-transportserver** | TransportServer.cis.f5.com | annotation | all,single | false | false | load balancers |
| **f5-virtualserver** | VirtualServer.cis.f5.com | annotation | all,single | false | false | load balancers |
| **fake** | Fake Endpoints | | | true | true | testing |
| **gateway-grpcroute** | GRPCRoute.gateway.networking.k8s.io | annotation,label | all,single | false | false | gateway api |
| **gateway-httproute** | HTTPRoute.gateway.networking.k8s.io | annotation,label | all,single | false | false | gateway api |
| **gateway-tcproute** | TCPRoute.gateway.networking.k8s.io | annotation,label | all,single | false | false | gateway api |
| **gateway-tlsroute** | TLSRoute.gateway.networking.k8s.io | annotation,label | all,single | false | false | gateway api |
| **gateway-udproute** | UDPRoute.gateway.networking.k8s.io | annotation,label | all,single | true | false | gateway api |
| **gloo-proxy** | Proxy.gloo.solo.io | | all,single | false | false | service mesh |
| **ingress** | Ingress | annotation,label | all,single | true | true | kubernetes core |
| **istio-gateway** | Gateway.networking.istio.io | annotation | all,single | true | false | service mesh |
| **istio-virtualservice** | VirtualService.networking.istio.io | annotation | all,single | true | false | service mesh |
| **kong-tcpingress** | TCPIngress.configuration.konghq.com | annotation | all,single | false | false | ingress controllers |
| **node** | Node | annotation,label | all | true | true | kubernetes core |
| **openshift-route** | Route.route.openshift.io | annotation,label | all,single | true | false | openshift |
| **pod** | Pod | annotation,label | all,single | true | true | kubernetes core |
| **service** | Service | annotation,label | all,single | true | true | kubernetes core |
| **skipper-routegroup** | RouteGroup.zalando.org | annotation | all,single | true | false | ingress controllers |
| **traefik-proxy** | IngressRoute.traefik.io<br/>IngressRouteTCP.traefik.io<br/>IngressRouteUDP.traefik.io | annotation | all,single | false | false | ingress controllers |
| **unstructured** | Unstructured | annotation,label | all,single | true | false | custom resources |
| **Source Name** | Filters | Namespace | FQDN Template | Events | Provider Specific | Category | Resources |
|:-------------------------|:-----------------|:-----------|:--------------|:-------|:------------------|:--------------------|:--------------------------------------------------------------------------------------|
| **ambassador-host** | annotation,label | all,single | false | false | true | ingress controllers | Host.getambassador.io |
| **connector** | | | false | false | false | special | Remote TCP Server |
| **contour-httpproxy** | annotation | all,single | true | false | true | ingress controllers | HTTPProxy.projectcontour.io |
| **crd** | annotation,label | all,single | false | true | true | externaldns | DNSEndpoint.externaldns.k8s.io |
| **empty** | | | false | false | false | testing | None |
| **f5-transportserver** | annotation | all,single | false | false | false | load balancers | TransportServer.cis.f5.com |
| **f5-virtualserver** | annotation | all,single | false | false | false | load balancers | VirtualServer.cis.f5.com |
| **fake** | | | true | true | false | testing | Fake Endpoints |
| **gateway-grpcroute** | annotation,label | all,single | true | false | true | gateway api | GRPCRoute.gateway.networking.k8s.io |
| **gateway-httproute** | annotation,label | all,single | true | false | true | gateway api | HTTPRoute.gateway.networking.k8s.io |
| **gateway-tcproute** | annotation,label | all,single | true | false | true | gateway api | TCPRoute.gateway.networking.k8s.io |
| **gateway-tlsroute** | annotation,label | all,single | true | false | true | gateway api | TLSRoute.gateway.networking.k8s.io |
| **gateway-udproute** | annotation,label | all,single | true | false | true | gateway api | UDPRoute.gateway.networking.k8s.io |
| **gloo-proxy** | | all,single | false | false | true | service mesh | Proxy.gloo.solo.io |
| **ingress** | annotation,label | all,single | true | true | true | kubernetes core | Ingress |
| **istio-gateway** | annotation | all,single | true | false | true | service mesh | Gateway.networking.istio.io |
| **istio-virtualservice** | annotation | all,single | true | false | true | service mesh | VirtualService.networking.istio.io |
| **kong-tcpingress** | annotation | all,single | false | false | true | ingress controllers | TCPIngress.configuration.konghq.com |
| **node** | annotation,label | all | true | true | false | kubernetes core | Node |
| **openshift-route** | annotation,label | all,single | true | false | true | openshift | Route.route.openshift.io |
| **pod** | annotation,label | all,single | true | true | false | kubernetes core | Pod |
| **service** | annotation,label | all,single | true | true | true | kubernetes core | Service |
| **skipper-routegroup** | annotation | all,single | true | false | true | ingress controllers | RouteGroup.zalando.org |
| **traefik-proxy** | annotation | all,single | false | false | true | ingress controllers | IngressRoute.traefik.io<br/>IngressRouteTCP.traefik.io<br/>IngressRouteUDP.traefik.io |
| **unstructured** | annotation,label | all,single | true | false | false | custom resources | Unstructured |

## Usage

Expand Down
83 changes: 46 additions & 37 deletions internal/gen/docs/sources/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@ import (
)

const (
annotationPrefix = "+externaldns:source:"
annotationName = annotationPrefix + "name="
annotationCategory = annotationPrefix + "category="
annotationDesc = annotationPrefix + "description="
annotationResources = annotationPrefix + "resources="
annotationFilters = annotationPrefix + "filters="
annotationNamespace = annotationPrefix + "namespace="
annotationFQDNTemplate = annotationPrefix + "fqdn-template="
annotationEvents = annotationPrefix + "events="
annotationPrefix = "+externaldns:source:"
annotationName = annotationPrefix + "name="
annotationCategory = annotationPrefix + "category="
annotationDesc = annotationPrefix + "description="
annotationResources = annotationPrefix + "resources="
annotationFilters = annotationPrefix + "filters="
annotationNamespace = annotationPrefix + "namespace="
annotationFQDNTemplate = annotationPrefix + "fqdn-template="
annotationEvents = annotationPrefix + "events="
annotationProviderSpecific = annotationPrefix + "provider-specific="
)

var (
Expand All @@ -54,16 +55,17 @@ var (

// Source represents metadata about a source implementation
type Source struct {
Name string // e.g., "service", "ingress", "crd"
Type string // e.g., "serviceSource"
File string // e.g., "source/service.go"
Description string // Description of what this source does
Category string // e.g., "Kubernetes", "Gateway", "Service Mesh", "Wrapper"
Resources string // Kubernetes resources watched, e.g., "Service", "Ingress"
Filters string // Supported filters, e.g., "annotation,label"
Namespace string // Namespace support: "all", "single", "multiple"
FQDNTemplate string // FQDN template support: "true", "false"
Events string // Events support: "true", "false"
Name string // e.g., "service", "ingress", "crd"
Type string // e.g., "serviceSource"
File string // e.g., "source/service.go"
Description string // Description of what this source does
Category string // e.g., "Kubernetes", "Gateway", "Service Mesh", "Wrapper"
Resources string // Kubernetes resources watched, e.g., "Service", "Ingress"
Filters string // Supported filters, e.g., "annotation,label"
Namespace string // Namespace support: "all", "single", "multiple"
FQDNTemplate string // FQDN template support: "true", "false"
Events string // Events support: "true", "false"
ProviderSpecific string // Provider-specific properties support: "true", "false"
}

type Sources []Source
Expand Down Expand Up @@ -107,13 +109,14 @@ func discoverSources(dir string) (Sources, error) {
}

type sourceColumnWidths struct {
Name int
Resources int
Filters int
Namespace int
FQDNTemplate int
Events int
Category int
Name int
Resources int
Filters int
Namespace int
FQDNTemplate int
Events int
ProviderSpecific int
Category int
}

func computeSourceColumnWidths(sources Sources) sourceColumnWidths {
Expand All @@ -124,23 +127,26 @@ func computeSourceColumnWidths(sources Sources) sourceColumnWidths {
fqdnTemplates := make([]string, len(sources))
events := make([]string, len(sources))
categories := make([]string, len(sources))
providerSpecifics := make([]string, len(sources))
for i, src := range sources {
names[i] = "**" + src.Name + "**"
resources[i] = strings.ReplaceAll(src.Resources, ",", "<br/>")
filters[i] = src.Filters
namespaces[i] = src.Namespace
fqdnTemplates[i] = src.FQDNTemplate
events[i] = src.Events
providerSpecifics[i] = src.ProviderSpecific
categories[i] = strings.ToLower(src.Category)
}
return sourceColumnWidths{
Name: utils.ComputeColumnWidth("**Source Name**", names),
Resources: utils.ComputeColumnWidth("Resources", resources),
Filters: utils.ComputeColumnWidth("Filters", filters),
Namespace: utils.ComputeColumnWidth("Namespace", namespaces),
FQDNTemplate: utils.ComputeColumnWidth("FQDN Template", fqdnTemplates),
Events: utils.ComputeColumnWidth("Events", events),
Category: utils.ComputeColumnWidth("Category", categories),
Name: utils.ComputeColumnWidth("**Source Name**", names),
Resources: utils.ComputeColumnWidth("Resources", resources),
Filters: utils.ComputeColumnWidth("Filters", filters),
Namespace: utils.ComputeColumnWidth("Namespace", namespaces),
FQDNTemplate: utils.ComputeColumnWidth("FQDN Template", fqdnTemplates),
Events: utils.ComputeColumnWidth("Events", events),
ProviderSpecific: utils.ComputeColumnWidth("Provider Specific", providerSpecifics),
Category: utils.ComputeColumnWidth("Category", categories),
}
}

Expand Down Expand Up @@ -303,10 +309,11 @@ func extractSourcesFromComments(comments, typeName, filePath string) (Sources, e

// Start new source
currentSource = &Source{
Type: typeName,
File: filePath,
Name: strings.TrimPrefix(line, annotationName),
Events: "false",
Type: typeName,
File: filePath,
Name: strings.TrimPrefix(line, annotationName),
Events: "false",
ProviderSpecific: "false",
}
case currentSource == nil:
return nil, fmt.Errorf("found annotation line without preceding source name in type %s: %s", typeName, line)
Expand All @@ -324,6 +331,8 @@ func extractSourcesFromComments(comments, typeName, filePath string) (Sources, e
currentSource.FQDNTemplate = strings.TrimPrefix(line, annotationFQDNTemplate)
case strings.HasPrefix(line, annotationEvents):
currentSource.Events = strings.TrimPrefix(line, annotationEvents)
case strings.HasPrefix(line, annotationProviderSpecific):
currentSource.ProviderSpecific = strings.TrimPrefix(line, annotationProviderSpecific)
}
}

Expand Down
4 changes: 4 additions & 0 deletions internal/gen/docs/sources/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ func TestParseSourceAnnotations(t *testing.T) {
// +externaldns:source:filters=annotation,label
// +externaldns:source:namespace=all,single
// +externaldns:source:fqdn-template=true
// +externaldns:source:provider-specific=true
type testSource struct {
client string
}
Expand All @@ -129,6 +130,7 @@ type testSource struct {
assert.Equal(t, "all,single", source.Namespace)
assert.Equal(t, "true", source.FQDNTemplate)
assert.Equal(t, "false", source.Events)
assert.Equal(t, "true", source.ProviderSpecific)
}

func TestParseSourceAnnotations_SkipsTestFiles(t *testing.T) {
Expand Down Expand Up @@ -180,8 +182,10 @@ type secondSource struct {}
assert.Len(t, sources, 2)
assert.Equal(t, "first", sources[0].Name)
assert.Equal(t, "false", sources[0].Events)
assert.Equal(t, "false", sources[0].ProviderSpecific)
assert.Equal(t, "second", sources[1].Name)
assert.Equal(t, "true", sources[1].Events)
assert.Equal(t, "false", sources[1].ProviderSpecific)
}

func TestParseFile_IgnoresNonSourceTypes(t *testing.T) {
Expand Down
Loading
Loading