Jira (PUP-8921) Resource collection can't be done on Abstract Resources

4 views
Skip to first unread message

Brian Vanderbusch (JIRA)

unread,
Jun 9, 2018, 3:42:02 PM6/9/18
to puppe...@googlegroups.com
Brian Vanderbusch created an issue
 
Puppet / Bug PUP-8921
Resource collection can't be done on Abstract Resources
Issue Type: Bug Bug
Assignee: Unassigned
Components: Compiler
Created: 2018/06/09 12:41 PM
Priority: Normal Normal
Reporter: Brian Vanderbusch

It is currently not possible to collect resources using an abstract resource collector.  There are two way that you can attempt to collect an abstract resource, and they both fail with compiler errors:

```
Resource[$type] <| tag == 'some_tag' |> -> Package['some_package']
```
This fails with a syntax error `Could not parse for environment root: Illegal expression. A '[]' expression is unacceptable as type name in a Virtual Query`.

I also tried:

```
Resource <| tag == 'some_tag' |> -> Package['some_package']
```

This causes an error: 

```
Puppet::PreformattedError:
Evaluation Error: Error while evaluating a Virtual Query, Resource type resource doesn't exist
```

The example code I used that prompted this finding is here:

class gitlab::omnibus_package_repository (
  Hash $repository_configuration,
  Boolean $manage_omnibus_repository,
) {
  if $manage_omnibus_repository {
    $repository_configuration.each() | String $resource_type, Hash $resources | {
      create_resources($resource_type, $resources, {tag => 'gitlab_omnibus_repository_resource'})
    }
 
    # ensure all repository configuration are in place before the gitlab omnibus package is installed
    Resource <| tag == 'gitlab_omnibus_repository_resource' |> -> Package['gitlab-omnibus']
  }
}

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Henrik Lindberg (JIRA)

unread,
Jun 10, 2018, 5:10:02 PM6/10/18
to puppe...@googlegroups.com
Henrik Lindberg commented on Bug PUP-8921
 
Re: Resource collection can't be done on Abstract Resources

Brian Vanderbusch Do you know if this is a regression and if so do you know of a version where this worked?

The Syntax Error A '[]' expression is unacceptable as type name in a Virtual Query is easily fixed so that it would work, but I don't think it was ever possible to query across all resource types because older versions of Puppet did not have anything that represented the abstract type Resource.

Jorie Tappa (JIRA)

unread,
Jun 18, 2018, 5:04:03 PM6/18/18
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Dec 3, 2018, 1:49:03 PM12/3/18
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jun 11, 2021, 10:19:01 PM6/11/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-8921
 
Re: Resource collection can't be done on Abstract Resources

This hasn't been updated in many years, so I'm going to close it. Please reopen if this is still an issue.

This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages