This repository has been archived by the owner on Feb 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 136
Use kubectl describe foo name #196
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,12 +25,13 @@ fi | |
|
||
get_lb_ip() { | ||
kubectl --namespace=${USER} get service hello-http-staging \ | ||
-o jsonpath='{.status.loadBalancer.ingress[0].ip}' | ||
-o jsonpath='{.status.loadBalancer.ingress[0].ip}' | ||
} | ||
|
||
# Ensure there is an ip address for hello-http-staging:8080 | ||
apply-lb() { | ||
bazel run examples/hellohttp:staging-service.apply | ||
echo Applying service... | ||
bazel run examples/hellohttp:staging-service.apply | ||
} | ||
|
||
check_msg() { | ||
|
@@ -40,33 +41,35 @@ check_msg() { | |
} | ||
|
||
edit() { | ||
./examples/hellohttp/${LANGUAGE}/edit.sh "$1" | ||
echo Setting $LANGUAGE to "$1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please quote language var. We might want to lint with shellcheck |
||
./examples/hellohttp/${LANGUAGE}/edit.sh "$1" | ||
} | ||
|
||
apply() { | ||
bazel run examples/hellohttp/${LANGUAGE}:staging.apply | ||
echo Applying $LANGUAGE... | ||
bazel run examples/hellohttp/${LANGUAGE}:staging.apply | ||
} | ||
|
||
delete() { | ||
kubectl get all --namespace="${USER}" --selector=app=hello-http-staging | ||
bazel run examples/hellohttp/${LANGUAGE}:staging.describe | ||
bazel run examples/hellohttp/${LANGUAGE}:staging.delete | ||
echo Deleting $LANGUAGE... | ||
kubectl get all --namespace="${USER}" --selector=app=hello-http-staging | ||
bazel run examples/hellohttp/${LANGUAGE}:staging.describe | ||
bazel run examples/hellohttp/${LANGUAGE}:staging.delete | ||
} | ||
|
||
check_bad_substitution() { | ||
echo Checking a bad substitution | ||
if ! bazel run examples/hellohttp:error-on-run; | ||
then | ||
echo "Success, substitution failed." | ||
return | ||
else | ||
echo "Bad substitution should fail!" | ||
exit 1 | ||
fi | ||
echo Checking a bad substitution... | ||
if ! bazel run examples/hellohttp:error-on-run; then | ||
echo "Success, substitution failed." | ||
return 0 | ||
else | ||
echo "Bad substitution should fail!" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I am a grammar critic it could read a tad better, but a nit pick |
||
exit 1 | ||
fi | ||
} | ||
|
||
check_no_images_resolution() { | ||
echo Checking resolution with no images attribute. | ||
echo Checking resolution with no images attribute... | ||
bazel build examples/hellohttp:resolve-external | ||
OUTPUT=$(bazel-bin/examples/hellohttp/resolve-external 2>&1) | ||
echo Checking output: "${OUTPUT}" matches: "/pause@" | ||
|
@@ -83,8 +86,8 @@ while [[ -n "${1:-}" ]]; do | |
LANGUAGE="$1" | ||
shift | ||
|
||
apply | ||
trap "delete" EXIT | ||
apply # apply will handle already created | ||
trap "echo FAILED, cleaning up...; delete" EXIT | ||
sleep 25 | ||
check_msg "" | ||
|
||
|
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 |
---|---|---|
|
@@ -18,66 +18,72 @@ set -e | |
LANGUAGE="$1" | ||
|
||
function get_lb_ip() { | ||
kubectl --namespace=${USER} get service hello-grpc-staging \ | ||
-o jsonpath='{.status.loadBalancer.ingress[0].ip}' | ||
kubectl --namespace=${USER} get service hello-grpc-staging \ | ||
-o jsonpath='{.status.loadBalancer.ingress[0].ip}' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again missing quotes around a bash var |
||
} | ||
|
||
function create() { | ||
bazel build examples/todocontroller/${LANGUAGE}:staging.create | ||
bazel-bin/examples/todocontroller/${LANGUAGE}/staging.create | ||
bazel build examples/todocontroller:example-todo.create | ||
bazel-bin/examples/todocontroller/example-todo.create | ||
echo Creating $LANGUAGE... | ||
bazel build examples/todocontroller/${LANGUAGE}:staging.create | ||
bazel-bin/examples/todocontroller/${LANGUAGE}/staging.create | ||
bazel build examples/todocontroller:example-todo.create | ||
bazel-bin/examples/todocontroller/example-todo.create | ||
} | ||
|
||
function check_msg() { | ||
bazel build examples/todocontroller:example-todo.describe | ||
bazel build examples/todocontroller:example-todo.describe | ||
|
||
OUTPUT=$(./bazel-bin/examples/todocontroller/example-todo.describe) | ||
echo Checking response from service: "${OUTPUT}" matches: "DEMO$1<space>" | ||
echo "${OUTPUT}" | grep "DEMO$1[ ]" | ||
OUTPUT=$(./bazel-bin/examples/todocontroller/example-todo.describe) | ||
echo Checking response from service: "${OUTPUT}" matches: "DEMO$1<space>" | ||
echo "${OUTPUT}" | grep "DEMO$1[ ]" | ||
} | ||
|
||
function edit() { | ||
./examples/todocontroller/${LANGUAGE}/edit.sh "$1" | ||
echo Editing $LANGUAGE to $1... | ||
./examples/todocontroller/${LANGUAGE}/edit.sh "$1" | ||
} | ||
|
||
function update_controller() { | ||
bazel build examples/todocontroller/${LANGUAGE}:controller-deployment.replace | ||
bazel-bin/examples/todocontroller/${LANGUAGE}/controller-deployment.replace | ||
echo Replacing $LANGUAGE controller... | ||
bazel build examples/todocontroller/${LANGUAGE}:controller-deployment.replace | ||
bazel-bin/examples/todocontroller/${LANGUAGE}/controller-deployment.replace | ||
} | ||
|
||
function update_todo() { | ||
bazel build examples/todocontroller:example-todo.replace | ||
bazel-bin/examples/todocontroller/example-todo.replace | ||
echo Replacing example-todo... | ||
bazel build examples/todocontroller:example-todo.replace | ||
bazel-bin/examples/todocontroller/example-todo.replace | ||
} | ||
|
||
function delete() { | ||
bazel run examples/todocontroller/example-todo.describe | ||
bazel run examples/todocontroller/${LANGUAGE}:controller-deployment.describe | ||
|
||
bazel build examples/todocontroller/example-todo.delete | ||
bazel-bin/examples/todocontroller/example-todo.delete | ||
bazel build examples/todocontroller/${LANGUAGE}:staging.delete | ||
bazel-bin/examples/todocontroller/${LANGUAGE}/staging.delete | ||
echo Deleting $LANGUAGE... | ||
bazel run examples/todocontroller/example-todo.describe | ||
bazel run examples/todocontroller/${LANGUAGE}:controller-deployment.describe | ||
|
||
bazel build examples/todocontroller/example-todo.delete | ||
bazel-bin/examples/todocontroller/example-todo.delete | ||
bazel build examples/todocontroller/${LANGUAGE}:staging.delete | ||
bazel-bin/examples/todocontroller/${LANGUAGE}/staging.delete | ||
} | ||
|
||
function check_reverse_delete_k8s_object() { | ||
echo Checking deletion in reverse order via k8s_object. | ||
bazel run examples/todocontroller:joined.apply | ||
bazel run examples/todocontroller:joined.delete | ||
echo Checking deletion in reverse order via k8s_object... | ||
bazel run examples/todocontroller:joined.apply | ||
bazel run examples/todocontroller:joined.delete | ||
} | ||
|
||
function check_reverse_delete_k8s_objects() { | ||
echo Checking deletion in reverse order via k8s_objects. | ||
bazel run examples/todocontroller:everything.apply | ||
bazel run examples/todocontroller:everything.delete | ||
echo Checking deletion in reverse order via k8s_objects... | ||
bazel run examples/todocontroller:everything.apply | ||
bazel run examples/todocontroller:everything.delete | ||
} | ||
|
||
check_reverse_delete_k8s_object | ||
check_reverse_delete_k8s_objects | ||
|
||
delete || true | ||
create | ||
trap "delete" EXIT | ||
trap "echo FAILED, cleaning up...; delete" EXIT | ||
sleep 25 | ||
check_msg | ||
|
||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put quotes around all variables