-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implement ODS runbook invocation resource #7
base: master
Are you sure you want to change the base?
Conversation
Implement nsxt_policy_ods_pre_defined_runbook for ODS runbook framework. Signed-off-by: Kobi Samoray <[email protected]>
Signed-off-by: Kobi Samoray <[email protected]>
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.
PR Summary
This pull request implements ODS (On-Demand Security) runbook functionality in the NSX-T Terraform provider, adding a new data source for pre-defined runbooks and a resource for runbook invocations.
- Added
nsxt_policy_ods_pre_defined_runbook
data source with corresponding test file and documentation - Implemented
nsxt_policy_ods_runbook_invocation
resource with test file and documentation - Updated
provider.go
to include the new data source and resource - Included workaround for a display name bug in the runbook invocation resource
- Added import functionality for the runbook invocation resource
7 file(s) reviewed, 5 comment(s)
Edit PR Review Bot Settings
if strings.HasPrefix(*objInList.DisplayName, objName) { | ||
prefixMatch = append(prefixMatch, objInList) | ||
} | ||
if *objInList.DisplayName == objName { | ||
perfectMatch = append(perfectMatch, objInList) | ||
} |
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.
style: Combine prefix and perfect match checks in a single loop iteration for better efficiency
func resourceNsxtPolicyODSRunbookInvocationUpdate(d *schema.ResourceData, m interface{}) error { | ||
return resourceNsxtPolicyODSRunbookInvocationRead(d, m) | ||
} |
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.
logic: Update operation only performs a read, which may not reflect changes made to the resource
if err == nil { | ||
return err | ||
} |
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.
logic: Error handling logic is incorrect. Should return nil if err is nil, and return the error if it's not nil.
subcategory: "ODS Runbook" | ||
layout: "nsxt" | ||
page_title: "NSXT: policy_ods_pre_defined_runbook" | ||
description: Policy ODS pre-defined runbook data source. |
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.
style: Consider adding a period at the end of the description for consistency.
subcategory: "Beta" | ||
layout: "nsxt" | ||
page_title: "NSXT: nsxt_policy_ods_runbook_invocation" | ||
description: A resource to configure ODS runbook invocation in NSX Policy manager. |
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.
style: Add a period at the end of the description for consistency
No description provided.