-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
emit warning on no liveness probe defined for pods
This patch iterates through pod specs, listing specs with no liveness probes set. Any replication controllers whose deployment is fulfilled by a DeploymentConfig are ignored. **Example** ``` $ oc create -f pkg/api/graph/test/simple-deployment deploymentconfig "simple-deployment" created $ oc get all NAME REVISION DESIRED CURRENT TRIGGERED BY dc/simple-deployment 1 1 0 config NAME DESIRED CURRENT READY AGE rc/simple-deployment-1 0 0 0 1m NAME READY STATUS RESTARTS AGE po/simple-deployment-1-deploy 0/1 ContainerCreating 0 1m $ oc status -v In project test on server https://10.111.123.56:8443 dc/simple-deployment deploys docker.io/openshift/deployment-example:v1 deployment #1 pending 26 seconds ago Warnings: * pod/simple-deployment-1-deploy has no liveness probe to verify pods are still running. try: oc set probe pod/simple-deployment-1-deploy --liveness ... * dc/simple-deployment has no liveness probe to verify pods are still running. try: oc set probe dc/simple-deployment --liveness ... View details with 'oc describe <resource>/<name>' or list everything with 'oc get all'. ```
- Loading branch information
1 parent
8f6030a
commit d24e4a0
Showing
4 changed files
with
130 additions
and
2 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
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,21 @@ | ||
#!/bin/bash | ||
source "$(dirname "${BASH_SOURCE}")/../../hack/lib/init.sh" | ||
trap os::test::junit::reconcile_output EXIT | ||
|
||
# Cleanup cluster resources created by this test | ||
( | ||
set +e | ||
oc delete all,templates --all | ||
exit 0 | ||
) &>/dev/null | ||
|
||
|
||
os::test::junit::declare_suite_start "cmd/set-probe-liveness" | ||
# This test setting a liveness probe, without warning about replication controllers whose deployment depends on deployment configs | ||
os::cmd::expect_success_and_text 'oc create -f pkg/api/graph/test/simple-deployment.yaml' 'deploymentconfig "simple-deployment" created' | ||
os::cmd::expect_success_and_text 'oc status -v' 'dc/simple-deployment has no liveness probe' | ||
os::cmd::expect_success_and_not_text 'oc status -v' 'rc/simple-deployment-1 has no liveness probe' | ||
os::cmd::expect_success_and_text 'oc set probe dc/node --liveness --get-url=http://google.com:80' 'deploymentconfig "simple-deployment" updated' | ||
os::cmd::expect_success_and_not_text 'oc status -v' 'dc/simple-deployment has no liveness probe' | ||
echo "set-probe-liveness: ok" | ||
os::test::junit::declare_suite_end |