Skip to content

Commit

Permalink
Implement "single_node_cluster" attribute
Browse files Browse the repository at this point in the history
Return a boolean that states if the cluster backup refers to a single
node cluster or not.

The implementation counts the nodes with the number Traefik instances
for backward compatibility.
  • Loading branch information
DavidePrincipi committed Dec 13, 2024
1 parent 84d5b1e commit 7c0ea5e
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ fgz = gzip.open(f'{output_dir}/dump.json.gz', mode='r')
dump = json.loads(fgz.read())
fgz.close()

# HACK! Count the nodes with the Traefik instances
single_node_cluster = len(dump.get('traefik', {})) == 1

result = {
'single_node_cluster': single_node_cluster,
'cluster': dump['cluster']['ui_name'] or '',
'vpn': dump['vpn']['endpoint'],
'domains': len(dump['cluster']['user_domain']['ldap']),
Expand Down

0 comments on commit 7c0ea5e

Please sign in to comment.