Open nabertrand opened 3 days ago
Some global variable names were re-used between the firewall and firewallchain providers. This causes intermittent catalog application failures.
The proposed fix is to prefix all firewall global variables with fw_ and all firewallchain global variables with fwc_.
firewall
fw_
firewallchain
fwc_
For example, if the firewallchain provider code is loaded after the firewall provider code, the $list_command global variable value loses the iptables and ipt6ables keys and values. E.g. https://github.com/puppetlabs/puppetlabs-firewall/blob/810e7fac43d0e752378be56419a87d6339c0aedf/lib/puppet/provider/firewall/firewall.rb#L11-L16 becomes https://github.com/puppetlabs/puppetlabs-firewall/blob/810e7fac43d0e752378be56419a87d6339c0aedf/lib/puppet/provider/firewallchain/firewallchain.rb#L10-L13 Then when the firewall provider tries to process a rule that has the iptables protocol, the provider is unable to lookup the current rules because $list_command['iptables'] is no longer defined.
$list_command
iptables
ipt6ables
$list_command['iptables']
Mention any related issues or pull requests.
puppet apply
Summary
Some global variable names were re-used between the firewall and firewallchain providers. This causes intermittent catalog application failures.
The proposed fix is to prefix all
firewall
global variables withfw_
and allfirewallchain
global variables withfwc_
.Additional Context
For example, if the
firewallchain
provider code is loaded after thefirewall
provider code, the$list_command
global variable value loses theiptables
andipt6ables
keys and values. E.g. https://github.com/puppetlabs/puppetlabs-firewall/blob/810e7fac43d0e752378be56419a87d6339c0aedf/lib/puppet/provider/firewall/firewall.rb#L11-L16 becomes https://github.com/puppetlabs/puppetlabs-firewall/blob/810e7fac43d0e752378be56419a87d6339c0aedf/lib/puppet/provider/firewallchain/firewallchain.rb#L10-L13 Then when thefirewall
provider tries to process a rule that has theiptables
protocol, the provider is unable to lookup the current rules because$list_command['iptables']
is no longer defined.Related Issues (if any)
Mention any related issues or pull requests.
Checklist
puppet apply
)