# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2019 Intel Corporation

apiVersion: batch/v1
kind: Job
metadata:
  name: fpga-config-job
spec:
  template:
    spec:
      containers:
      - securityContext:
          privileged: true
        name: fpga-config-utility
        image: fpga-config-utility:1.0
        imagePullPolicy: Never
        command: [ "sudo", "/bin/bash", "-c", "--" ]
        #args: [ "./config_bbdev FPGA_LTE -c /home/fpga-config/fpga/fpga_bbdev.cfg" ]
        args: [ "./config_bbdev FPGA_5GNR -c /home/fpga-config/fpga/fpga_bbdev.cfg" ]
        volumeMounts:
        - name: class
          mountPath: /sys/devices
          readOnly: false
        - name: config-volume
          mountPath: /home/fpga-config/fpga
          readOnly: true
      volumes:
      - hostPath:
          path: "/sys/devices"
        name: class
      - name: config-volume
        configMap:
          name: bbdev-config
          items:
          - key: fpga_bbdev.cfg
            path: fpga_bbdev.cfg
      restartPolicy: Never
      nodeSelector:
        kubernetes.io/hostname: samplehostname 

  backoffLimit: 0
