apiVersion: batch/v1
kind: Job
metadata:
  name: cpsecret
  namespace: cp4i
spec:
  template:
    metadata:
      name: cpsecret
    spec:
      serviceAccountName:  cp4i-job-sa
      containers:
      - name: copysecret
        image: bitnami/kubectl
        command:
         - "bin/bash"
         - "-c"
         - "kubectl get secret ibm-entitlement-key -n openshift-operators -o json | jq -r '.metadata.namespace=\"cp4i\"' | kubectl apply -f -"
      restartPolicy: Never 