Skip to content

Commit 14d50cf

Browse files
committed
Merge remote-tracking branch 'gitlab/development' into fixes
2 parents c6288b7 + 91daecf commit 14d50cf

File tree

8 files changed

+29
-17
lines changed

8 files changed

+29
-17
lines changed

platforms/hyperledger-fabric/charts/fabric-chaincode-lifecycle/templates/approve_job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ metadata:
1919
annotations:
2020
helm.sh/hook-weight: "-5"
2121
helm.sh/hook: "pre-install,pre-upgrade"
22-
helm.sh/hook-delete-policy: "before-hook-creation,hook-succeeded"
22+
helm.sh/hook-delete-policy: "before-hook-creation"
2323
spec:
2424
backoffLimit: 6
2525
template:

platforms/hyperledger-fabric/charts/fabric-osnadmin-channel-create/templates/osn_create_channel.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,12 @@ spec:
207207
208208
#!/usr/bin/env sh
209209
echo "Format or fetch genesis file..."
210+
210211
if [ $ADD_ORDERER = false ]
211212
then
212213
cat ./genesis/genesis.block.base64 | base64 -d > orderer.genesis.block
213-
else
214+
else
215+
echo "Updating orderer configs..."
214216
peer channel fetch config ${CHANNEL_NAME}_config_block.pb -o ${CORE_PEER_ADDRESS} -c ${CHANNEL_NAME} --tls --cafile ${ORDERER_CA}
215217
fi
216218

platforms/hyperledger-fabric/configuration/approve-new-organization.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@
1919
gather_facts: no
2020
no_log: "{{ no_ansible_log | default(false) }}"
2121
tasks:
22-
23-
# delete build directory
24-
- name: Remove build directory
25-
file:
26-
path: "./build"
27-
state: absent
28-
2922
# Generate script to modify the fetched configuration block
3023
- include_role:
3124
name: "create/new_organization/create_block"

platforms/hyperledger-fabric/configuration/roles/create/new_orderer/create_syschannel_block/templates/syschannel_update_address_script.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ rm -r temp
1717
echo "converting the channel_config_block.pb to channel_config.json using configtxlator and jq"
1818
configtxlator proto_decode --input {{ channel_name }}_config_block.pb --type common.Block | jq .data.data[0].payload.data.config > {{ channel_name }}_config.json
1919
echo "adding new organization crypto material from config.json to the channel_config.json to make channel_modified_config.json"
20-
jq --argjson a "$(cat ./orderer)" '.channel_group.values.OrdererAddresses.value.addresses += $a' {{ channel_name }}_config.json > {{ channel_name }}_modified_config.json
20+
jq --argjson a "$(cat ./orderer)" '.channel_group.groups.Orderer.values.OrdererAddresses.value.addresses += $a' {{ channel_name }}_config.json > {{ channel_name }}_modified_config.json
2121
echo "converting the channel_config.json and channel_modified_config.json to .pb files"
2222
configtxlator proto_encode --input {{ channel_name }}_config.json --type common.Config --output {{ channel_name }}_config.pb
2323
configtxlator proto_encode --input {{ channel_name }}_modified_config.json --type common.Config --output {{ channel_name }}_modified_config.pb

platforms/hyperledger-fabric/configuration/roles/setup/config_block/fetch/tasks/main.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
loop: "{{ participants }}"
2121
loop_control:
2222
loop_var: participant
23-
when: participant.type == 'creator'
23+
when: participant.org_status == 'existing'
2424

2525
# Start the cli, configure and download the configuration block
2626
- name: Call nested_fetch_role for the peer
@@ -37,4 +37,4 @@
3737
loop: "{{ participants }}"
3838
loop_control:
3939
loop_var: participantx
40-
when: participantx.type == 'creator'
40+
when: participantx.org_status == 'existing'

platforms/hyperledger-fabric/configuration/roles/setup/config_block/fetch/tasks/nested_fetch_role.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,14 @@
5050
loop_var: org_new
5151
when: org_new.org_status == 'new'
5252

53+
# Check if channel block0 file exists
54+
- name: Check if the channel_block0_fetched file exists
55+
stat:
56+
path: "./build/{{ channel_name | lower }}_block0_fetched"
57+
register: block0_file
58+
5359
# Fetch the config block from blockchain by executing the create_block.sh script file
54-
# from first peer of creator cli
60+
# from the peer of first approving org
5561
- name: Fetch and copy the configuration block from the blockchain
5662
shell: |
5763
export PEER_CLI=$(KUBECONFIG={{ org.k8s.config_file }} kubectl get po -n {{ org.name }}-net | grep "cli" | head -n 1 | awk '{print $1}')
@@ -62,7 +68,9 @@
6268
KUBECONFIG={{ kubernetes.config_file }} kubectl exec -n {{ org.name }}-net ${PEER_CLI} -- chmod 777 ./create_block.sh
6369
KUBECONFIG={{ kubernetes.config_file }} kubectl exec -n {{ org.name }}-net ${PEER_CLI} -- sh ./create_block.sh
6470
KUBECONFIG={{ kubernetes.config_file }} kubectl cp {{ org.name }}-net/${PEER_CLI}:/opt/gopath/src/github.com/hyperledger/fabric/peer/{{ channel_name | lower }}_update_in_envelope.pb ./build/{{ channel_name | lower}}_config_block.pb
71+
touch ./build/{{ channel_name | lower }}_block0_fetched
6572
environment:
6673
ORDERER_CA: "/opt/gopath/src/github.com/hyperledger/fabric/orderer/tls/orderer.crt"
6774
vars:
6875
kubernetes: "{{ org.k8s }}"
76+
when: not block0_file.stat.exists

platforms/hyperledger-fabric/configuration/roles/setup/config_block/sign_and_update/tasks/nested_update_channel.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@
5454
retries: 5
5555
delay: 10
5656

57+
# Delete the build folder if channel update is successful
58+
- name: Delete the build folder
59+
ansible.builtin.file:
60+
path: ./build
61+
state: absent
62+
when: update_channel is succeeded
63+
5764
# Delete the cli
5865
- name: "Delete cli {{ peer.name }}-{{ participant.name }}-cli"
5966
shell: |

platforms/shared/configuration/roles/create/job_component/templates/osn_create_channel_job.tpl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,16 @@ orderers:
3333
- name: {{ value }}
3434
adminAddress: {{ value }}.{{ component_ns }}:7055
3535
{% endif %}
36+
{% if key == 'ordererAddress' %}
37+
ordererAddress: {{ value }}
38+
{% endif %}
3639
{% endfor %}
3740
{% endfor %}
3841

39-
addOrderer: {{ add_orderer_value }}
40-
41-
{% if add_orderer_value is defined and add_orderer_value is sameas true %}
42+
{% if add_orderer_value is defined and add_orderer_value %}
4243
orderer:
44+
addOrderer: {{ add_orderer_value }}
4345
name: {{ first_orderer.name }}
4446
localMspId: {{ org.name | lower}}MSP
45-
address: {{ existingOrdererAddress }}
47+
ordererAddress: {{ existingOrdererAddress }}
4648
{% endif %}

0 commit comments

Comments
 (0)