Move init.sh from configmap to docker image 20/2020/2
authorFerenc Tóth <ferenc.2.toth@nokia.com>
Wed, 20 Nov 2019 15:57:02 +0000 (16:57 +0100)
committerFerenc Tóth <ferenc.2.toth@nokia.com>
Mon, 25 Nov 2019 11:01:58 +0000 (12:01 +0100)
Signed-off-by: Ferenc Tóth <ferenc.2.toth@nokia.com>
Change-Id: Ia26e8ced2b2393715a865c119d8fe9eb3e58ba83

SPECS/infra-charts.spec
infra-charts/templates/sriovdp-ds.yaml
infra-charts/templates/sriovdp-initcm.yaml [deleted file]

index 29216f9..95d601c 100644 (file)
@@ -15,7 +15,7 @@
 %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}
index ca0e889..f581eca 100644 (file)
@@ -59,16 +59,16 @@ spec:
           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:
@@ -82,8 +82,5 @@ spec:
       - name: sriovdp-config
         hostPath:
           path: /etc/pcidp/
-      - name: sriovdp-init
-        configMap:
-          name: sriovdp-initcm
       terminationGracePeriodSeconds: 1
 {{ end }}
diff --git a/infra-charts/templates/sriovdp-initcm.yaml b/infra-charts/templates/sriovdp-initcm.yaml
deleted file mode 100644 (file)
index e8d9aa9..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-{{/*
-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 }}