%define COMPONENT infra-charts
%define RPM_NAME caas-%{COMPONENT}
%define RPM_MAJOR_VERSION 1.0.0
-%define RPM_MINOR_VERSION 45
+%define RPM_MINOR_VERSION 46
Name: %{RPM_NAME}
Version: %{RPM_MAJOR_VERSION}
mountPath: /etc/pcidp/
readOnly: true
initContainers:
- - name: init-sriov
+ - name: init
image: {{ .Values.sriovdp.image_name }}
- command: ['sh', '-c', 'source /init/init.sh']
+ command: ["/usr/local/bin/init.sh"]
volumeMounts:
+ - name: time-mount
+ mountPath: /etc/localtime
+ readOnly: true
- name: sriovdp-config
mountPath: /etc/pcidp/
readOnly: true
- - name: sriovdp-init
- mountPath: /init/
- readOnly: true
volumes:
- name: time-mount
hostPath:
- name: sriovdp-config
hostPath:
path: /etc/pcidp/
- - name: sriovdp-init
- configMap:
- name: sriovdp-initcm
terminationGracePeriodSeconds: 1
{{ end }}
+++ /dev/null
-{{/*
-Copyright 2019 Nokia
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/}}
-{{ if .Values.sriovdp.required }}
----
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: sriovdp-initcm
- namespace: kube-system
- labels:
- app: sriovdp-app
-data:
- init.sh: |-
- while true; do
- date
- rootdevs=`jq -r .resourceList[].rootDevices[] </etc/pcidp/config.json 2>/dev/null`
- if [[ -n "$rootdevs" ]]; then
- cat /etc/pcidp/config.json | jq -r .resourceList[].rootDevices[] | while read pci; do
- vf=`cat /sys/bus/pci/devices/0000:$pci/sriov_numvfs`
- echo "$pci: $vf VFs"
- if [[ -z "$vf" || "$vf" == "0" ]]; then
- echo "No VFs found -> SR-IOV DP cannot be started -> sleep 10"
- sleep 10
- break
- fi
- done
- echo "Every SR-IOV designated PF has VF configured -> SR-IOV DP can be started -> rc=0"
- exit 0
- else
- echo "No SR-IOV designated PF found -> SR-IOV DP cannot be started -> sleep 10"
- sleep 10
- fi
- done
-{{ end }}