Open gtowey opened 6 years ago
@shlomi-noach I can submit a fix for this one, but I would like to get your thoughts on the best way to approach it. I can think of two ways:
orchestrator-client
to handle the null result in Details
fieldIn this case I think #2 is easier, but #1 is the correct way. When using this command I would really like to know why there are zero masters submitted.
There are two valid ways to invoke submit-masters-to-kv-stores/
: with our without a cluster alias. When without alias, orchestrator
will try and submit everything. When with cluster alias, it will only submit KV for that cluster.
I think it's clear that if we submit a single cluster, there must be an error returned when no master is found. The API should return that error; orchestrator-client
should remain relatively stupid.
In the event of multiple clusters, though... I don't see an easy way out. I'd keep the behavior as it is.
Incidentally I took a look yesterday and the fact we got a Details: null
is actually a golang "optimization" (I expected Details
to be an empty array). I've seen this multiple times in the past.
@shlomi-noach maybe we can add a concept of warning output to the response message? So that when you're adding all clusters, those with no valid masters can be flagged as warnings instead of errors and the command can be allowed to run successfully.
Related: https://github.com/github/orchestrator/pull/549, auto-populating KV store.
Related: https://github.com/github/orchestrator/pull/548, a read-only
master is valid for submit-masters-to-kv-stores
.
Getting the error:
This is because the script doesn't handle all the possible outputs of the API call: