From 337d297d8e067fd478f132aca25950b4c123e3fa 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 | 55 ++++++++++++++++------- 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test-kubectl-plugin.yml b/.github/workflows/test-kubectl-plugin.yml index fe7c8f45..78a8669f 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,26 @@ jobs: --secret-key="peer-org1.yaml" kubectl wait --timeout=240s --for=condition=RUNNING fabricfollowerchannels.hlf.kungfusoftware.es --all + - name: create a channel Fabric V3.0 + 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 Fabric V3.0 + if: ${{ matrix.fabric-version.version == '3.0' }} + run: | + ls -l + set -x; + kubectl hlf ordnode join --namespace=default --block=testchannel.block \ + --name=ord-node1 --identity=admin-tls-ordservice.yaml + echo "completed" + - name: Join peers to channel Fabric V3.0 + 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 +427,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 +452,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