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

Create numeric and port setting types and update existing port settings

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • PUP 7.0.0
    • None
    • Night's Watch
    • 3
    • NW - 2020-10-28, NW - 2020-11-11
    • Enhancement
    • A new `port` setting type was added, which coerces the given value to an integer, and validates if the value is in the range of 0-65535. Puppet port settings have been updated to use this setting type.
    • Needs Assessment

    Description

      This came up when we wanted to have an interpolated integer as a default value for a setting. Currently it is not possible to do this, as the interpolation has to be wrapped in quotes, so the setting becomes a string instead.

      Puppet has various setting types (array, boolean, enum, ttl, priority, etc.) which can have their own munge logic. We should create a numeric (or integer) setting type which converts passed values to valid numbers (even if they are passed as strings/symbols).

      On top of this, we should have a port setting type which inherits from the numeric setting type. In short, it should call munge on its superclass and then check if the resulting number is valid (between 0 and 65535).

      All port-related settings should be updated afterwards to use the new type (masterport, serverport, ca_port and report_port).

      POC for this functionality (without the numeric setting type): https://github.com/puppetlabs/puppet/pull/8373

      This is considered breaking in a way, as there isn't a consensus on whether the port-related settings should be strings or integers (currently both are accepted).

      Attachments

        Activity

          People

            gabriel.nagy Gabriel Nagy
            gabriel.nagy Gabriel Nagy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support