Skip to content

Commit 28c67ae

Browse files
authored
Merge branch 'main' into feature/aaa-tacacs-support
2 parents 9e64d28 + df27228 commit 28c67ae

52 files changed

Lines changed: 858 additions & 294 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/checks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
uses: actions/setup-go@v6
3030
with:
3131
check-latest: true
32-
go-version: 1.26.1
32+
go-version: 1.26.2
3333
- name: Run prepare make target
3434
run: make generate
3535
- name: Run golangci-lint

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
uses: actions/setup-go@v6
3333
with:
3434
check-latest: true
35-
go-version: 1.26.1
35+
go-version: 1.26.2
3636
- name: Run prepare make target
3737
run: make generate
3838
- name: Build all binaries
@@ -67,7 +67,7 @@ jobs:
6767
uses: actions/setup-go@v6
6868
with:
6969
check-latest: true
70-
go-version: 1.26.1
70+
go-version: 1.26.2
7171
- name: Run prepare make target
7272
run: make generate
7373
- name: Run tests and generate coverage report

.github/workflows/goreleaser.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: actions/setup-go@v6
2828
with:
2929
check-latest: true
30-
go-version: 1.26.1
30+
go-version: 1.26.2
3131
- name: Run prepare make target
3232
run: make generate
3333
- name: Install syft

.github/workflows/test-chart.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: actions/setup-go@v6
2828
with:
2929
check-latest: true
30-
go-version: 1.26.1
30+
go-version: 1.26.2
3131
- name: Fetch latest kubectl version
3232
id: kubectl
3333
run: |

.github/workflows/test-e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: actions/setup-go@v6
2828
with:
2929
check-latest: true
30-
go-version: 1.26.1
30+
go-version: 1.26.2
3131
- name: Fetch latest kubectl version
3232
id: kubectl
3333
run: |
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
labels:
5+
app.kubernetes.io/managed-by: {{ .Release.Service }}
6+
app.kubernetes.io/name: {{ include "network-operator.name" . }}
7+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
8+
app.kubernetes.io/instance: {{ .Release.Name }}
9+
control-plane: controller-manager
10+
name: {{ include "network-operator.resourceName" (dict "suffix" "controller-manager-tftp-service" "context" $) }}
11+
namespace: {{ .Release.Namespace }}
12+
spec:
13+
ports:
14+
- name: tftp
15+
port: 1069
16+
protocol: UDP
17+
targetPort: 1069
18+
selector:
19+
app.kubernetes.io/name: {{ include "network-operator.name" . }}
20+
control-plane: controller-manager
21+
type: ClusterIP

charts/network-operator/templates/manager/manager.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ spec:
3535
{{- with .Values.manager.nodeSelector }}
3636
nodeSelector: {{ toYaml . | nindent 10 }}
3737
{{- end }}
38+
{{- with .Values.manager.imagePullSecrets }}
39+
imagePullSecrets: {{ toYaml . | nindent 8 }}
40+
{{- end }}
3841
containers:
3942
- args:
4043
{{- if .Values.metrics.enable }}
@@ -54,6 +57,9 @@ spec:
5457
- /manager
5558
image: "{{ .Values.manager.image.repository }}:{{ .Values.manager.image.tag }}"
5659
imagePullPolicy: {{ .Values.manager.image.pullPolicy }}
60+
{{- with .Values.manager.env }}
61+
env: {{ toYaml . | nindent 10 }}
62+
{{- end }}
5763
livenessProbe:
5864
httpGet:
5965
path: /healthz

charts/network-operator/values.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,24 @@ manager:
3434
podSecurityContext:
3535
runAsNonRoot: true
3636
seccompProfile:
37-
type: RuntimeDefault
37+
type: RuntimeDefault
3838

3939
## Container-level security settings
4040
##
4141
securityContext:
4242
allowPrivilegeEscalation: false
4343
capabilities:
44-
drop:
45-
- ALL
44+
drop:
45+
- ALL
4646

4747
## Resource limits and requests
4848
##
4949
resources:
5050
limits:
51-
memory: 512Mi
51+
memory: 512Mi
5252
requests:
53-
cpu: 150m
54-
memory: 256Mi
53+
cpu: 150m
54+
memory: 256Mi
5555

5656
## Manager pod's affinity
5757
##

