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

Puppet 3.5.0 introduced a regression in tag filtering for catalog runs

    XMLWordPrintable

Details

    • 3
    • Language 2015-09-30
    • Reviewed
    • Bug Fix
    • Hide
      When filtering on the agent with a qualified tag having multiple name segments using commandline with --tag option, the given was processed by breaking the name a part as if multiple tags had been specified. This could lead to surprising results. Now, this regression is fixed, and the entire given tag is used as is when searching.
      Show
      When filtering on the agent with a qualified tag having multiple name segments using commandline with --tag option, the given was processed by breaking the name a part as if multiple tags had been specified. This could lead to surprising results. Now, this regression is fixed, and the entire given tag is used as is when searching.

    Description

      Puppet 3.5.0 introduced a regression to agent tag filtering where a single tag, --tag foo::bar would be split on the namespace separator :: and expanded to a set of ['foo::bar', 'foo', 'bar'].

      This causes the agent to sync more resources than the user intended when tag filtering is in effect.

      Reproduction Case

      Apply the following test manifest with a tag filter of --tag test::step1:

      # tag_test.pp
       
      class test {
        include test::step1
        include test::step2
      }
       
      class test::step1 {
        file { '/tmp/test1.txt':
          ensure => 'file',
        }
      }
       
      class test::step2 {
        file { '/tmp/test2.txt':
          ensure => 'file',
        }
      }
       
      include test
      

      Outcome

      Both file resources from from the Step1 and Step2 classes are applied:

      # puppet --version
      3.8.0
      # puppet apply tag_test.pp --tags test::step1
       
      Notice: Compiled catalog for poss-head-centos.puppetdebug.vlan in environment production in 0.37 seconds
      Notice: Finished catalog run in 0.01 seconds
      [root@poss-head-centos ZEN-11318]# rm -f /tmp/test*
      [root@poss-head-centos ZEN-11318]# puppet apply tag_test.pp --tags test::step1
      Notice: Compiled catalog for poss-head-centos.puppetdebug.vlan in environment production in 0.41 seconds
      Notice: /Stage[main]/Test::Step2/File[/tmp/test2.txt]/ensure: created
      Notice: /Stage[main]/Test::Step1/File[/tmp/test1.txt]/ensure: created
      Notice: Finished catalog run in 0.02 seconds
      

      Expected Outcome

      Only file resources from the Step1 class are applied. This was the behavior prior to Puppet 3.5:

      # puppet --version
      3.4.3
      # puppet apply tag_test.pp --tags test::step1
       
      Notice: Compiled catalog for poss-head-centos.puppetdebug.vlan in environment production in 0.38 seconds
      Notice: /Stage[main]/Test::Step1/File[/tmp/test1.txt]/ensure: created
      Notice: Finished catalog run in 0.20 seconds
      

      Attachments

        Issue Links

          Activity

            People

              kylo Kylo Ginsberg
              chuck Charlie Sharpsteen
              Eric Thompson Eric Thompson
              Votes:
              3 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support