0

When you try to add a node to an existing cluster of Starcluster, some plugins can fail depending if you are in master or secondary node.

If your plugin has something like:

for node in nodes:
    do something...

when you add a node with

starcluster addnode myexistingcluster

the previous form does not works.

So how would try to differentiate the plugin's operations for master and secondaries nodes.

How can I check if I am in the master from inside the plugin? I tried with the index of nodes list but does not works.

emanuele
  • 2,519
  • 8
  • 38
  • 56

1 Answers1

1

given plugins on_add_node signature

def on_add_node(self, node, nodes, master, user, user_shell, volumes):

You can call

node.is_master()

Finch_Powers
  • 2,938
  • 1
  • 24
  • 34