-
Notifications
You must be signed in to change notification settings - Fork 85
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
Conversation
@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
|
/test-all |
045c5b7
to
e9a878d
Compare
/test-all |
1 similar comment
/test-all |
e9a878d
to
bb564bf
Compare
/test-all |
1 similar comment
/test-all |
bb564bf
to
f94106a
Compare
/test-all |
d.Set("active_monitor_path", obj.ActiveMonitorPaths[0]) | ||
} | ||
} else { | ||
// resource uses lists attribute (non-deprecated) or attribute |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 <[email protected]>
f94106a
to
89edf37
Compare
/test-all |
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.