Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-1410

Empty resource collectors can break long relationship chains

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Won't Do
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Template:

      Description

      Hi,

      When using chained resources, with a collection within the string, if the collection is empty, the chain is broken and the resources either side do not depend on each other.

      Example:

      test/manifests/init.pp

      class test {
      $cr = ["1", "2"]

      exec

      {"pre": command => "/bin/true" }

      exec

      {"post": command => "/bin/true" }

      test::test{$cr: }

      Exec["pre"]
      -> Exec<| tag == 'inter' |>
      -> Exec["post"]
      }

      test/manifests/test.pp

      define test::test{
      exec

      {"echo $name": command => "/bin/echo $name", tag => "inter" }

      }

      Run as is:

      If we comment out:

      test::test{$cr: }

      So it is empty, we get "empty_collection.jpg", this:

      To get the desired result and what I would have expected as the default, I have to manually add another relationship between "pre" and "post" to cater for the empty collection.

      Exec["pre"]
      -> Exec<| tag == 'inter' |>
      -> Exec["post"]

      Exec["pre"]
      -> Exec["post"]

      Resulting in:

      Is this the intended behaviour? I would expect the workaround relationship to be implicit (Pre -> a collection that happens to be empty -> post), as I do not know how many tags of "inter" will be created (in my real use, this is pulled from hiera)

      Thanks,
      Martin

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                Unassigned
                Reporter:
                redmine.exporter redmine.exporter
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: