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

Fix resource Read inconsistencies #201

Closed
yannickstruyf3 opened this issue Nov 25, 2020 · 0 comments · Fixed by #203
Closed

Fix resource Read inconsistencies #201

yannickstruyf3 opened this issue Nov 25, 2020 · 0 comments · Fixed by #203

Comments

@yannickstruyf3
Copy link
Collaborator

The Read function of some (for example nutanix_category_key and nutanix_category_value ) resources incorrectly use following code block:

	if err != nil {
		if strings.Contains(fmt.Sprint(err), "ENTITY_NOT_FOUND") {
			d.SetId("")
                         /////////
                        // Requires return nil
                        /////////
		}
		return err
	}

Without return nil in case the entity is not found, terraform will throw an error in case the resource is deleted without terraform intervention (for example deletion via UI or manual API call).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant