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

Implement ODS runbook invocation resource #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lizard-boy
Copy link

No description provided.

Implement nsxt_policy_ods_pre_defined_runbook for ODS runbook framework.

Signed-off-by: Kobi Samoray <[email protected]>
Copy link

@greptile-apps greptile-apps bot left a 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

Comment on lines +54 to +59
if strings.HasPrefix(*objInList.DisplayName, objName) {
prefixMatch = append(prefixMatch, objInList)
}
if *objInList.DisplayName == objName {
perfectMatch = append(perfectMatch, objInList)
}
Copy link

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

Comment on lines +171 to +173
func resourceNsxtPolicyODSRunbookInvocationUpdate(d *schema.ResourceData, m interface{}) error {
return resourceNsxtPolicyODSRunbookInvocationRead(d, m)
}
Copy link

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

Comment on lines +98 to +100
if err == nil {
return err
}
Copy link

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.
Copy link

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.
Copy link

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

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.

2 participants