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

Policy LB pool: introduce active_monitor_paths attribute (#845) #1039

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

salv-orlando
Copy link
Member

The active_monitor_path supports a single attribute whereas the NSX API allows for multiple monitor paths to be specified.

This PR introduces a list attribute called active_monitor_paths and deprecates active_monitor_path. The two attributes are mutually exclusive.

@vmwclabot
Copy link
Member

@salv-orlando, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@salv-orlando
Copy link
Member Author

/test-all

@salv-orlando
Copy link
Member Author

/test-all

1 similar comment
@salv-orlando
Copy link
Member Author

/test-all

@salv-orlando
Copy link
Member Author

/test-all

1 similar comment
@ksamoray
Copy link
Collaborator

/test-all

@salv-orlando
Copy link
Member Author

/test-all

d.Set("active_monitor_path", obj.ActiveMonitorPaths[0])
}
} else {
// resource uses lists attribute (non-deprecated) or attribute
Copy link
Collaborator

Choose a reason for hiding this comment

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

if active_monitor_path was set before, and was deleted now, would it be nullified in the state?

Copy link
Member Author

Choose a reason for hiding this comment

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

I hope I understand correctly your question.
I think the answer is yes, but I'm not sure if you want the attribute to be cleared or removed from the state.
The attribute is cleared, and I've also added a check in acceptance tests to verify that.

Resource change:

  # nsxt_policy_lb_pool.test will be updated in-place
  ~ resource "nsxt_policy_lb_pool" "test" {
      - active_monitor_path      = "/infra/lb-monitor-profiles/default-http-lb-monitor" -> null
      + active_monitor_paths     = [
          + "/infra/lb-monitor-profiles/default-http-lb-monitor",
          + "/infra/lb-monitor-profiles/default-icmp-lb-monitor",
        ]
        id                       = "c756df01-a22f-48e9-95a3-4dd0d9e7cfd9"
        # (9 unchanged attributes hidden)

        # (4 unchanged blocks hidden)
    }

State after change:

"instances": [
        {
          "schema_version": 0,
          "attributes": {
            "active_monitor_path": "",
            "active_monitor_paths": [
              "/infra/lb-monitor-profiles/default-http-lb-monitor",
              "/infra/lb-monitor-profiles/default-icmp-lb-monitor"
            ],
            "algorithm": "IP_HASH",
            "description": "yyy",
            "display_name": "xxx",
[...]

The active_monitor_path supports a single attribute whereas
the NSX API allows for multiple monitor paths to be specified.

This commit introduces a list attribute called active_monitor_paths
and deprecates active_monitor_path. The two attributes are
mutually exclusive.

Signed-off-by: Salvatore Orlando <sorlando@vmware.com>
@salv-orlando
Copy link
Member Author

/test-all

@salv-orlando salv-orlando merged commit e9cf9cf into vmware:master Dec 4, 2023
5 checks passed
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.

None yet

4 participants