Jira (BOLT-1363) Singular version of TargetSpec data type
Title: Message Title Alex Dreyer commented on BOLT-1363 Re: Singular version of TargetSpec data type Henrik Lindberg Without fundamentally changing how we interact with targets it's not possible. If I pass in a string 'foo' to a TargetSpec get_targets} could resolve that string to a single target in inventory, a group with any number of targets or a target that is not part of the inventory. We could validate what it resolves to before the plan is called but that plan could update the inventory for example by adding targets to an empty group. Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.311260.1559685174000.34988.1559747401649%40Atlassian.JIRA. For more options, visit https://groups.google.com/d/optout.
Jira (BOLT-1363) Singular version of TargetSpec data type
Title: Message Title Henrik Lindberg commented on BOLT-1363 Re: Singular version of TargetSpec data type Maybe it would be possible to use a constraint to TargetSpec on the number of targets the data type represents, like for Array and Hash data types? IIRC we did add support for type parameters for Object types which is required in order to be able to state something like TargetSpec[1] (exactly one target in the spec) - then if wanted, an alias type `SingleTarget` could be created for that. You still need to call get_targets, but no need to assert the count. Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.311260.1559685174000.34661.1559723760269%40Atlassian.JIRA. For more options, visit https://groups.google.com/d/optout.
Jira (BOLT-1363) Singular version of TargetSpec data type
Title: Message Title Alex Dreyer commented on BOLT-1363 Re: Singular version of TargetSpec data type We can't use a simple type alias for this since a single string may refer to a group that represents multiple targets. For now the best workaround is to call `get_targets` at the top of the plan and verify that it returns a single result. In the future the best solution is for the cli call `get_targets` when a string is passed from the CLI to a `Target` parameter to solve this problem. A `get_target` function that ensures a string refers to a single target may make this easier to use in subplans. Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.311260.1559685174000.34316.1559686620182%40Atlassian.JIRA. For more options, visit https://groups.google.com/d/optout.
Jira (BOLT-1363) Singular version of TargetSpec data type
Title: Message Title Reid Vandewiele created an issue Puppet Task Runner / BOLT-1363 Singular version of TargetSpec data type Issue Type: Improvement Assignee: Unassigned Created: 2019/06/04 2:52 PM Priority: Normal Reporter: Reid Vandewiele TargetSpec accepts a single Variant[String, Target] OR an Array of the same, and is understood to best be treated as if it could refer to multiple endpoints. Sometimes a plan (or task) parameter should accept a single target only. At present, there is no built-in data type to support that. Create and provide such a data type. SingleTargetSpec ? Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)