Skip to content

Commit

Permalink
add an option to override the network name for snapshot metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasochem committed Nov 29, 2023
1 parent 69240ec commit ddca158
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions charts/tezos/templates/configs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ data:
ROLLING_TARBALL_URL: "{{ .Values.rolling_tarball_url }}"
ARCHIVE_TARBALL_URL: "{{ .Values.archive_tarball_url }}"
PREFER_TARBALLS: "{{ .Values.prefer_tarballs }}"
SNAPSHOT_METADATA_NETWORK_NAME: "{{ .Values.snapshot_metadata_network_name }}"
SNAPSHOT_SOURCE: "{{ .Values.snapshot_source }}"
OCTEZ_VERSION: "{{ .Values.images.octez }}"
NODE_GLOBALS: |
Expand Down
4 changes: 4 additions & 0 deletions charts/tezos/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,10 @@ snapshot_source: https://xtz-shots.io/tezos-snapshots.json
# If you prefer tarballs, set to "true" below.
prefer_tarballs: false

# In case the network name in the snapshot metadata does not correspond to the
# network_name configured in `node_config_network`, hardcode the value here.
# snapshot_metadata_network_name: "mondaynet"

# By default, tezos-k8s will attempt to download the right artifact from
# `snapshot_source` set above. You can override and hard-code a snapshot URL
# source below. When any of the below variables are set, `snapshot_source` above
Expand Down
1 change: 1 addition & 0 deletions test/charts/mainnet2.expect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ data:
ROLLING_TARBALL_URL: ""
ARCHIVE_TARBALL_URL: ""
PREFER_TARBALLS: "false"
SNAPSHOT_METADATA_NETWORK_NAME: ""
SNAPSHOT_SOURCE: "https://xtz-shots.io/tezos-snapshots.json"
OCTEZ_VERSION: "tezos/tezos:v17.3"
NODE_GLOBALS: |
Expand Down
5 changes: 4 additions & 1 deletion utils/config-generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,10 @@ def create_node_config_json(
def create_node_snapshot_config_json(history_mode):
"""Create this node's snapshot config"""

network_name = NETWORK_CONFIG.get("chain_name")
if os.environ.get("SNAPSHOT_METADATA_NETWORK_NAME"):
network_name = os.environ.get("SNAPSHOT_METADATA_NETWORK_NAME")
else:
network_name = NETWORK_CONFIG.get("chain_name")
prefer_tarballs = os.environ.get("PREFER_TARBALLS", "").lower() in (
"true",
"1",
Expand Down

0 comments on commit ddca158

Please sign in to comment.