---
apiVersion: batch/v1
kind: Job
metadata:
  name: updateanchor
spec:
  backoffLimit: 1
  template:
    metadata:
      name: updateanchor
    spec:
      restartPolicy: "Never"
      volumes:
      - name: sharedvolume
        persistentVolumeClaim:
          claimName: shared-pvc
      containers:
      - name: updateanchor1
        image: hyperledger/fabric-peer:1.3.0
        imagePullPolicy: Always
        command: ["sh", "-c", "cd /shared && pwd && ls && peer channel update -o ${ORDERER_URL} -c ${CHANNEL_NAME} -f ./Org1MSPanchors.tx "]
        env:
        - name: CHANNEL_NAME
          value: channel1
        - name: CORE_PEER_NETWORKID
          value: nid1
        - name: ORDERER_URL
          value: blockchain-orderer:31010
        - name: CORE_PEER_ADDRESS
          value: peer0-org1-example-com:30110
        - name: CORE_PEER_LOCALMSPID
          value: Org1MSP
        - name: CORE_PEER_MSPID
          value: Org1MSP
        - name: CORE_LOGGING_LEVEL
          value: debug
        - name: CORE_PEER_MSPCONFIGPATH
          value: /shared/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
        - name: FABRIC_CFG_PATH
          value: /etc/hyperledger/fabric
        - name: GODEBUG
          value: "netdns=go"
        volumeMounts:
        - mountPath: /shared
          name: sharedvolume
