Skip to content

Commit 5b75547

Browse files
committed
Regenerate code
1 parent 71d8f25 commit 5b75547

File tree

11 files changed

+223
-16
lines changed

11 files changed

+223
-16
lines changed

.golangci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,19 @@ linters:
7777
- gocyclo
7878
- dupl
7979
path: internal/provider/cisco/nxos/vrf
80+
- linters:
81+
- whitespace
82+
path: internal/provider/cisco/nxos/nve
8083
- linters:
8184
- lll
8285
- goconst
8386
path: internal/provider/cisco/nxos
87+
- linters:
88+
- goimports
89+
- gosec
90+
- perfsprint
91+
- errcheck
92+
path: internal/provider/cisco/nxos/isis
8493
- linters:
8594
- lll
8695
- perfsprint

Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22
# SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and IronCore contributors
33
# SPDX-License-Identifier: Apache-2.0
44

5-
FROM golang:1.24-alpine3.22 AS builder
6-
7-
RUN apk add --no-cache --no-progress git make
8-
9-
ARG BININFO_BUILD_DATE
10-
ARG BININFO_COMMIT_HASH
11-
ARG BININFO_VERSION
5+
FROM golang:1.25 AS builder
126

137
ARG TARGETOS
148
ARG TARGETARCH
@@ -37,7 +31,7 @@ COPY internal/ internal/
3731
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
3832
RUN --mount=type=cache,target=/root/.cache/go-build \
3933
--mount=type=cache,target=/go/pkg \
40-
CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -ldflags="-s -w -X 'main.version=${VERSION}' -X 'main.gitCommit=${GIT_COMMIT}' -X 'main.buildDate=${BUILD_DATE}'" -a -o manager cmd/main.go
34+
CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -ldflags="-s -w -X 'main.version=${VERSION}' -X 'main.gitCommit=${GIT_COMMIT}' -X 'main.buildDate="${BUILD_DATE}""'" -a -o manager cmd/main.go
4135
4236
# Use distroless as minimal base image to package the manager binary
4337
# Refer to https://github.com/GoogleContainerTools/distroless for more details

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ CONTROLLER_TOOLS_VERSION ?= v0.18.0
242242
ENVTEST_VERSION ?= $(shell go list -m -f "{{ .Version }}" sigs.k8s.io/controller-runtime | awk -F'[v.]' '{printf "release-%d.%d", $$2, $$3}')
243243
#ENVTEST_K8S_VERSION is the version of Kubernetes to use for setting up ENVTEST binaries (i.e. 1.31)
244244
ENVTEST_K8S_VERSION ?= $(shell go list -m -f "{{ .Version }}" k8s.io/api | awk -F'[v.]' '{printf "1.%d.%d",$$3, $$2}')
245-
GOLANGCI_LINT_VERSION ?= v2.4
245+
GOLANGCI_LINT_VERSION ?= v2.5
246246
GOIMPORTS_VERSION ?= v0.31.0
247247
GEN_CRD_API_REFERENCE_DOCS_VERSION ?= v0.3.0
248248
KUBEBUILDER_VERSION ?= v4.5.1

charts/network-operator/templates/crd/networking.cloud.sap_interfaces.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ spec:
3535
- jsonPath: .spec.mtu
3636
name: MTU
3737
type: string
38+
- jsonPath: .spec.deviceName
39+
name: Device
40+
type: string
3841
- jsonPath: .status.conditions[?(@.type=="Ready")].status
3942
name: Ready
4043
type: string
@@ -80,6 +83,25 @@ spec:
8083
the interface.
8184
maxLength: 255
8285
type: string
86+
deviceRef:
87+
description: |-
88+
DeviceName is the name of the Device this object belongs to. The Device object must exist in the same namespace.
89+
Immutable.
90+
properties:
91+
name:
92+
description: |-
93+
Name of the referent.
94+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
95+
maxLength: 63
96+
minLength: 1
97+
type: string
98+
required:
99+
- name
100+
type: object
101+
x-kubernetes-map-type: atomic
102+
x-kubernetes-validations:
103+
- message: DeviceRef is immutable
104+
rule: self == oldSelf
83105
ipv4Addresses:
84106
description: |-
85107
Ipv4Addresses is the list of IPv4 addresses assigned to the interface.
@@ -100,6 +122,40 @@ spec:
100122
description: Name is the name of the interface.
101123
maxLength: 255
102124
type: string
125+
providerConfigRef:
126+
description: |-
127+
ProviderConfigRef is a reference to a resource holding the provider-specific configuration of this interface.
128+
This reference is used to link the Interface to its provider-specific configuration.
129+
properties:
130+
apiVersion:
131+
description: APIVersion is the api group version of the resource
132+
being referenced.
133+
maxLength: 253
134+
minLength: 1
135+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/)?([a-z0-9]([-a-z0-9]*[a-z0-9])?)$
136+
type: string
137+
kind:
138+
description: |-
139+
Kind of the resource being referenced.
140+
Kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character.
141+
maxLength: 63
142+
minLength: 1
143+
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
144+
type: string
145+
name:
146+
description: |-
147+
Name of the resource being referenced.
148+
Name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.
149+
maxLength: 253
150+
minLength: 1
151+
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
152+
type: string
153+
required:
154+
- apiVersion
155+
- kind
156+
- name
157+
type: object
158+
x-kubernetes-map-type: atomic
103159
switchport:
104160
description: |-
105161
Switchport defines the switchport configuration for the interface.
@@ -157,6 +213,7 @@ spec:
157213
type: string
158214
required:
159215
- adminState
216+
- deviceRef
160217
- name
161218
- type
162219
type: object
@@ -233,6 +290,8 @@ spec:
233290
- type
234291
x-kubernetes-list-type: map
235292
type: object
293+
required:
294+
- spec
236295
type: object
237296
served: true
238297
storage: true

