Jira (PUP-10951) The operator '* =>' in a Virtual Query is not supported.

1 view
Skip to first unread message

Steven Pritchard (Jira)

unread,
Mar 4, 2021, 4:04:02 PM3/4/21
to puppe...@googlegroups.com
Steven Pritchard created an issue
 
Puppet / Bug PUP-10951
The operator '* =>' in a Virtual Query is not supported.
Issue Type: Bug Bug
Affects Versions: PUP 7.4.1
Assignee: Unassigned
Components: Language
Created: 2021/03/04 1:03 PM
Priority: Normal Normal
Reporter: Steven Pritchard

On Puppet 7.4.1, I get "The operator '* =>' in a Virtual Query is not supported." from the following code:

  $services.each |$key, $value| {
    if defined(Service[$key]) {
      Service <| title == $key |> {
        * => $value,
      }
    } else {
      service { $key:
        * => $value,
      }
    }
  }

This seemed to work fine with Puppet 5 and 6.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Steven Pritchard (Jira)

unread,
Mar 9, 2021, 11:31:02 AM3/9/21
to puppe...@googlegroups.com

Steven Pritchard (Jira)

unread,
Mar 9, 2021, 11:34:03 AM3/9/21
to puppe...@googlegroups.com
Steven Pritchard commented on Bug PUP-10951
 
Re: The operator '* =>' in a Virtual Query is not supported.

To clarify, in Puppet 5 and 6 at least, using

Service <| title == $key |> {
  * => $value,
}

would override parameters of the Service resource.

I've attached a module pup_10951.tar.gz with example code and rspec tests that demonstrate the issue. Note that pdk test unit --puppet-version=5 and pdk test unit --puppet-version=6 work fine, but pdk test unit --puppet-version=7 fails with the "The operator '* =>' in a Virtual Query is not supported." error.

Josh Cooper (Jira)

unread,
Mar 9, 2021, 12:43:03 PM3/9/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-10951

@file { '/tmp/file':
  ensure => file,
}
 
$permissions = {
  "mode"  => "0640",
}
 
File <| title == '/tmp/file' |> {
  * => $permissions,
}

$ git bisect bad 7.0.0
$ git bisect good cb8e58ab94
$ git bisect run 'bundle exec puppet apply virt.pp'
running bundle exec puppet apply virt.pp
Bisecting: 74 revisions left to test after this (roughly 6 steps)
[eedb1b57655ec4e728ef640a247f3fac0a39a279] Merge pull request #8337 from ciprianbadescu/PUP-10598/ignore_plugin_errors
running bundle exec puppet apply virt.pp
Bisecting: 36 revisions left to test after this (roughly 5 steps)
[e565c0d86805ef7ae7a1f00d26e0b418ae25e677] Merge pull request #8324 from joshcooper/uncompress_body_main_10661
running bundle exec puppet apply virt.pp
Bisecting: 18 revisions left to test after this (roughly 4 steps)
[a0d37fb48a9ad975c6e7aaf3abd98b106aeaa801] (PUP-10583) Update acceptance after SHA256 digest change
running bundle exec puppet apply virt.pp
Bisecting: 9 revisions left to test after this (roughly 3 steps)
[801c4334a10b6bd3dbe3b461bdb767b5349c4173] (PUP-10653) Remove usage of Dir constants
running bundle exec puppet apply virt.pp
Bisecting: 4 revisions left to test after this (roughly 2 steps)
[20fcd0d5d3d347c1dfb17deab39d326eebed1b76] (PUP-10446) Remove Site, Application, CapabilityMapping models
running bundle exec puppet apply virt.pp
Bisecting: 1 revision left to test after this (roughly 1 step)
[7ef08112c9e2fc29480c6d97446bb9df25bd9c30] (PUP-10446) Remove export & consume metaparameters
running bundle exec puppet apply virt.pp
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[f60097cb15b4ec82f80ef6edee67ee9b424f8470] (PUP-10446) Remove CapabilityFinder
running bundle exec puppet apply virt.pp
f60097cb15b4ec82f80ef6edee67ee9b424f8470 is the first bad commit
commit f60097cb15b4ec82f80ef6edee67ee9b424f8470
Author: Josh Cooper <joshc...@users.noreply.github.com>
Date:   Thu Sep 3 16:40:34 2020 -0700
 
    (PUP-10446) Remove CapabilityFinder
 
    Remove the capability finder that calls out to puppetdb.
 
:040000 040000 d2170aad96152a94ad748d0c26be301678d271f8 258b174fc777750f4d4b5f463e6c18509d4a335b M	lib
:040000 040000 d6dd48b5ed849ed9c69b72b89062f38649aa6d29 fe0a40218c6a7a92ed4e005d069c9611039fe89e M	spec
bisect run success

Josh Cooper (Jira)

unread,
Mar 9, 2021, 12:43:03 PM3/9/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
Fix Version/s: PUP 7.5.0

Josh Cooper (Jira)

unread,
Mar 9, 2021, 1:34:02 PM3/9/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sprint: Platform Core KANBAN

Josh Cooper (Jira)

unread,
Mar 9, 2021, 1:34:02 PM3/9/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-10951
 
Re: The operator '* =>' in a Virtual Query is not supported.

This was broken in https://github.com/puppetlabs/puppet/commit/8bdaaecdce07c943e9ee0fc3ef3deb717450003f#diff-2fddabb7a8e2dc5edd8ca894974fa5082d2ab3aa0992c5752b07283f757e8278R237-R240. The line acceptor.accept(Issues::UNSUPPORTED_OPERATOR_IN_CONTEXT, p, :operator=>'* =>') should have been removed along with when Model::CapabilityMapping.

Josh Cooper (Jira)

unread,
Mar 9, 2021, 1:34:03 PM3/9/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Mar 9, 2021, 1:34:03 PM3/9/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Mar 9, 2021, 1:39:03 PM3/9/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes: Bug Fix
Release Notes Summary: Fixes a regression in 7.x which prevented the splat operator from being used to override resource attributes in a resource collector.

Josh Cooper (Jira)

unread,
Mar 9, 2021, 2:09:02 PM3/9/21
to puppe...@googlegroups.com

Claire Cadman (Jira)

unread,
Mar 10, 2021, 10:22:03 AM3/10/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Mar 10, 2021, 3:15:02 PM3/10/21
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages