Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 1 | {{/* |
| 2 | Copyright 2019-present Open Networking Foundation |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | */}} |
| 16 | |
| 17 | {{- $name := .Values.conf.ue.name }} |
| 18 | --- |
| 19 | apiVersion: batch/v1 |
| 20 | kind: Job |
| 21 | metadata: |
| 22 | name: {{ $name }}-teardown-if |
| 23 | labels: |
| 24 | app: {{ $name }} |
| 25 | annotations: |
| 26 | "helm.sh/hook": post-delete |
| 27 | "helm.sh/hook-delete-policy": hook-succeeded |
| 28 | spec: |
| 29 | template: |
| 30 | metadata: |
| 31 | labels: |
| 32 | app: {{ $name }} |
| 33 | spec: |
| 34 | restartPolicy: Never |
| 35 | containers: |
| 36 | - name: ue-teardown-if-job |
| 37 | image: {{ .Values.images.tags.ue | quote }} |
| 38 | securityContext: |
| 39 | privileged: true |
| 40 | runAsUser: 0 |
| 41 | command: ["bash", "-xc"] |
| 42 | args: |
| 43 | - if chroot /mnt/host-rootfs lsmod | grep -q ue_ip;then chroot /mnt/host-rootfs rmmod ue_ip;fi |
| 44 | volumeMounts: |
| 45 | - name: host-rootfs |
| 46 | mountPath: /mnt/host-rootfs |
| 47 | volumes: |
| 48 | - name: host-rootfs |
| 49 | hostPath: |
| 50 | path: / |