Skip to content

Commit a9565a5

Browse files
committed
Apply this to all providers and simplify
Modified this to apply to all providers and not just IBM. This makes it the same as what is done in the multus-admission-controller here: https://github.com/openshift/cluster-network-operator/blob/d2415f8884647a4223ad40dcd8c9897ae7dae288/bindata/network/multus-admission-controller/admission-controller.yaml#L264-L267
1 parent c26d985 commit a9565a5

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

bindata/network/ovn-kubernetes/managed/ovnkube-control-plane.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,9 @@ spec:
288288
"{{$key}}": "{{$value}}"
289289
{{ end }}
290290
{{ end }}
291-
{{- if .OVNRunAsUser }}
291+
{{- if .RunAsUser }}
292292
securityContext:
293-
runAsUser: {{.OVNRunAsUser}}
293+
runAsUser: {{.RunAsUser}}
294294
{{- end }}
295295
volumes:
296296
- name: ovnkube-config

pkg/network/ovn_kubernetes.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -255,16 +255,6 @@ func renderOVNKubernetes(conf *operv1.NetworkSpec, bootstrapResult *bootstrap.Bo
255255
} else {
256256
data.Data["OVNPlatformAzure"] = false
257257
}
258-
if bootstrapResult.Infra.PlatformType == configv1.IBMCloudPlatformType { // TODO: Find a way to exclude IPI clusters from this???
259-
// OVN is only supported in IBMCloud on Hypershift clusters, so get RunAsUser from HyperShiftConfig
260-
if bootstrapResult.OVN.OVNKubernetesConfig.HyperShiftConfig.RunAsUser != "" {
261-
data.Data["OVNRunAsUser"] = bootstrapResult.OVN.OVNKubernetesConfig.HyperShiftConfig.RunAsUser
262-
} else {
263-
data.Data["OVNRunAsUser"] = "1001" // We do not want to run this as root, so if nothing is specified, use 1001
264-
}
265-
} else {
266-
data.Data["OVNRunAsUser"] = ""
267-
}
268258

269259
var ippools string
270260
for _, net := range conf.ClusterNetwork {
@@ -430,6 +420,7 @@ func renderOVNKubernetes(conf *operv1.NetworkSpec, bootstrapResult *bootstrap.Bo
430420
productFlavor = "managed"
431421
data.Data["CAConfigMap"] = bootstrapResult.OVN.OVNKubernetesConfig.HyperShiftConfig.CAConfigMap
432422
data.Data["CAConfigMapKey"] = bootstrapResult.OVN.OVNKubernetesConfig.HyperShiftConfig.CAConfigMapKey
423+
data.Data["RunAsUser"] = bootstrapResult.OVN.OVNKubernetesConfig.HyperShiftConfig.RunAsUser
433424
}
434425
manifestSubDir := filepath.Join(manifestDir, "network/ovn-kubernetes", productFlavor)
435426
manifestDirs = append(manifestDirs, manifestSubDir)

0 commit comments

Comments
 (0)