Uploaded image for project: 'PuppetDB'
  1. PuppetDB
  2. PDB-2862

PQL 'in' modifier doesn't work as advertised

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: PuppetDB
    • Labels:
      None
    • Template:

      Description

      The following query works as expected:

      facts[] { value = "x86_64" }
      

      Returning a bunch of data:

      [{"certname"=>"master.puppet.vm",
        "name"=>"architecture",
        "value"=>"x86_64",
        "environment"=>"production"},
       {"certname"=>"master.puppet.vm",
        "name"=>"hardwaremodel",
        "value"=>"x86_64",
        "environment"=>"production"},
       {"certname"=>"master.puppet.vm",
        "name"=>"hardwareisa",
        "value"=>"x86_64",
        "environment"=>"production"},
       {"certname"=>"node0.puppet.vm",
        "name"=>"architecture",
        "value"=>"x86_64",
        "environment"=>"production"},
      (...)
      

      However a query using "in" that should produce the same result, produces no results:

      facts[] { value in ["x86_64"] }
      

      Result:

      []
      

      This behaviour contradicts the documentation where it says:

      The in operator matches a field, or set of fields against either an array or a subquery.
      The in operator can be used in two ways. The simplest way is to see if a field, contains one of the values provided in a list of literal values:

      nodes { certname in ["foo", "bar", "baz"] }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                dylan.ratcliffe Dylan Ratcliffe
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support