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

grafana_user is importable #125

Merged
merged 1 commit into from
Oct 16, 2020
Merged

grafana_user is importable #125

merged 1 commit into from
Oct 16, 2020

Conversation

trotttrotttrott
Copy link
Member

grafana_user resource supports importability.

func ExistsUser(d *schema.ResourceData, meta interface{}) (bool, error) {
client := meta.(*gapi.Client)
userId, _ := strconv.ParseInt(d.Id(), 10, 64)
_, err := client.User(userId)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took a look at the Grafana client to see if we could compare against specific UserNotFound errors, but it it seems to be a simple HTTP wrapper, so this is fine 👍

@trotttrotttrott trotttrotttrott merged commit 78fc116 into master Oct 16, 2020
@trotttrotttrott trotttrotttrott deleted the user-import branch October 16, 2020 16:14
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.

3 participants