Skip to content
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

Conversation

jcantrill
Copy link
Contributor

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

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 11, 2018
@jcantrill jcantrill added backport/3.11 and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 11, 2018
Copy link
Contributor

@ewolinetz ewolinetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 11, 2018
@openshift-merge-robot openshift-merge-robot merged commit b940144 into openshift:release-3.11 Dec 11, 2018
'
}

response=$(es_util --query='.kibana*/index-pattern/_search?_count?q=title:$TITLE$' )
Copy link
Contributor

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$ ?

Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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$')"
Copy link
Contributor

@richm richm Dec 11, 2018

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

Copy link
Contributor

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.

@jcantrill jcantrill deleted the 1656086_title_in_index_pattern branch December 12, 2018 03:00
@jcantrill
Copy link
Contributor Author

/cherrypick master

@openshift-cherrypick-robot

@jcantrill: new pull request created: #1484

In response to this:

/cherrypick master

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/3.11 lgtm Indicates that a PR is ready to be merged. release/3.11
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants