Skip to content

Commit 8bbf68c

Browse files
claudenikatza
authored andcommitted
[docs] Add provider compatibility matrix
Add a Go tool (hack/generate-provider-matrix.go) that produces a Markdown compatibility matrix showing which core API types each provider implements. How it works: - Uses reflect.Type.Implements() to test each provider against the provider.*Provider interfaces defined in internal/provider/ - Self-validates by parsing Go AST of the provider package to ensure the hardcoded interfaceMap stays in sync with source interfaces - Discovers provider-specific types (config extensions and standalone CRDs) by scanning provider API directories for Register*Dependency calls and SchemeBuilder.Register calls - Resolves interface names to Kubernetes Kind names by correlating core _types.go filenames with Register*Dependency function names, then validating against the runtime scheme - Writes docs/provider-compatibility.md (full matrix) and updates a summary table in README.md between sentinel markers The new `make provider-matrix` target is also wired as a dependency of `make docs`, so the matrix is always regenerated with the API reference docs.
1 parent 70069a0 commit 8bbf68c

6 files changed

Lines changed: 822 additions & 3 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ go.work.sum
2020
# Generated build-installer
2121
dist/*
2222

23+
# Generated provider matrix tool
24+
generate-provider-matrix
25+
2326
# Kubernetes Generated files - skip generated files, except for vendored files
2427
!vendor/**/zz_generated.*
2528

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ run-docs:
180180
@docker build -t $(DOCS_IMG) -f docs/Dockerfile docs --load
181181
@docker run --rm --init -p 5173:5173 -v $(ROOT_DIR)/docs:/workspace -v /workspace/node_modules $(DOCS_IMG)
182182

183-
docs: install-crd-ref-docs
183+
docs: install-crd-ref-docs provider-matrix
184184
crd-ref-docs --source-path=./api --config=./hack/api-reference/config.yaml --renderer=markdown --output-path=./docs/api-reference/index.md
185185
@$(SED) -i \
186186
-e 's/#networkingmetalironcoredevv1alpha1/#networking-metal-ironcore-dev-v1alpha1/g' \
@@ -189,6 +189,11 @@ docs: install-crd-ref-docs
189189
-e 's/#xrcisconetworkingmetalironcoredevv1alpha1/#xr-cisco-networking-metal-ironcore-dev-v1alpha1/g' \
190190
docs/api-reference/index.md
191191

192+
# Generate provider implementation matrix
193+
provider-matrix: FORCE
194+
@printf "\e[1;36m>> go run ./hack/generate-provider-matrix.go > docs/provider-compatibility.md\e[0m\n"
195+
@go run ./hack/generate-provider-matrix.go > docs/provider-compatibility.md
196+
192197
install-goimports: FORCE
193198
@if ! hash goimports 2>/dev/null; then printf "\e[1;36m>> Installing goimports (this may take a while)...\e[0m\n"; go install golang.org/x/tools/cmd/goimports@latest; fi
194199

@@ -310,7 +315,7 @@ license-headers: FORCE install-addlicense
310315
@printf "\e[1;36m>> addlicense (for license headers on source code files)\e[0m\n"
311316
@printf "%s\0" $(patsubst $(shell awk '$$1 == "module" {print $$2}' go.mod)%,.%/*.go,$(shell go list ./...)) | $(XARGS) -0 -I{} bash -c 'year="$$(grep 'Copyright' {} | head -n1 | grep -E -o '"'"'[0-9]{4}(-[0-9]{4})?'"'"')"; if [[ -z "$$year" ]]; then year=$$(date +%Y); fi; gawk -i inplace '"'"'{if (display) {print} else {!/^\/\*/ && !/^\*/}}; {if (!display && $$0 ~ /^(package |$$)/) {display=1} else { }}'"'"' {}; addlicense -c "SAP SE or an SAP affiliate company and IronCore contributors" -s=only -y "$$year" -- {}; $(SED) -i '"'"'1s+// Copyright +// SPDX-FileCopyrightText: +'"'"' {}; '
312317
@printf "\e[1;36m>> reuse annotate (for license headers on other files)\e[0m\n"
313-
@reuse lint -j | jq -r '.non_compliant.missing_licensing_info[]' | grep -vw vendor | $(XARGS) reuse annotate -c 'SAP SE or an SAP affiliate company and IronCore contributors' -l Apache-2.0 --skip-unrecognised
318+
@reuse lint -j | jq -r '.non_compliant.missing_licensing_info[]' | sed '/\<vendor\>/d' | $(XARGS) reuse annotate -c 'SAP SE or an SAP affiliate company and IronCore contributors' -l Apache-2.0 --skip-unrecognised
314319
@printf "\e[1;36m>> reuse download --all\e[0m\n"
315320
@reuse download --all
316321
@printf "\e[1;35mPlease review the changes. If *.license files were generated, consider instructing go-makefile-maker to add overrides to REUSE.toml instead.\e[0m\n"

Makefile.maker.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,16 @@ verbatim: |
224224
@docker build -t $(DOCS_IMG) -f docs/Dockerfile docs --load
225225
@docker run --rm --init -p 5173:5173 -v $(ROOT_DIR)/docs:/workspace -v /workspace/node_modules $(DOCS_IMG)
226226
227-
docs: install-crd-ref-docs
227+
docs: install-crd-ref-docs provider-matrix
228228
crd-ref-docs --source-path=./api --config=./hack/api-reference/config.yaml --renderer=markdown --output-path=./docs/api-reference/index.md
229229
@$(SED) -i \
230230
-e 's/#networkingmetalironcoredevv1alpha1/#networking-metal-ironcore-dev-v1alpha1/g' \
231231
-e 's/#nxcisconetworkingmetalironcoredevv1alpha1/#nx-cisco-networking-metal-ironcore-dev-v1alpha1/g' \
232232
-e 's/#xecisconetworkingmetalironcoredevv1alpha1/#xe-cisco-networking-metal-ironcore-dev-v1alpha1/g' \
233233
-e 's/#xrcisconetworkingmetalironcoredevv1alpha1/#xr-cisco-networking-metal-ironcore-dev-v1alpha1/g' \
234234
docs/api-reference/index.md
235+
236+
# Generate provider implementation matrix
237+
provider-matrix: FORCE
238+
@printf "\e[1;36m>> go run ./hack/generate-provider-matrix.go > docs/provider-compatibility.md\e[0m\n"
239+
@go run ./hack/generate-provider-matrix.go > docs/provider-compatibility.md

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,20 @@ Users can just run kubectl apply -f <URL for YAML BUNDLE> to install the project
9898
kubectl apply -f https://raw.githubusercontent.com/<org>/network-operator/<tag or branch>/dist/install.yaml
9999
```
100100

101+
## Supported Providers
102+
103+
network-operator supports multiple network device providers with varying levels of feature support:
104+
105+
<!-- BEGIN provider-summary -->
106+
| Provider | Supported API Types |
107+
|----------|---------------------|
108+
| Cisco NX-OS | 22 / 22 |
109+
| Cisco IOS-XR | 1 / 22 |
110+
| OpenConfig | 1 / 22 |
111+
<!-- END provider-summary -->
112+
113+
For a detailed compatibility matrix showing which API types are supported by each provider, see [Provider Compatibility Matrix](docs/provider-compatibility.md).
114+
101115
## Support, Feedback, Contributing
102116

103117
This project is open to feature requests/suggestions, bug reports etc. via [GitHub issues](https://github.com/ironcore-dev/network-operator/issues). Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](CONTRIBUTING.md).

docs/provider-compatibility.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and IronCore contributors
3+
SPDX-License-Identifier: Apache-2.0
4+
-->
5+
6+
# Provider Compatibility Matrix
7+
8+
This document provides a detailed overview of which API types are supported by each network device provider.
9+
10+
<!-- To regenerate this matrix, run: make provider-matrix -->
11+
12+
## Compatibility Matrix
13+
14+
| Core Kind | Cisco NX-OS | Cisco IOS-XR | OpenConfig |
15+
|-----------|--------|--------|--------|
16+
| `AccessControlList` ||||
17+
| `BGPPeer` ||||
18+
| `BGP` ||||
19+
| `Banner` ||||
20+
| `Certificate` ||||
21+
| `DNS` ||||
22+
| `EVPNInstance` ||||
23+
| `ISIS` ||||
24+
| `Interface` ||||
25+
| `LLDP` ||||
26+
| `ManagementAccess` ||||
27+
| `NTP` ||||
28+
| `NetworkVirtualizationEdge` ||||
29+
| `OSPF` ||||
30+
| `PIM` ||||
31+
| `PrefixSet` ||||
32+
| `RoutingPolicy` ||||
33+
| `SNMP` ||||
34+
| `Syslog` ||||
35+
| `User` ||||
36+
| `VLAN` ||||
37+
| `VRF` ||||
38+
39+
**Legend:**
40+
- ✅ Supported
41+
- — Not supported
42+
43+
## Cisco NX-OS
44+
45+
Cisco NX-OS provides comprehensive support for network configuration through the network-operator.
46+
47+
**Core API types:** 22 / 22
48+
49+
**Provider-specific types:**
50+
51+
| Kind | Category |
52+
|------|----------|
53+
| `BGPConfig` | Extends core type `BGP` |
54+
| `InterfaceConfig` | Extends core type `Interface` |
55+
| `LLDPConfig` | Extends core type `LLDP` |
56+
| `ManagementAccessConfig` | Extends core type `ManagementAccess` |
57+
| `NetworkVirtualizationEdgeConfig` | Extends core type `NetworkVirtualizationEdge` |
58+
| `BorderGateway` | Provider-exclusive |
59+
| `System` | Provider-exclusive |
60+
| `VPCDomain` | Provider-exclusive |
61+
62+
## Cisco IOS-XR
63+
64+
Cisco IOS-XR support is currently in early development.
65+
66+
**Core API types:** 1 / 22
67+
68+
## OpenConfig
69+
70+
OpenConfig provides a vendor-neutral configuration interface using standard OpenConfig YANG models.
71+
72+
**Core API types:** 1 / 22
73+
74+
## Contributing
75+
76+
To add support for a new API type or provider:
77+
78+
1. Define the provider interface in `internal/provider/`
79+
2. Implement the interface methods in your provider package
80+
3. Run `make provider-matrix` to regenerate this document
81+
4. Submit a pull request with your changes
82+
83+
The matrix is automatically generated by checking which provider interfaces
84+
each provider implements, ensuring accuracy and eliminating manual maintenance.

0 commit comments

Comments
 (0)