cmd/main.go

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import (
4848
"github.com/ironcore-dev/network-operator/internal/provider"
4949
"github.com/ironcore-dev/network-operator/internal/provisioning"
5050
"github.com/ironcore-dev/network-operator/internal/resourcelock"
51+
tftpserver "github.com/ironcore-dev/network-operator/internal/tftp"
5152
webhooknxv1alpha1 "github.com/ironcore-dev/network-operator/internal/webhook/cisco/nx/v1alpha1"
5253
webhookv1alpha1 "github.com/ironcore-dev/network-operator/internal/webhook/core/v1alpha1"
5354
// +kubebuilder:scaffold:imports
@@ -81,6 +82,8 @@ func main() {
8182
var watchFilterValue string
8283
var providerName string
8384
var requeueInterval time.Duration
85+
var tftpPort int
86+
var tftpValidateSourceIP bool
8487
var maxConcurrentReconciles int
8588
var lockerNamespace string
8689
var lockerDuration time.Duration
@@ -102,12 +105,14 @@ func main() {
102105
flag.StringVar(&watchFilterValue, "watch-filter", "", fmt.Sprintf("Label value that the controller watches to reconcile api objects. Label key is always %q. If unspecified, the controller watches for all api objects.", v1alpha1.WatchLabel))
103106
flag.StringVar(&providerName, "provider", "openconfig", "The provider to use for the controller. If not specified, the default provider is used. Available providers: "+strings.Join(provider.Providers(), ", "))
104107
flag.DurationVar(&requeueInterval, "requeue-interval", time.Hour, "The interval after which Kubernetes resources should be reconciled again regardless of whether they have changed.")
108+
flag.IntVar(&tftpPort, "tftp-port", 1069, "The port on which the inline TFTP server listens. Set to 0 to disable the TFTP server.")
109+
flag.BoolVar(&tftpValidateSourceIP, "tftp-validate-source-ip", false, "If set, the TFTP server validates the source IP and requested serial-based filename against the same Device.")
105110
flag.IntVar(&maxConcurrentReconciles, "max-concurrent-reconciles", 1, "The maximum number of concurrent reconciles per controller. Defaults to 1.")
106111
flag.StringVar(&lockerNamespace, "locker-namespace", "", "The namespace to use for resource locker coordination. If not specified, uses the namespace the manager is deployed in, or 'default' if undetectable.")
107112
flag.DurationVar(&lockerDuration, "locker-duration", 5*time.Second, "The duration of the resource locker lease.")
108113
flag.DurationVar(&lockerRenewInterval, "locker-renew-interval", time.Second, "The interval at which the resource locker lease is renewed.")
109114
flag.IntVar(&provisioningHTTPPort, "provisioning-http-port", 8080, "The port on which the provisioning HTTP server listens.")
110-
flag.BoolVar(&provisioningHTTPValidateSourceIP, "provisioning-http-validate-source-ip", false, "If set, the provisioning HTTP server will validate the source IP of incoming requests against the DeviceIPLabel of Device resources.")
115+
flag.BoolVar(&provisioningHTTPValidateSourceIP, "provisioning-http-validate-source-ip", false, "If set, the provisioning HTTP server will validate the source IP of incoming requests against Device.spec.endpoint.address.")
111116
opts := zap.Options{
112117
Development: true,
113118
TimeEncoder: zapcore.ISO8601TimeEncoder,
@@ -684,6 +689,22 @@ func main() {
684689
}
685690
}
686691

692+
// Start inline TFTP server when the configured port is non-zero.
693+
if tftpPort != 0 {
694+
tftpAddr := fmt.Sprintf(":%d", tftpPort)
695+
srv, err := tftpserver.New(ctx, tftpAddr, tftpValidateSourceIP, mgr, klog.NewKlogr().WithName("tftp"))
696+
if err != nil {
697+
setupLog.Error(err, "unable to initialize TFTP server")
698+
os.Exit(1)
699+
}
700+
701+
setupLog.Info("Adding inline TFTP server to manager", "address", tftpAddr, "validateSourceIP", tftpValidateSourceIP)
702+
if err := mgr.Add(srv); err != nil {
703+
setupLog.Error(err, "unable to add TFTP server to manager")
704+
os.Exit(1)
705+
}
706+
}
707+
687708
// +kubebuilder:scaffold:builder
688709

689710
if metricsCertWatcher != nil {

config/default/kustomization.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ resources:
2929
- metrics_service.yaml
3030
# [PROVISIONING] Expose the controller manager provisioning service.
3131
- provisioning_service.yaml
32+
# [TFTP] Expose the controller manager TFTP service.
33+
- tftp_service.yaml
3234
# [NETWORK POLICY] Protect the /metrics endpoint and Webhook Server with NetworkPolicy.
3335
# Only Pod(s) running a namespace labeled with 'metrics: enabled' will be able to gather the metrics.
3436
# Only CR(s) which requires webhooks and are applied on namespaces labeled with 'webhooks: enabled' will
@@ -61,6 +63,11 @@ patches:
6163
target:
6264
kind: Deployment
6365

66+
# [TFTP] The following patch will add the TFTP port to the manager container.
67+
- path: manager_tftp_patch.yaml
68+
target:
69+
kind: Deployment
70+
6471
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
6572
# Uncomment the following replacements to add the cert-manager CA injection annotations
6673
replacements:

0 commit comments

Comments
 (0)