config/crd/bases/networking.cloud.sap_interfaces.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.19.0
6+
controller-gen.kubebuilder.io/version: v0.18.0
77
name: interfaces.networking.cloud.sap
88
spec:
99
group: networking.cloud.sap

docs/api-reference/api.md

Lines changed: 145 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,35 @@ More info: <a href="https://git.k8s.io/community/contributors/devel/sig-architec
10561056
<table>
10571057
<tr>
10581058
<td>
1059+
<code>deviceRef</code><br/>
1060+
<em>
1061+
<a href="#networking.cloud.sap/v1alpha1.LocalObjectReference">
1062+
LocalObjectReference
1063+
</a>
1064+
</em>
1065+
</td>
1066+
<td>
1067+
<p>DeviceName is the name of the Device this object belongs to. The Device object must exist in the same namespace.
1068+
Immutable.</p>
1069+
</td>
1070+
</tr>
1071+
<tr>
1072+
<td>
1073+
<code>providerConfigRef</code><br/>
1074+
<em>
1075+
<a href="#networking.cloud.sap/v1alpha1.TypedLocalObjectReference">
1076+
TypedLocalObjectReference
1077+
</a>
1078+
</em>
1079+
</td>
1080+
<td>
1081+
<em>(Optional)</em>
1082+
<p>ProviderConfigRef is a reference to a resource holding the provider-specific configuration of this interface.
1083+
This reference is used to link the Interface to its provider-specific configuration.</p>
1084+
</td>
1085+
</tr>
1086+
<tr>
1087+
<td>
10591088
<code>name</code><br/>
10601089
<em>
10611090
string
@@ -1149,14 +1178,15 @@ or as interface reference in the form of &ldquo;unnumbered:<source-interface>&rd
11491178
</tr>
11501179
<tr>
11511180
<td>
1152-
<code>status</code><br/>
1181+
<code>status,omitempty,omitzero</code><br/>
11531182
<em>
11541183
<a href="#networking.cloud.sap/v1alpha1.InterfaceStatus">
11551184
InterfaceStatus
11561185
</a>
11571186
</em>
11581187
</td>
11591188
<td>
1189+
<em>(Optional)</em>
11601190
<p>Status of the resource. This is set and updated automatically.
11611191
Read-only.
11621192
More info: <a href="https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status">https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status</a></p>
@@ -1182,6 +1212,35 @@ More info: <a href="https://git.k8s.io/community/contributors/devel/sig-architec
11821212
<tbody>
11831213
<tr>
11841214
<td>
1215+
<code>deviceRef</code><br/>
1216+
<em>
1217+
<a href="#networking.cloud.sap/v1alpha1.LocalObjectReference">
1218+
LocalObjectReference
1219+
</a>
1220+
</em>
1221+
</td>
1222+
<td>
1223+
<p>DeviceName is the name of the Device this object belongs to. The Device object must exist in the same namespace.
1224+
Immutable.</p>
1225+
</td>
1226+
</tr>
1227+
<tr>
1228+
<td>
1229+
<code>providerConfigRef</code><br/>
1230+
<em>
1231+
<a href="#networking.cloud.sap/v1alpha1.TypedLocalObjectReference">
1232+
TypedLocalObjectReference
1233+
</a>
1234+
</em>
1235+
</td>
1236+
<td>
1237+
<em>(Optional)</em>
1238+
<p>ProviderConfigRef is a reference to a resource holding the provider-specific configuration of this interface.
1239+
This reference is used to link the Interface to its provider-specific configuration.</p>
1240+
</td>
1241+
</tr>
1242+
<tr>
1243+
<td>
11851244
<code>name</code><br/>
11861245
<em>
11871246
string
@@ -1327,6 +1386,37 @@ or as interface reference in the form of &ldquo;unnumbered:<source-interface>&rd
13271386
</td>
13281387
</tr></tbody>
13291388
</table>
1389+
<h3 id="networking.cloud.sap/v1alpha1.LocalObjectReference">LocalObjectReference
1390+
</h3>
1391+
<p>
1392+
(<em>Appears on:</em><a href="#networking.cloud.sap/v1alpha1.InterfaceSpec">InterfaceSpec</a>)
1393+
</p>
1394+
<div>
1395+
<p>LocalObjectReference contains enough information to locate a
1396+
referenced object inside the same namespace.</p>
1397+
</div>
1398+
<table>
1399+
<thead>
1400+
<tr>
1401+
<th>Field</th>
1402+
<th>Description</th>
1403+
</tr>
1404+
</thead>
1405+
<tbody>
1406+
<tr>
1407+
<td>
1408+
<code>name</code><br/>
1409+
<em>
1410+
string
1411+
</em>
1412+
</td>
1413+
<td>
1414+
<p>Name of the referent.
1415+
More info: <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names">https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names</a></p>
1416+
</td>
1417+
</tr>
1418+
</tbody>
1419+
</table>
13301420
<h3 id="networking.cloud.sap/v1alpha1.LogFacility">LogFacility
13311421
</h3>
13321422
<div>
@@ -2111,6 +2201,60 @@ Kubernetes core/v1.ConfigMapKeySelector
21112201
</tr>
21122202
</tbody>
21132203
</table>
2204+
<h3 id="networking.cloud.sap/v1alpha1.TypedLocalObjectReference">TypedLocalObjectReference
2205+
</h3>
2206+
<p>
2207+
(<em>Appears on:</em><a href="#networking.cloud.sap/v1alpha1.InterfaceSpec">InterfaceSpec</a>)
2208+
</p>
2209+
<div>
2210+
<p>TypedLocalObjectReference contains enough information to locate a
2211+
typed referenced object inside the same namespace.</p>
2212+
</div>
2213+
<table>
2214+
<thead>
2215+
<tr>
2216+
<th>Field</th>
2217+
<th>Description</th>
2218+
</tr>
2219+
</thead>
2220+
<tbody>
2221+
<tr>
2222+
<td>
2223+
<code>kind</code><br/>
2224+
<em>
2225+
string
2226+
</em>
2227+
</td>
2228+
<td>
2229+
<p>Kind of the resource being referenced.
2230+
Kind must consist of alphanumeric characters or &lsquo;-&rsquo;, start with an alphabetic character, and end with an alphanumeric character.</p>
2231+
</td>
2232+
</tr>
2233+
<tr>
2234+
<td>
2235+
<code>name</code><br/>
2236+
<em>
2237+
string
2238+
</em>
2239+
</td>
2240+
<td>
2241+
<p>Name of the resource being referenced.
2242+
Name must consist of lower case alphanumeric characters, &lsquo;-&rsquo; or &lsquo;.&rsquo;, and must start and end with an alphanumeric character.</p>
2243+
</td>
2244+
</tr>
2245+
<tr>
2246+
<td>
2247+
<code>apiVersion</code><br/>
2248+
<em>
2249+
string
2250+
</em>
2251+
</td>
2252+
<td>
2253+
<p>APIVersion is the api group version of the resource being referenced.</p>
2254+
</td>
2255+
</tr>
2256+
</tbody>
2257+
</table>
21142258
<h3 id="networking.cloud.sap/v1alpha1.User">User
21152259
</h3>
21162260
<div>

