Jira (PDB-5136) Inventory endpoint regular expression match matches structures

26 views
Skip to first unread message

Jonathan Newman (Jira)

unread,
May 24, 2021, 4:50:02 PM5/24/21
to puppe...@googlegroups.com
Jonathan Newman created an issue
 
PuppetDB / Bug PDB-5136
Inventory endpoint regular expression match matches structures
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2021/05/24 1:49 PM
Priority: Normal Normal
Reporter: Jonathan Newman

If the regular expression match for the inventory endpoint is applied to a fact that is not a leaf, the underlying regular expression is applied to the JSON equivalent of that content.

For example:

inventory[certname] { facts.memory ~ "\"" }

Matches the quotes in the json.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Austin Boyd (Jira)

unread,
May 24, 2021, 4:55:02 PM5/24/21
to puppe...@googlegroups.com
Austin Boyd updated an issue
Change By: Austin Boyd
Zendesk Ticket Count: 1
Zendesk Ticket IDs: 44407

Austin Boyd (Jira)

unread,
May 24, 2021, 4:55:02 PM5/24/21
to puppe...@googlegroups.com

Margaret Lee (Jira)

unread,
May 24, 2021, 5:47:03 PM5/24/21
to puppe...@googlegroups.com
Margaret Lee commented on Bug PDB-5136
 
Re: Inventory endpoint regular expression match matches structures

Carl Caum FYI - this came out of a Fannie Mae escalation. The team thinks this will help with the issue FM is seeing. Jonathan is also looking into other improvements in addition to this. I think this could be good to do to prevent another future escalation.

Bogdan Irimie (Jira)

unread,
Sep 8, 2021, 3:59:03 AM9/8/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Sep 8, 2021, 4:00:16 AM9/8/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Sep 8, 2021, 4:05:02 AM9/8/21
to puppe...@googlegroups.com
Bogdan Irimie commented on Bug PDB-5136
 
Re: Inventory endpoint regular expression match matches structures

If we expose `jsonb_typeof` we should add documentation for it.

Bogdan Irimie (Jira)

unread,
Sep 8, 2021, 4:07:02 AM9/8/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Sep 8, 2021, 8:10:04 AM9/8/21
to puppe...@googlegroups.com
Bogdan Irimie commented on Bug PDB-5136
 
Re: Inventory endpoint regular expression match matches structures

Spoke with Austin Blatt and he provided some examples

{"foo": "bar"}.    node1
{"foo": {"bar": "baz"}     node2

and the query could be

inventory[] { facts.foo ~ "bar" and jsonb_typeof("facts.foo") = "string" }

If such a query would work, we would be able to select only node 1.

Bogdan Irimie (Jira)

unread,
Sep 8, 2021, 8:52:02 AM9/8/21
to puppe...@googlegroups.com

Oana Tanasoiu (Jira)

unread,
Sep 9, 2021, 4:59:02 PM9/9/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Sep 22, 2021, 3:47:03 AM9/22/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-22.09.2021 , ghost-6.10.2021

Bogdan Irimie (Jira)

unread,
Oct 6, 2021, 3:15:02 AM10/6/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-22.09.2021, ghost-6.10.2021 , ghost-20.10.2022

Bogdan Irimie (Jira)

unread,
Oct 6, 2021, 3:22:02 AM10/6/21
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages