-
Notifications
You must be signed in to change notification settings - Fork 55
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
feat: add user resource #5
Conversation
41bf6b8
to
b220dbf
Compare
|
||
u := convertResourceDataToUser(d) | ||
|
||
if d.HasChange(userNameKey) { |
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.
For both name and description, check to see if d.Get(userNameKey) returns an empty string and if so set the u.SetDefault("user_name") and u.SetDefault("description") in those cases. This will allow these fields to be unset completely instead of being set to an empty string.
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.
What do you want to set them to if they're an empty string?
fooUserDescriptionUpdate = "foo bar" | ||
) | ||
|
||
var ( |
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.
consider adding a test for updating a field to be unset.
@@ -26,6 +26,7 @@ func New() terraform.ResourceProvider { | |||
ResourcesMap: map[string]*schema.Resource{ | |||
"watchtower_project": resourceProject(), | |||
"watchtower_host_catalog": resourceHostCatalog(), | |||
"watchtower_user": resourceUser(), |
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.
Consider reordering these keys to be sorted lexicographically to make it easier to track down the resources as this list grows larger.
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.
Fixed :)
Adds the user resource.