Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure global variables are unique among providers #1227

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nabertrand
Copy link

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 with fw_ and all firewallchain global variables with fwc_.

Additional Context

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.

$list_command = {
'IPv4' => 'iptables-save',
'iptables' => 'iptables-save',
'IPv6' => 'ip6tables-save',
'ip6tables' => 'ip6tables-save'
}

becomes
$list_command = {
'IPv4' => 'iptables-save',
'IPv6' => 'ip6tables-save'
}

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.

Related Issues (if any)

Mention any related issues or pull requests.

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified. (For example puppet apply)

Some global variable names were re-used between the firewall and firewallchain
providers. This causes intermittent catalog application failures.

Prefix all firewall global variables with 'fw_' and firewallchain global
variables with 'fwc_'.
@nabertrand nabertrand requested a review from a team as a code owner July 2, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant