---
apiVersion: batch/v1
kind: Job
metadata:
  name: createchannelTx
spec:
  backoffLimit: 1
  template:
    metadata:
      name: createchannelTx
    spec:
      restartPolicy: "Never"
      volumes:
      - name: sharedvolume
        persistentVolumeClaim:
          claimName: shared-pvc
      containers:
      - name: createchannelTx
        image: hyperledger/fabric-tools:1.2.1
        imagePullPolicy: Always
        command: ["sh", "-c", "cd /shared && pwd && ls && export FABRIC_CFG_PATH=$PWD && configtxgen -profile FourOrgsChannel -outputCreateChannelTx ${CHANNEL_NAME}.tx -channelID ${CHANNEL_NAME} && touch /shared/status_channeltx_complete "]
        env:
        - name: CHANNEL_NAME
          value: channel1
        - name: GODEBUG
          value: "netdns=go"
        volumeMounts:
        - mountPath: /shared
          name: sharedvolume
