shell-operator
shell-operator copied to clipboard
Allow executing schedules via debug socket
It may be useful if the commands you can run via the debug sockets include triggering operator to execute what it would normally do on a schedule synchronously at any time.
This would be useful for example for conformance tests to avoid having to wait for a scheduled run to have your system reach the desired state. Sometimes you may also want to execute a schedule immediately to solve some problem where you cannot wait for the scheduled run.
You can already do this now by running the hook and giving it the correct inputs. E.g.:
shell-operator hook snapshot myhook | jq '[{type: \"Schedule\", snapshots: {nodes: .nodes.snapshot, pods: .pods.snapshot}}]' > /tmp/data.json"
BINDING_CONTEXT_PATH=/tmp/data.json /hooks/myhook
But this is somewhat clumsy and needs adapting to each hook, a simple command like shell-operator hook $myhook run-schedule $schedulename
would be convenient.
Alternatively a new dumping command similar to hook snapshot
which would dump the required binding context json of a hook so one can run the hook manually from it without the need to change it would also be sufficient.