Skip to content

Commit ff39cee

Browse files
feat: Add Cisco IOS-XR Provider and implement interface stubs
1 parent 88ee1f2 commit ff39cee

15 files changed

+525
-0
lines changed

PROJECT

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,13 @@ resources:
2828
kind: Device
2929
path: github.com/ironcore-dev/network-operator/api/v1alpha1
3030
version: v1alpha1
31+
- api:
32+
crdVersion: v1
33+
namespaced: true
34+
controller: true
35+
domain: cloud.sap
36+
group: networking
37+
kind: CiscoIosxrPortConfig
38+
path: github.com/ironcore-dev/network-operator/api/v1alpha1
39+
version: v1alpha1
3140
version: "3"

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 89 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/main.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ import (
3535
"sigs.k8s.io/controller-runtime/pkg/webhook"
3636

3737
// Import all supported provider implementations.
38+
_ "github.com/ironcore-dev/network-operator/internal/provider/cisco/iosxr"
3839
_ "github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos"
3940
_ "github.com/ironcore-dev/network-operator/internal/provider/openconfig"
4041

4142
"github.com/ironcore-dev/network-operator/api/v1alpha1"
43+
networkingcloudsapv1alpha1 "github.com/ironcore-dev/network-operator/api/v1alpha1"
4244
"github.com/ironcore-dev/network-operator/internal/controller"
4345
"github.com/ironcore-dev/network-operator/internal/provider"
4446
// +kubebuilder:scaffold:imports
@@ -52,6 +54,7 @@ var (
5254
func init() {
5355
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
5456
utilruntime.Must(v1alpha1.AddToScheme(scheme))
57+
utilruntime.Must(networkingcloudsapv1alpha1.AddToScheme(scheme))
5558
// +kubebuilder:scaffold:scheme
5659
}
5760

@@ -232,6 +235,13 @@ func main() {
232235
os.Exit(1)
233236
}
234237

238+
if err := (&controller.CiscoIosxrPortConfigReconciler{
239+
Client: mgr.GetClient(),
240+
Scheme: mgr.GetScheme(),
241+
}).SetupWithManager(mgr); err != nil {
242+
setupLog.Error(err, "unable to create controller", "controller", "CiscoIosxrPortConfig")
243+
os.Exit(1)
244+
}
235245
// +kubebuilder:scaffold:builder
236246

237247
if metricsCertWatcher != nil {

config/crd/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
resources:
55
- bases/networking.cloud.sap_devices.yaml
66
- bases/networking.cloud.sap_interfaces.yaml
7+
- bases/networking.cloud.sap_ciscoiosxrportconfigs.yaml
78
# +kubebuilder:scaffold:crdkustomizeresource
89

910
patches:
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This rule is not used by the project network-operator itself.
2+
# It is provided to allow the cluster admin to help manage permissions for users.
3+
#
4+
# Grants full permissions ('*') over networking.cloud.sap.
5+
# This role is intended for users authorized to modify roles and bindings within the cluster,
6+
# enabling them to delegate specific permissions to other users or groups as needed.
7+
8+
apiVersion: rbac.authorization.k8s.io/v1
9+
kind: ClusterRole
10+
metadata:
11+
labels:
12+
app.kubernetes.io/name: network-operator
13+
app.kubernetes.io/managed-by: kustomize
14+
name: ciscoiosxrportconfig-admin-role
15+
rules:
16+
- apiGroups:
17+
- networking.cloud.sap
18+
resources:
19+
- ciscoiosxrportconfigs
20+
verbs:
21+
- '*'
22+
- apiGroups:
23+
- networking.cloud.sap
24+
resources:
25+
- ciscoiosxrportconfigs/status
26+
verbs:
27+
- get
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This rule is not used by the project network-operator itself.
2+
# It is provided to allow the cluster admin to help manage permissions for users.
3+
#
4+
# Grants permissions to create, update, and delete resources within the networking.cloud.sap.
5+
# This role is intended for users who need to manage these resources
6+
# but should not control RBAC or manage permissions for others.
7+
8+
apiVersion: rbac.authorization.k8s.io/v1
9+
kind: ClusterRole
10+
metadata:
11+
labels:
12+
app.kubernetes.io/name: network-operator
13+
app.kubernetes.io/managed-by: kustomize
14+
name: ciscoiosxrportconfig-editor-role
15+
rules:
16+
- apiGroups:
17+
- networking.cloud.sap
18+
resources:
19+
- ciscoiosxrportconfigs
20+
verbs:
21+
- create
22+
- delete
23+
- get
24+
- list
25+
- patch
26+
- update
27+
- watch
28+
- apiGroups:
29+
- networking.cloud.sap
30+
resources:
31+
- ciscoiosxrportconfigs/status
32+
verbs:
33+
- get
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This rule is not used by the project network-operator itself.
2+
# It is provided to allow the cluster admin to help manage permissions for users.
3+
#
4+
# Grants read-only access to networking.cloud.sap resources.
5+
# This role is intended for users who need visibility into these resources
6+
# without permissions to modify them. It is ideal for monitoring purposes and limited-access viewing.
7+
8+
apiVersion: rbac.authorization.k8s.io/v1
9+
kind: ClusterRole
10+
metadata:
11+
labels:
12+
app.kubernetes.io/name: network-operator
13+
app.kubernetes.io/managed-by: kustomize
14+
name: ciscoiosxrportconfig-viewer-role
15+
rules:
16+
- apiGroups:
17+
- networking.cloud.sap
18+
resources:
19+
- ciscoiosxrportconfigs
20+
verbs:
21+
- get
22+
- list
23+
- watch
24+
- apiGroups:
25+
- networking.cloud.sap
26+
resources:
27+
- ciscoiosxrportconfigs/status
28+
verbs:
29+
- get

config/rbac/kustomization.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,11 @@ resources:
2828
- interface_admin_role.yaml
2929
- interface_editor_role.yaml
3030
- interface_viewer_role.yaml
31+
# For each CRD, "Admin", "Editor" and "Viewer" roles are scaffolded by
32+
# default, aiding admins in cluster management. Those roles are
33+
# not used by the network-operator itself. You can comment the following lines
34+
# if you do not want those helpers be installed with your Project.
35+
- ciscoiosxrportconfig_admin_role.yaml
36+
- ciscoiosxrportconfig_editor_role.yaml
37+
- ciscoiosxrportconfig_viewer_role.yaml
38+

config/rbac/role.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ rules:
3131
- apiGroups:
3232
- networking.cloud.sap
3333
resources:
34+
- ciscoiosxrportconfigs
3435
- devices
3536
- interfaces
3637
verbs:
@@ -44,13 +45,15 @@ rules:
4445
- apiGroups:
4546
- networking.cloud.sap
4647
resources:
48+
- ciscoiosxrportconfigs/finalizers
4749
- devices/finalizers
4850
- interfaces/finalizers
4951
verbs:
5052
- update
5153
- apiGroups:
5254
- networking.cloud.sap
5355
resources:
56+
- ciscoiosxrportconfigs/status
5457
- devices/status
5558
- interfaces/status
5659
verbs:

config/samples/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
resources:
33
- v1alpha1_device.yaml
44
- v1alpha1_interface.yaml
5+
- networking.cloud.sap_v1alpha1_ciscoiosxrportconfig.yaml
56
# +kubebuilder:scaffold:manifestskustomizesamples

0 commit comments

Comments
 (0)