Skip to content

fixes for bug npa-1706 and npa-1705#469

Open
AnilGadiyarHJ wants to merge 2 commits into
infobloxopen:mainfrom
AnilGadiyarHJ:1706
Open

fixes for bug npa-1706 and npa-1705#469
AnilGadiyarHJ wants to merge 2 commits into
infobloxopen:mainfrom
AnilGadiyarHJ:1706

Conversation

@AnilGadiyarHJ

Copy link
Copy Markdown
Collaborator

big fixes for
https://infoblox.atlassian.net/browse/NPA-1706
https://infoblox.atlassian.net/browse/NPA-1705

added validate config -

  1. HA Cloud Platform Validation:

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and ha_cloud_platform.
  • Enforce HA node count rules (node_info size) and LAN/HA port setting requirements across nodes when HA is enabled.
  • Add validation for v6_mgmt_network_setting requiring mgmt_port_setting.enabled = true and 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() {

@vchandrajha vchandrajha May 6, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check all suggestion by co-pilot and confirm

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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")
}
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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")
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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.

3 participants