Uploaded image for project: 'Facter'
  1. Facter
  2. FACT-3004

Do not auto promote dotted facts to structured

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: FACT 4.1.0
    • Component/s: None
    • Labels:
    • Template:
    • Team:
      Night's Watch
    • Story Points:
      3
    • Sprint:
      NW - 2021-04-14
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      Changes the way Facter 4 treats dots in fact names, reverting to the same behaviour as Facter 3. This means that by default, any dot in custom or external fact names will be considered as part of the fact name and not a delimiter for structured facts.

      This also adds a global setting `force-dot-resolution` which can be set to enable the conversion of dotted facts to structured.
      Show
      Changes the way Facter 4 treats dots in fact names, reverting to the same behaviour as Facter 3. This means that by default, any dot in custom or external fact names will be considered as part of the fact name and not a delimiter for structured facts. This also adds a global setting `force-dot-resolution` which can be set to enable the conversion of dotted facts to structured.
    • QA Risk Assessment:
      Needs Assessment

      Description

      Facter 4 (up to 4.0.52) provides a way to create structured facts from multiple fact definitions. However, the feature is not compatible with other parts of the Puppet ecosystem and can cause facts to be named differently in Facter 4 than in Facter 2/3.

      In order to avoid changing Puppet manifests, hiera lookups, PE classification rules, dotted custom and external facts should not be automatically promoted to structured facts.

      Treating those facts as structured will still be possible by usging a global facter setting which by default is set to false.

      Eg:

      default behavior

      # custom fact
      Facter.add('a.b.c') do
        setcode { "d" }
      end
       
      # external fact
      a.b.c=d
       
      is represented as { "a.b.c": "d" }
      

      setting true

      # custom fact
      Facter.add('a.b.c') do
        setcode { "d" }
      end
       
      # external fact
      a.b.c=d
       
      is represented as 
      {
        "a": {
          "b": {
            "c": "d"
          }
        }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gheorghe.popescu Gheorghe Popescu
              Reporter:
              gheorghe.popescu Gheorghe Popescu
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support