puppetlabs / puppetlabs/puppetlabs-postgresql
postgresql::server::config_entry should allow the empty string for `value` parameter
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 232
- Forks
- 610
- Avg merge
- 5d 23h
- Merged PRs (30d)
- 4
Description
Describe the Bug
PostgreSQL supports and allows config entries, such as those in postgresql.conf, to be set to the empty string. The postgresql::server::config_entry defined type, however, requires String[1] when supplying string values. This doesn't allow for the empty string.
Expected Behavior
The postgresql::server::config_entry defined type should allow the empty string for its value parameter.
Steps to Reproduce
A typical use case is setting database-specific parameters that can be empty:
postgresql::server::config_entry { 'my_database.important_parameter':
value => ''
}
This should render as follows in postgresql.conf, which is valid from PostgreSQL's PoV.
my_database.important_parameter = ''
However, the Puppet agent run fails with an error message:
Postgresql::Server::Config_entry[my_database.important_parameter]: parameter 'value' expects a value of type Undef, String[1], Numeric, or Array[String[1]], got String
This is because the empty string is not allowed here.
Environment
- Version 10.3.0
- Platform Ubuntu 20.04, 22.04
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the postgresql::server::config_entry defined type and inspect how its value parameter is declared and rendered. Run the module's relevant tests, then verify that an empty value is accepted and produces the expected PostgreSQL configuration entry.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100