forked from openstack-k8s-operators/ovn-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix preStop Hooks for ovn-controller pod containers
preStop Hooks currently fails with:- ovs-ctl: exactly one non-option argument required becaues ";sleep 2" is passed to the stop command which it do not expect. To run additional commands we could use "bash -c" but considering the extra sleep do not help to avoid the "FailedPreStopHook" event just dropping the extra sleep as part of this patch. "FailedPreStopHook" event gets raised even with successful graceful shutdown because container get's killed due to these stop commands. To avoid "FailedPreStopHook" one option is to use wrapper startup script and handle SIGTERM signals, something like revert of [1], but leaving that for later. Also add kuttl test to validate graceful shutdown of ovn-controller by checking SB DB for the chassis. [1] openstack-k8s-operators/ovs-operator#53 Resolves: OSPRH-4553
- Loading branch information
1 parent
d7d87d3
commit d5db655
Showing
4 changed files
with
33 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
# Check for: | ||
# | ||
# - chassis unregistered in sb db | ||
|
||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
timeout: 30 | ||
commands: | ||
- script: | | ||
sb_pod=$(oc get pod -n $NAMESPACE -l service=ovsdbserver-sb -o name|head -1) | ||
oc rsh -n $NAMESPACE ${sb_pod} ovn-sbctl list chassis | grep -q hostname && exit 1 | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: | | ||
oc patch OVNController -n $NAMESPACE ovncontroller-sample --type='json' -p='[{"op": "replace", "path": "/spec/nodeSelector", "value":{"node": "non-existing-node-name"}}]' |