Skip to content

Commit

Permalink
Use default {ib-}sriov-cni entrypoint script
Browse files Browse the repository at this point in the history
Avoid overriding entrypoint script for sriov-cni and
ib-sriov-cni. It is more robust to rely on the image logic,
as the source image can change the path where the binary is
stored.

Mount `/etc/os-release` file to let the copy logic to make decision
on which binary it should copy depending on the operating system.

refs:
[1] https://github.com/k8snetworkplumbingwg/sriov-cni/blob/07ecbf9b6ee867054df47423e51a800034ef4e05/images/entrypoint.sh#L63

Signed-off-by: Andrea Panattoni <[email protected]>
  • Loading branch information
zeeke committed May 21, 2024
1 parent 3ca4c3c commit 9f9fcb3
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions bindata/manifests/daemon/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ spec:
initContainers:
- name: sriov-cni
image: {{.SRIOVCNIImage}}
command:
- /bin/sh
- -c
- cp /usr/bin/sriov /host/opt/cni/bin/
args: ["--no-sleep"]
securityContext:
privileged: true
resources:
Expand All @@ -55,12 +52,12 @@ spec:
volumeMounts:
- name: cnibin
mountPath: /host/opt/cni/bin
- name: os-release
mountPath: /host/etc/os-release
readOnly: true
- name: sriov-infiniband-cni
image: {{.SRIOVInfiniBandCNIImage}}
command:
- /bin/sh
- -c
- cp /usr/bin/ib-sriov /host/opt/cni/bin/
args: ["--no-sleep"]
securityContext:
privileged: true
resources:
Expand All @@ -70,6 +67,9 @@ spec:
volumeMounts:
- name: cnibin
mountPath: /host/opt/cni/bin
- name: os-release
mountPath: /host/etc/os-release
readOnly: true
{{- if .UsedSystemdMode}}
- name: sriov-service-copy
image: {{.Image}}
Expand Down Expand Up @@ -130,3 +130,7 @@ spec:
- name: cnibin
hostPath:
path: {{.CNIBinPath}}
- name: os-release
hostPath:
path: /etc/os-release
type: File

0 comments on commit 9f9fcb3

Please sign in to comment.