Filter by variables lacks resolved variables

Bug #1661226 reported by Sulochan Acharya
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
craton
Fix Released
Critical
Thomas Maddox

Bug Description

Currently filtering by variables like region?vars=a:b lacks the ability to search for resource by resolved vars.

We need a way to include resolved vars in the search path, but allow users to choose if the search should include resolved var, similar to what we do with vars in general with --resolved=true/false

so search might look something similar to:

region?vars=a:b&resolved=true

Changed in craton:
status: New → Confirmed
importance: Undecided → Medium
Jim Baker (jimbaker)
Changed in craton:
milestone: none → v0.1.0
importance: Medium → Critical
Revision history for this message
Jim Baker (jimbaker) wrote :

This impacts being able to use variables for searching, especially in combination at different levels. Should be a straightforward fix.

Revision history for this message
Jim Baker (jimbaker) wrote :

Also by default, I think we should assume resolved=true, much as we do with hosts now.

Jim Baker (jimbaker)
Changed in craton:
assignee: nobody → Jim Baker (jimbaker)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to craton (master)

Fix proposed to branch: master
Review: https://review.openstack.org/440929

Changed in craton:
status: Confirmed → In Progress
Revision history for this message
Jim Baker (jimbaker) wrote :
Changed in craton:
assignee: Jim Baker (jimbaker) → Thomas Maddox (thomas-maddox)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to craton (master)

Reviewed: https://review.openstack.org/440929
Committed: https://git.openstack.org/cgit/openstack/craton/commit/?id=3d0506b69c255571ee6b580f85a0bf6646d7ed21
Submitter: Jenkins
Branch: master

commit 3d0506b69c255571ee6b580f85a0bf6646d7ed21
Author: Jim Baker <email address hidden>
Date: Thu Mar 2 21:56:28 2017 -0700

    Variable search for resources now uses resolved variables.

    Implements a filter addition for vars such that each key-value pair in
    the vars is searched for a possible match, regardless of associated
    resource; then chases the associated resources for the specific
    resource being searched for, thereby implementing the resolution
    algorithm (but in reverse). Finally all such resources are checked to
    see if they intersect with respect to their rooting key-value pairs in
    the original search.

    Examples:

    $ GET v1/hosts?vars=openstack_release:juno

    $ GET v1/hosts?vars=foo:abc,bar:xyz

    To disable this feature in your request, you can supply
    'resolved-values=false', for example:

    $ GET /v1/hosts?vars=foo:bar,baz:zoo&resolved-value=false

    Filter values are not currently encoded for JSON; but this will fixed
    in a subsequent patch that is addressing generalized JSON matching via
    JSON path.

    Change-Id: I1d40d734e60b5563dfb01da05ffb6494ed9a919c
    Closes-bug: 1661226
    Closes-bug: 1669493

Changed in craton:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.