-
Notifications
You must be signed in to change notification settings - Fork 676
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
default forwarding rule in custom resolver issue:115 #3588
Conversation
if d.HasChange(pdnsCRFRDesctiption) || | ||
d.HasChange(pdnsCRFRMatch) || | ||
d.HasChange(pdnsCRFRForwardTo) { | ||
|
||
if des, ok := d.GetOk(pdnsCRFRDesctiption); ok { | ||
frdes := des.(string) | ||
opt.SetDescription(frdes) |
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.
below code is redundant
if de, ok := d.GetOk(pdnsCRFRDesctiption); ok {
frdesc := de.(string)
opt.SetDescription(frdesc)
}
if _, ok := d.GetOk(pdnsCRFRForwardTo); ok {
opt.SetForwardTo(flex.ExpandStringList(d.Get(pdnsCRFRForwardTo).([]interface{})))
}
if ty, ok := d.GetOk(pdnsCRFRType); ok {
crtype := ty.(string)
if strings.ToLower(crtype) != "default" {
if ma, ok := d.GetOk(pdnsCRFRMatch); ok {
frmatch := ma.(string)
opt.SetMatch(frmatch)
}
}
}
And please not use ma
as variable, Kindly use proper names to assign
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.
Removed the redundant code
@@ -85,7 +87,7 @@ func ResourceIBMPrivateDNSForwardingRuleValidator() *validate.ResourceValidator | |||
ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, | |||
Type: validate.TypeString, | |||
Optional: true, | |||
AllowedValues: "hostname, zone", | |||
AllowedValues: "hostname, zone, Default, default", |
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.
Update Docs
and why is it having Default and default?
If that is the case In update function check has to be made on both these strings
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.
Updated the Doc
@@ -133,7 +133,42 @@ func ResourceIBMPrivateDNSCustomResolver() *schema.Resource { | |||
}, | |||
}, | |||
}, | |||
|
|||
pdnsCRForwardRules: { |
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.
Update docs
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.
Updated the Doc
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.
Removed the Hardcode CRN in Test cases
We expect testcase to not have any hardcoded crn.. FYI @MalarvizhiK |
@shivaleelac Hope you have addressed all review comments and it is good to be merged and released. |
@MalarvizhiK yes i have addressed all the review comments |
@@ -68,6 +68,7 @@ Review the argument reference that you can specify for your resource. | |||
- `description` - (Optional, String) Descriptive text of the custom resolver. | |||
- `high_availability` - (Optional, Bool) High Availability is enabled by Default, Need to add two or more locations. | |||
- `locations`- (Optional, Set) The list of locations where this custom resolver is deployed. There is no update for location argument in resolver resource. | |||
- `rule_id` - (String) The rule ID is unique identifier of the custom resolver forwarding rule. |
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.
This rule_id should be in attribute reference inside rules
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.
added in Attribute reference in rules
Output:
terraform show
terrafor update:
terraform show after the updates:
Test case output: