Skip to content

Commit

Permalink
[minor] Simplify handling of ISV groups variable for gitops (#1377)
Browse files Browse the repository at this point in the history
  • Loading branch information
boonware authored Nov 26, 2024
1 parent d91ab90 commit ec2d4db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@
"hashed_secret": "fee2d55ad9a49a95fc89abe8f414dad66704ebfd",
"is_secret": false,
"is_verified": false,
"line_number": 21,
"line_number": 22,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
merge-key: "{{ ACCOUNT_ID }}/{{ CLUSTER_ID }}"

{#- Parses the ISV groups from a string representation of a list of maps #}
{#- Example: isv_groups: "name:'a1',id:'a2'; name:'a3',id:'a4'" #}
{#- Example: "- name: 'admin'\n id: 645001Z1WP\n- name: 'developer'\n id: 645001Z1WR\n" #}
{%- set group_namespace = namespace(isv_groups = []) %}
{%- set group_strs = GROUP_SYNC_OPERATOR_ISV_GROUPS.split(';') %}
{%- set group_strs = GROUP_SYNC_OPERATOR_ISV_GROUPS.split('-') %}
{%- set _ = group_strs.remove('') %}
{%- for group_str in group_strs %}
{%- set group_loop = loop %}
{%- set _ = group_namespace.isv_groups.append(dict()) %}
{%- set pairs = group_str.split(',') %}
{%- set pairs = group_str.strip('\n').split('\n') %}
{%- for pair in pairs %}
{%- set items = pair.split(':') %}
{%- set _ = group_namespace.isv_groups[group_loop.index - 1].__setitem__(items[0].strip().strip("'"), items[1].strip().strip("'")) %}
{%- endfor %}
{%- endfor %}

group_sync_operator:
cron_schedule: "{{ GROUP_SYNC_OPERATOR_CRON_SCHEDULE }}"
isv_tenant_url: "{{ GROUP_SYNC_OPERATOR_ISV_TENANT_URL }}"
Expand Down

0 comments on commit ec2d4db

Please sign in to comment.