From d282feb48a9f6f420bef461bedb4f5336fd3fa18 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 29 Jul 2026 20:19:44 -0700 Subject: [PATCH] helm: name the all-in-one policy after the workload componentName prefixes the release fullname onto the suffix it is given, and the component label already starts with seaweedfs-, so the policy came out as -seaweedfs-seaweedfs-all-in-one. --- k8s/charts/seaweedfs/templates/shared/networkpolicy.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/k8s/charts/seaweedfs/templates/shared/networkpolicy.yaml b/k8s/charts/seaweedfs/templates/shared/networkpolicy.yaml index b4231fb14..91f41bee1 100644 --- a/k8s/charts/seaweedfs/templates/shared/networkpolicy.yaml +++ b/k8s/charts/seaweedfs/templates/shared/networkpolicy.yaml @@ -8,7 +8,8 @@ label. "ports" is everything the workload listens on, taken from the same values the containerPorts are taken from, so a changed port cannot drift out of the policy. "apiserver" marks the workloads that talk to the - Kubernetes API. */}} + Kubernetes API. "name" overrides the object name where the component + label already reads as a full name. */}} {{- $targets := list }} {{- /* allInOne.enabled does not turn the individual components off - their @@ -29,7 +30,7 @@ {{- if .Values.allInOne.sftp.enabled }} {{- $ports = append $ports (.Values.allInOne.sftp.port | default .Values.sftp.port) }} {{- end }} -{{- $targets = append $targets (dict "component" "seaweedfs-all-in-one" "ports" $ports) }} +{{- $targets = append $targets (dict "component" "seaweedfs-all-in-one" "name" "all-in-one" "ports" $ports) }} {{- end }} {{- if .Values.master.enabled }} {{- $ports := list .Values.master.port .Values.master.grpcPort }} @@ -149,7 +150,7 @@ apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: - name: {{ include "seaweedfs.componentName" (list $ $component) }} + name: {{ include "seaweedfs.componentName" (list $ ($target.name | default $component)) }} namespace: {{ $.Release.Namespace }} labels: app.kubernetes.io/name: {{ include "seaweedfs.name" $ | quote }}