From 87f7afe40f317fce3a4682e0ec929f56302a3493 Mon Sep 17 00:00:00 2001 From: adityajoshi12 Date: Sat, 18 Jan 2025 16:43:52 +0530 Subject: [PATCH] support for testing against multiple fabric version Signed-off-by: adityajoshi12 --- .github/workflows/test-kubectl-plugin.yml | 50 ++++++++++++++++------- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test-kubectl-plugin.yml b/.github/workflows/test-kubectl-plugin.yml index fe7c8f45..3af2da57 100644 --- a/.github/workflows/test-kubectl-plugin.yml +++ b/.github/workflows/test-kubectl-plugin.yml @@ -10,6 +10,7 @@ jobs: matrix: go-version: [ 1.23.x ] os: [ ubuntu-latest ] + fabric-version: [ { version: 2.5, peer: 2.5.10, orderer: 2.5.10, ca: 1.5.13 }, { version: 3.0, peer: 3.0.0, orderer: 3.0.0, ca: 1.5.13 } ] runs-on: ${{ matrix.os }} env: IMAGE: hlf-operator @@ -56,8 +57,8 @@ jobs: kubectl create namespace istio-system istioctl operator init - - + + kubectl apply -f - < ./orderer-cert.pem kubectl hlf channelcrd follower create \ @@ -347,6 +350,23 @@ jobs: --secret-key="peer-org1.yaml" kubectl wait --timeout=240s --for=condition=RUNNING fabricfollowerchannels.hlf.kungfusoftware.es --all + - name: create a channel(${{ matrix.fabric-version.version }}) + if: ${{ matrix.fabric-version.version == '3.0' }} + run: | + kubectl hlf channel generate \ + --output=testchannel.block --name=testchannel \ + --organizations Org1MSP --ordererOrganizations OrdererMSP \ + --consensus BFT + - name: Join orderers to channel(${{ matrix.fabric-version.version }}) + if: ${{ matrix.fabric-version.version == '3.0' }} + run: | + kubectl hlf ordnode join --namespace=default --block=testchannel.block \ + --name=ord-node1 --identity=admin-tls-ordservice.yaml + - name: Join peers to channel(${{ matrix.fabric-version.version }}) + if: ${{ matrix.fabric-version.version == '3.0' }} + run: | + kubectl hlf channel join --name=testchannel \ + --config=org1.yaml --user=admin -p=org1-peer0.default - name: Get channel run: | sleep 3 @@ -404,7 +424,7 @@ jobs: run: | sleep 10 echo "waiting for deployment to be ready" - kubectl wait --timeout=240s --for=condition=Available deployment asset --namespace=default + kubectl wait --timeout=240s --for=condition=Available deployment asset --namespace=default kubectl hlf chaincode invoke --config=org1.yaml \ --user=admin --peer=org1-peer0.default \ --chaincode=asset --channel=demo \ @@ -429,7 +449,7 @@ jobs: kubectl get fabricfollowerchannels.hlf.kungfusoftware.es -A -o=custom-columns='NAME:metadata.name,NAMESPACE:metadata.namespace,STATE:status.status,MESSAGE:status.message' kubectl get configmap coredns -n kube-system -o yaml echo "Logs for hlf-operator deployment:" - kubectl logs -l app.kubernetes.io/name=hlf-operator -c manager --tail 2500 + kubectl logs -l app.kubernetes.io/name=hlf-operator -c manager --tail 2500 kubectl get fabricmainchannels -o yaml kubectl get fabricfollowerchannels -o yaml