internal/provider/cisco/nxos/gnmiext/mock.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/provider/cisco/nxos/iface/loopback_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ func Test_Loopback_ToYGOT_BaseConfig(t *testing.T) {
103103
}
104104

105105
func Test_Loopback_ToYGOT_WithL3Config(t *testing.T) {
106-
107106
testAddressingL3Cfg, err := NewL3Config(
108107
WithNumberedAddressingIPv4([]string{"10.0.0.1/24"}),
109108
)

internal/provider/cisco/nxos/iface/portchannel_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ func Test_PortChannel_ToYGOT(t *testing.T) {
276276
})
277277
}
278278
}
279+
279280
func Test_PortChannel_Reset(t *testing.T) {
280281
tests := []struct {
281282
name string

internal/provider/cisco/nxos/isis/interface.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ import (
1616
"github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos/iface"
1717
)
1818

19-
var (
20-
ErrUnsupported error = errors.New("isis: unsupported interface type for isis")
21-
)
19+
var ErrUnsupported error = errors.New("isis: unsupported interface type for isis")
2220

2321
type Interface struct {
2422
name string // interface name, e.g., Ethernet1/1
@@ -76,6 +74,7 @@ func WithPointToPoint() IfOption {
7674
return nil
7775
}
7876
}
77+
7978
func WithBFD() IfOption {
8079
return func(i *Interface) error {
8180
i.bfd = true

0 commit comments

Comments
 (0)