-
Notifications
You must be signed in to change notification settings - Fork 4
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 opslevel_service_relationship resource #552
Conversation
@@ -140,6 +140,14 @@ func getDatasourceFilter(validFieldNames []string) schema.SingleNestedBlock { | |||
} | |||
} | |||
|
|||
// Temp wrapper until opslevel-go is updated |
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.
💅 love it!
Id: &service.Id, | ||
Parent: opslevel.NewIdentifier(), | ||
} | ||
_, _ = r.client.UpdateService(svcUpdate) |
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.
shouldn't we handle errors here?
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 is an odd one... Here we know the service exists with the parent matching the state, so if the unsetting the parent fails maybe we just print a TF warning? Throwing an error during delete would be too disruptive.
Also I have TF tests incoming
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.
Ya lets at least raise a warning if for some reason the removal didn't work - silently swallowing errors that might produce infinite plan applies is worse.
if err == nil && (service == nil || string(service.Id) == "") { | ||
err = fmt.Errorf("service %s not found", serviceIdentifier) | ||
} |
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.
😍
Resolves #469
🎗️ Testing relies on this PR
Problem
Solution
Checklist