Skip to content

Commit a5d73c4

Browse files
committed
fix: remove duplicate register var and fix anchorpeer chart
Signed-off-by: Sownak Roy <[email protected]>
1 parent 1e2dea7 commit a5d73c4

File tree

17 files changed

+34
-96
lines changed

17 files changed

+34
-96
lines changed

platforms/hyperledger-fabric/charts/fabric-channel-join/templates/anchorpeer.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,24 +176,24 @@ spec:
176176
configtxlator proto_decode --input config_block.pb --type common.Block --output config_block.json
177177
jq .data.data[0].payload.data.config config_block.json >"${CORE_PEER_LOCALMSPID}config.json"
178178
179-
CHECK_ANCHOR=$(jq '.channel_group.groups.Application.groups.'${CORE_PEER_LOCALMSPID}'.values.AnchorPeers.value.anchor_peers' ${CORE_PEER_LOCALMSPID}config.json)
179+
CHECK_ANCHOR=$(jq '.channel_group.groups.Application.groups."'${CORE_PEER_LOCALMSPID}'".values.AnchorPeers.value.anchor_peers' ${CORE_PEER_LOCALMSPID}config.json)
180180
181181
PORT="${CORE_PEER_ADDRESS##*:}"
182182
HOST="${CORE_PEER_ADDRESS%%:*}"
183183
if echo "$CHECK_ANCHOR" | grep -q "$HOST"; then
184184
echo "The anchopeer has already been created"
185185
else
186-
jq '.channel_group.groups.Application.groups.'${CORE_PEER_LOCALMSPID}'.values += {"AnchorPeers":{"mod_policy": "Admins","value":{"anchor_peers": [{"host": "'$HOST'","port": '$PORT'}]},"version": "0"}}' ${CORE_PEER_LOCALMSPID}config.json > ${CORE_PEER_LOCALMSPID}modified_config.json
186+
jq '.channel_group.groups.Application.groups."'${CORE_PEER_LOCALMSPID}'".values += {"AnchorPeers":{"mod_policy": "Admins","value":{"anchor_peers": [{"host": "'$HOST'","port": '$PORT'}]},"version": "0"}}' ${CORE_PEER_LOCALMSPID}config.json > ${CORE_PEER_LOCALMSPID}modified_config.json
187187
188188
configtxlator proto_encode --input "${CORE_PEER_LOCALMSPID}config.json" --type common.Config --output original_config.pb
189189
configtxlator proto_encode --input "${CORE_PEER_LOCALMSPID}modified_config.json" --type common.Config --output modified_config.pb
190190
configtxlator compute_update --channel_id "${CHANNEL_NAME}" --original original_config.pb --updated modified_config.pb --output config_update.pb
191191
configtxlator proto_decode --input config_update.pb --type common.ConfigUpdate --output config_update.json
192-
echo '{"payload":{"header":{"channel_header":{"channel_id":"'$CHANNEL_NAME'", "type":2}},"data":{"config_update":'$(cat config_update.json)'}}}' | jq . >config_update_in_envelope.json
192+
echo '{"payload":{"header":{"channel_header":{"channel_id":"'$CHANNEL_NAME'", "type":2}},"data":{"config_update":'$(cat config_update.json)'}}}' | jq . > config_update_in_envelope.json
193193
configtxlator proto_encode --input config_update_in_envelope.json --type common.Envelope --output "${CORE_PEER_LOCALMSPID}anchors.tx"
194194
195195
peer channel update -o ${ORDERER_URL} -c ${CHANNEL_NAME} -f ${CORE_PEER_LOCALMSPID}anchors.tx --tls --cafile ${ORDERER_CA}
196-
fi
196+
fi
197197
else
198198
echo "Updating anchor peer for the channel ${CHANNEL_NAME}"
199199
tls_status=${CORE_PEER_TLS_ENABLED}

platforms/hyperledger-fabric/configuration/roles/create/peers/tasks/nested_main.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858

5959
- name: Get information about StorageClasses
6060
kubernetes.core.k8s_info:
61+
kubeconfig: "{{ kubernetes.config_file }}"
6162
kind: StorageClass
6263
api_version: storage.k8s.io/v1
6364
namespace: default

platforms/hyperledger-fabric/configuration/roles/delete/vault_secrets/meta/main.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,3 @@ dependencies:
1212
os: "{{ install_os }}"
1313
arch: "{{ install_arch }}"
1414
bin_directory: "{{ bin_install_dir }}"
15-
- role: "{{playbook_dir}}/../../shared/configuration/roles/setup/aws-auth"
16-
vars:
17-
aws_authenticator:
18-
os: "{{ install_os }}"
19-
arch: "{{ install_arch }}"
20-
bin_directory: "{{ bin_install_dir }}"
21-
kubeconfig_path: "{{ item.k8s.config_file }}"
22-
kubecontext: "{{ item.k8s.context }}"
23-
when: "item.cloud_provider == 'aws'"

platforms/shared/configuration/roles/check/helm_component/tasks/main.yaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@
2323
context: "{{ kubernetes.context }}"
2424
label_selectors:
2525
- "app = {{ component_name }}"
26-
register: component_data
26+
register: job_data
2727
retries: "{{ network.env.retry_count }}"
2828
delay: 30
29-
until: component_data.resources|length > 0 and ((component_data.resources[0].status.phase is defined and component_data.resources[0].status.phase == "Succeeded") or (component_data.resources[0].status.succeeded is defined and component_data.resources[0].status.succeeded == 1))
29+
until: job_data.resources|length > 0 and ((job_data.resources[0].status.phase is defined and job_data.resources[0].status.phase == "Succeeded") or (job_data.resources[0].status.succeeded is defined and job_data.resources[0].status.succeeded == 1))
3030
when: component_type == "Job"
31-
register: job_retry_result
3231

3332
# Output debug message if Job creation fails after retries
3433
- name: Debug information for job {{ component_name }} failure
@@ -43,7 +42,7 @@
4342
Run 'kubectl describe job -n {{ namespace }} -l app={{ component_name }}' for more details.
4443
when:
4544
- component_type == "Job"
46-
- job_retry_result.failed is defined and job_retry_result.failed
45+
- job_data.failed is defined and job_data.failed
4746

4847
# one time job check and registers the result variable
4948
- name: "Check for job {{ component_name }} in {{ namespace }}"
@@ -80,7 +79,6 @@
8079
delay: "{{ delay | default(30) }}"
8180
until: component_data.resources|length > 0
8281
when: component_type == "Pod"
83-
register: pod_retry_result
8482

8583
# Output debug message if Pod creation fails after retries
8684
- name: Debug information for pod {{ component_name }} failure
@@ -95,14 +93,14 @@
9593
Run 'kubectl describe pod -n {{ namespace }} -l {{ label_selectors | join(",") }}' for detailed events.
9694
when:
9795
- component_type == "Pod"
98-
- pod_retry_result.failed is defined and pod_retry_result.failed
96+
- component_data.failed is defined and component_data.failed
9997

10098
# Print a warning message if job is still running/pending after retries but not failed
10199
- name: Status update for job {{ component_name }}
102100
debug:
103101
msg: "Job {{ component_name }} in namespace {{ namespace }} is still running or pending. Consider increasing retry_count or checking for issues in the job configuration."
104102
when:
105103
- component_type == "Job"
106-
- job_retry_result.failed is not defined or not job_retry_result.failed
107-
- component_data.resources|length > 0
108-
- (component_data.resources[0].status.phase is not defined or component_data.resources[0].status.phase != "Succeeded") and (component_data.resources[0].status.succeeded is not defined or component_data.resources[0].status.succeeded != 1)
104+
- job_data.failed is not defined or not job_data.failed
105+
- job_data.resources|length > 0
106+
- (job_data.resources[0].status.phase is not defined or job_data.resources[0].status.phase != "Succeeded") and (job_data.resources[0].status.succeeded is not defined or job_data.resources[0].status.succeeded != 1)

platforms/shared/configuration/roles/check/k8_component/tasks/main.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
when:
4444
- component_type == "Namespace" or component_type == "ClusterRoleBinding" or component_type == "StorageClass"
4545
- type is undefined or type == "retry"
46-
register: retry_result
4746

4847
# Output debug message if component creation fails after retries
4948
- name: Debug information for {{ component_type }} {{ component_name }} failure
@@ -58,7 +57,7 @@
5857
when:
5958
- component_type == "Namespace" or component_type == "ClusterRoleBinding" or component_type == "StorageClass"
6059
- type is undefined or type == "retry"
61-
- retry_result.failed is defined and retry_result.failed
60+
- component_data.failed is defined and component_data.failed
6261

6362
# Task to check if ServiceAccount is created
6463
# This task will try for a maximum number of iterations defined in env.retry_count of network.yaml with an interval of
@@ -94,7 +93,6 @@
9493
delay: 35
9594
until: component_data.resources|length > 0
9695
when: (component_type == "ServiceAccount" and (type is undefined or type == 'retry'))
97-
register: sa_retry_result
9896

9997
# Output debug message if ServiceAccount creation fails after retries
10098
- name: Debug information for {{ component_type }} {{ component_name }} failure
@@ -108,4 +106,4 @@
108106
Check the Kubernetes events and logs for more details.
109107
when:
110108
- component_type == "ServiceAccount" and (type is undefined or type == 'retry')
111-
- sa_retry_result.failed is defined and sa_retry_result.failed
109+
- component_data.failed is defined and component_data.failed

platforms/shared/configuration/roles/check/setup/tasks/main.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
delay: 30
6767
until: vault_result.failed == False
6868
when: check == "crypto_materials"
69-
register: vault_retry_result
7069

7170
# Output debug message if vault operation fails after retries
7271
- name: Debug information for vault failure
@@ -81,15 +80,15 @@
8180
Verify Vault status with 'vault status' and check that the crypto generation process completed successfully.
8281
when:
8382
- check == "crypto_materials"
84-
- vault_retry_result.failed is defined and vault_retry_result.failed
83+
- vault_result.failed is defined and vault_result.failed
8584

8685
# Log success message when crypto materials are found
8786
- name: Log successful crypto materials check
8887
debug:
8988
msg: "Successfully found crypto materials at {{ vault_path }} in Vault."
9089
when:
9190
- check == "crypto_materials"
92-
- vault_retry_result.failed is not defined or not vault_retry_result.failed
91+
- vault_result.failed is not defined or not vault_result.failed
9392

9493
# This task check if certs exists in vault.
9594
- name: check if certs exists in vault.

platforms/shared/configuration/roles/create/job_component/tasks/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
- "{{ values_dir }}/{{ component_name }}.yaml"
4646
force: true
4747
wait: true
48-
update_repo_cache: true
48+
update_repo_cache: false
4949
kubeconfig: "{{ kubernetes.config_file }}"
5050
when:
5151
- helm_check.status is not defined

platforms/shared/configuration/roles/create/job_component/vars/main.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ charts:
2727
osn_create_channel_job: fabric-osnadmin-channel-create
2828
create_channel_job: fabric-channel-create
2929
join_channel_job: fabric-channel-join
30-
bevel_alpine_version: latest
31-
fabric_tools_image: bevel-fabric-tools
3230
indy_genesis: indy-genesis
3331
indy_endorser: indy-register-identity
3432
corda_ent_init: enterprise-init
3533
corda_ent_secondary_init: enterprise-init
3634
corda_ent_cenm: cenm
35+
bevel_alpine_version: latest
36+
fabric_tools_image: bevel-fabric-tools

platforms/shared/configuration/roles/git_push/tasks/main.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
shell: |
3737
cd "{{ GIT_DIR }}"
3838
echo "---------------GIT PUSH---------------"
39-
git config user.email {{ gitops.email }}
40-
git config user.name {{ gitops.username }}
41-
git --git-dir={{ GIT_DIR }}/.git pull
39+
git config --global user.email {{ gitops.email }}
40+
git config --global user.name {{ gitops.username }}
41+
git --git-dir={{ GIT_DIR }}/.git pull https://{{ gitops.username }}:{{ gitops.password }}@{{ gitops.git_repo }}
4242
git --git-dir={{ GIT_DIR }}/.git add -A .
4343
4444
git --git-dir={{ GIT_DIR }}/.git commit -s -m "{{ msg }}" || true

platforms/shared/configuration/roles/setup/edge-stack/meta/main.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@
66

77
---
88
dependencies:
9-
- role: "aws-auth"
10-
vars:
11-
aws_authenticator:
12-
os: "{{ install_os }}"
13-
arch: "{{ install_arch }}"
14-
bin_directory: "{{ bin_install_dir }}"
15-
checksum: ""
16-
kubeconfig_path: "{{ item.k8s.config_file }}"
17-
kubecontext: "{{ item.k8s.context }}"
18-
when: item.cloud_provider == 'aws'
199
- role: "helm"
2010
vars:
2111
helm:

0 commit comments

Comments
 (0)