-
Notifications
You must be signed in to change notification settings - Fork 230
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
bug 1656086. remove index-patterns with title=$TITLE #1482
bug 1656086. remove index-patterns with title=$TITLE #1482
Conversation
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.
/lgtm
' | ||
} | ||
|
||
response=$(es_util --query='.kibana*/index-pattern/_search?_count?q=title:$TITLE$' ) |
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.
hmm - I get an error because of the double /_search?_count?
- did you mean /_search?_count&q=title:$TITLE$
?
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.
or perhaps just /_search?q=title:$TITLE$
? did you need the _count
in there?
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.
should be response=$(es_util --query='.kibana*/index-pattern/_count?q=title:$TITLE$' )
info "Found ${tot_docs} index-patterns to remove" | ||
|
||
response=$(es_util --query='.kibana*/index-pattern/_delete_by_query' -d '{"query":{"match":{"title":"$TITLE$"}}}') | ||
if [ $(get_deleted $respose) -ne ${tot_docs} ] ; then |
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.
$response
# https://bugzilla.redhat.com/show_bug.cgi?id=1656086 | ||
set -e | ||
|
||
if [ -n "${SDEBUG:-}" ] ; then |
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.
did you mean to use SDEBUG
here?
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.
I did to try and not get all the output from oc but I'll change it
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.
no, that's ok - you can leave it as SDEBUG
|
||
if [ $remaining -ne 0 ] ; then | ||
os::log::error Found index-patterns in response that had 'title' equal to '$TITLE$' | ||
os::log::error "$($cmd -- es_util --query='.kibana*/index-pattern/_search?pretty&_source=false&q=title:$TITLE$')" |
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.
Don't use os::log::error here in case there is a lot of output - instead use artifact_out
to send to the test's artifact log file
$cmd -- es_util --query='.kibana*/index-pattern/_search?pretty&_source=false&q=title:$TITLE$' 2>&1 | artifact_out
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.
also - using python -c
works - but we do have jq
available now in the test environment - several of the other tests use jq
now.
/cherrypick master |
@jcantrill: new pull request created: #1484 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This PR resolves https://bugzilla.redhat.com/show_bug.cgi?id=1656086 by removing index-patterns that have title=$TITLE$
This will need to be cherrypicked to master