-
Notifications
You must be signed in to change notification settings - Fork 79
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
Add infoblox_zone_delegated resource #217
base: master
Are you sure you want to change the base?
Conversation
…implfy integrations with other providers that only list NS FQDNs
Thank you for creating this resource, this is amazing! |
Is there a blocker for merging this? |
Required: true, | ||
Description: "The FQDN of the delegated zone.", | ||
}, | ||
"delegate_to": resourceNameServer(), |
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.
Why do you move delegate_to
schema definition into a separate function? There's no complex initialization logic involved, and this function is used only here.
extAttrs := make(map[string]interface{}) | ||
if extAttrJSON != "" { | ||
if err := json.Unmarshal([]byte(extAttrJSON), &extAttrs); err != nil { | ||
return fmt.Errorf("cannot process 'ext_attrs' field: %s", err.Error()) |
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 think it's better to wrap the error:
return fmt.Errorf("cannot process 'ext_attrs' field: %s", err.Error()) | |
return fmt.Errorf("cannot process 'ext_attrs' field: %w", err) |
delegatedFQDN, | ||
nameServers) | ||
if err != nil { | ||
return fmt.Errorf("Error creating Zone Delegated: %s", 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.
return fmt.Errorf("Error creating Zone Delegated: %s", err) | |
return fmt.Errorf("Error creating Zone Delegated: %w", err) |
if err != nil { | ||
zoneDelegatedObj, err = objMgr.GetZoneDelegated(d.Id()) | ||
if err != nil { | ||
return fmt.Errorf("Getting Zone Delegated failed: %s", 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.
return fmt.Errorf("Getting Zone Delegated failed: %s", err) | |
return fmt.Errorf("Getting Zone Delegated failed: %w", err) |
extAttrs := make(map[string]interface{}) | ||
if extAttrJSON != "" { | ||
if err := json.Unmarshal([]byte(extAttrJSON), &extAttrs); err != nil { | ||
return fmt.Errorf("cannot process 'ext_attrs' field: %s", err.Error()) |
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.
return fmt.Errorf("cannot process 'ext_attrs' field: %s", err.Error()) | |
return fmt.Errorf("cannot process 'ext_attrs' field: %w", err) |
|
||
zoneDelegatedUpdated, err := objMgr.UpdateZoneDelegated(d.Id(), nameServers) | ||
if err != nil { | ||
return fmt.Errorf("Updating of Zone Delegated failed : %s", err.Error()) |
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.
return fmt.Errorf("Updating of Zone Delegated failed : %s", err.Error()) | |
return fmt.Errorf("Updating of Zone Delegated failed : %w", err) |
extAttrs := make(map[string]interface{}) | ||
if extAttrJSON != "" { | ||
if err := json.Unmarshal([]byte(extAttrJSON), &extAttrs); err != nil { | ||
return fmt.Errorf("cannot process 'ext_attrs' field: %s", err.Error()) |
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.
return fmt.Errorf("cannot process 'ext_attrs' field: %s", err.Error()) | |
return fmt.Errorf("cannot process 'ext_attrs' field: %w", err) |
|
||
_, err := objMgr.DeleteZoneDelegated(d.Id()) | ||
if err != nil { | ||
return fmt.Errorf("Deletion of Zone Delegated failed : %s", 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.
return fmt.Errorf("Deletion of Zone Delegated failed : %s", err) | |
return fmt.Errorf("Deletion of Zone Delegated failed : %w", err) |
Add a new resource to support Zone Delegation
Features:
Caveats: