---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: ack-distro-dependency-installer
  namespace: kube-system
  labels:
    app: ack-distro-dependency-installer
    component: ack-distro-dependency-installer
spec:
  updateStrategy:
    type: RollingUpdate
  selector:
    matchLabels:
      app: ack-distro-dependency-installer
  template:
    metadata:
      labels:
        app: ack-distro-dependency-installer
    spec:
      hostNetwork: true
      hostPID: true
      hostIPC: true
      tolerations:
        - operator: Exists
      containers:
        - name: main
          image: "sea.hub:5000/ecp_builder/open-local-rpms:v0.2-0fb0430"
          command:
            - sh
            - "-c"
            - |
              rm -rf /host-dir/tmp/yoda-rpm
              cp -r /root/rpm /host-dir/tmp/yoda-rpm
              cp -f /root/install-yoda-dependencies.sh /host-dir/tmp/

              chroot /host-dir /bin/bash <<EOF
              set -x
              cd /tmp
              bash install-yoda-dependencies.sh
              EOF
              sleep 99999999
          securityContext:
            runAsUser: 0
            privileged: true
          volumeMounts:
            - name: host-dir
              mountPath: /host-dir
      volumes:
        - name: host-dir
          hostPath:
            path: /
            type: DirectoryOrCreate