-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove metrics logic from cmd/anisble-operator/main.go #3466
Merged
bharathi-tenneti
merged 3 commits into
operator-framework:master
from
bharathi-tenneti:ansible-metrics
Jul 21, 2020
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# entries is a list of entries to include in | ||
# release notes and/or the migration guide | ||
entries: | ||
- description: > | ||
Remove legacy metrics generation code. | ||
kind: "removal" | ||
# Is this a breaking change? | ||
breaking: true | ||
migration: | ||
header: Remove legacy metrics generation code from cmd/ansible-operator/main.go, and tests/e2e-anisble.sh checks for servicemonitor. | ||
body: TBD | ||
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 |
---|---|---|
|
@@ -59,37 +59,26 @@ test_operator() { | |
exit 1 | ||
fi | ||
|
||
header_text "verify that metrics service was created" | ||
if ! timeout 60s bash -c -- "until kubectl get service/memcached-operator-metrics > /dev/null 2>&1; do sleep 1; done"; | ||
then | ||
error_text "FAIL: Failed to get metrics service" | ||
operator_logs | ||
exit 1 | ||
fi | ||
# TODO @asmacdo to uncomment once new kb layout is merged. | ||
|
||
header_text "verify that the metrics endpoint exists (Port 8383)" | ||
if ! timeout 1m bash -c -- "until kubectl run --attach --rm --restart=Never test-metrics --image=$metrics_test_image -- curl -sfo /dev/null http://memcached-operator-metrics:8383/metrics; do sleep 1; done"; | ||
then | ||
error_text "FAIL: Failed to verify that metrics endpoint exists" | ||
operator_logs | ||
exit 1 | ||
fi | ||
# header_text "verify that metrics service was created" | ||
# if ! timeout 60s bash -c -- "until kubectl get service/memcached-operator-metrics > /dev/null 2>&1; do sleep 1; done"; | ||
# then | ||
# error_text "FAIL: Failed to get metrics service" | ||
# operator_logs | ||
# exit 1 | ||
# fi | ||
|
||
header_text "verify that the metrics endpoint exists (Port 8686)" | ||
if ! timeout 1m bash -c -- "until kubectl run --attach --rm --restart=Never test-metrics --image=$metrics_test_image -- curl -sfo /dev/null http://memcached-operator-metrics:8686/metrics; do sleep 1; done"; | ||
then | ||
error_text "FAIL: Failed to verify that metrics endpoint exists" | ||
operator_logs | ||
exit 1 | ||
fi | ||
# TODO Add --metrics-addr flag to the ansible operator and default it to 8080. | ||
|
||
# header_text "verify that the metrics endpoint exists (Port 8383)" | ||
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. Add a TODO here to add a See #3440 Once we have an equivalent PR merged for ansible, we'll need to update this port to be 8080. |
||
# if ! timeout 1m bash -c -- "until kubectl run --attach --rm --restart=Never test-metrics --image=$metrics_test_image -- curl -sfo /dev/null http://memcached-operator-metrics:8383/metrics; do sleep 1; done"; | ||
# then | ||
# error_text "FAIL: Failed to verify that metrics endpoint exists" | ||
# operator_logs | ||
# exit 1 | ||
# fi | ||
|
||
header_text "verify that the servicemonitor is created" | ||
if ! timeout 1m bash -c -- "until kubectl get servicemonitors/memcached-operator-metrics > /dev/null 2>&1; do sleep 1; done"; | ||
then | ||
error_text "FAIL: Failed to get service monitor" | ||
operator_logs | ||
exit 1 | ||
fi | ||
|
||
header_text "create custom resource (Memcached CR)" | ||
kubectl create -f deploy/crds/ansible.example.com_v1alpha1_memcached_cr.yaml | ||
|
@@ -136,13 +125,13 @@ test_operator() { | |
fi | ||
|
||
|
||
header_text "verify that metrics reflect cr creation" | ||
if ! timeout 60s bash -c -- "until kubectl run --attach --rm --restart=Never test-metrics --image=$metrics_test_image -- curl -sf http://memcached-operator-metrics:8686/metrics | grep example-memcached; do sleep 1; done"; | ||
then | ||
error_text "FAIL: Failed to verify custom resource metrics" | ||
operator_logs | ||
exit 1 | ||
fi | ||
# header_text "verify that metrics reflect cr creation" | ||
# if ! timeout 60s bash -c -- "until kubectl run --attach --rm --restart=Never test-metrics --image=$metrics_test_image -- curl -sf http://memcached-operator-metrics:8383/metrics | grep example-memcached; do sleep 1; done"; | ||
# then | ||
# error_text "FAIL: Failed to verify custom resource metrics" | ||
# operator_logs | ||
# exit 1 | ||
# fi | ||
|
||
header_text "get memcached deploy by labels" | ||
memcached_deployment=$(kubectl get deployment -l app=memcached -o jsonpath="{..metadata.name}") | ||
|
@@ -197,7 +186,6 @@ cat "$ROOTDIR/test/ansible-memcached/watches-finalizer.yaml" >> memcached-operat | |
# Append Foo kind to watches to test watching multiple Kinds | ||
cat "$ROOTDIR/test/ansible-memcached/watches-foo-kind.yaml" >> memcached-operator/watches.yaml | ||
|
||
install_service_monitor_crd | ||
|
||
pushd memcached-operator | ||
|
||
|
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 was deleted.
Oops, something went wrong.
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.
nit space