fixes for bug npa-1706 and npa-1705#469
Open
AnilGadiyarHJ wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates MemberResource.ValidateConfig to add additional plan-time validation for HA-on-cloud settings, HA node count, LAN/HA port settings, and IPv6 MGMT network settings for nios_grid_member.
Changes:
- Add bidirectional validation between
ha_on_cloud,enable_ha,platform, andha_cloud_platform. - Enforce HA node count rules (
node_infosize) and LAN/HA port setting requirements across nodes when HA is enabled. - Add validation for
v6_mgmt_network_settingrequiringmgmt_port_setting.enabled = trueand required IPv6 fields.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // HA Cloud Platform Validations - bidirectional checks | ||
| if !data.HaCloudPlatform.IsNull() && !data.HaCloudPlatform.IsUnknown() { | ||
| // When ha_cloud_platform is provided, ha_on_cloud must be true | ||
| if data.HaOnCloud.IsNull() && data.HaOnCloud.IsUnknown() && !data.HaOnCloud.ValueBool() { |
Collaborator
There was a problem hiding this comment.
check all suggestion by co-pilot and confirm
Comment on lines
+408
to
+413
| // If enable ha is true, ha_on_cloud must be true | ||
| if !data.EnableHa.IsNull() && !data.EnableHa.IsUnknown() && data.EnableHa.ValueBool() { | ||
| if !data.HaOnCloud.IsNull() && !data.HaOnCloud.IsUnknown() && !data.HaOnCloud.ValueBool() { | ||
| resp.Diagnostics.AddError("Validation Error", "ha_on_cloud must be set to true when enable_ha is true") | ||
| } | ||
| } |
Comment on lines
+439
to
+443
| // Validation: If enable_ha is true, node_info must have exactly 2 elements | ||
| if !data.EnableHa.IsNull() && !data.EnableHa.IsUnknown() && data.EnableHa.ValueBool() { | ||
| if len(nodeInfo) != 2 { | ||
| resp.Diagnostics.AddError("Validation Error", "node_info must contain exactly 2 elements when enable_ha is true") | ||
| } |
vchandrajha
approved these changes
May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
big fixes for
https://infoblox.atlassian.net/browse/NPA-1706
https://infoblox.atlassian.net/browse/NPA-1705
added validate config -
When ha_on_cloud is true, platform is VNIOS, and enable_ha is true, ha_cloud_platform must be set
2. Enable HA Node Count Validation:
When enable_ha is true, node_info must contain exactly 2 elements
3. LAN HA Port Setting Validations:
To set lan_ha_port_setting.mgmt_lan, enable_ha must be true
When enable_ha is true, all nodes must have lan_ha_port_setting with both mgmt_lan and ha_ip_address set
4. V6 MGMT Network Setting Validations:
When v6_mgmt_network_setting is set in node_info, mgmt_port_setting.enabled must be true
When v6_mgmt_network_setting is set, virtual_ip, gateway, cidr_prefix, and enabled (set to true) are all required