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

Add import support for org, folder, billing logging sinks #1860

Merged
merged 1 commit into from
Sep 6, 2018

Conversation

rileykarson
Copy link
Collaborator

Fixes #1494.

  • Add import support for google_logging_organization_sink, google_logging_folder_sink, google_logging_billing_account_sink.

Using StateFunc over DiffSuppressFunc should only affect tests; for some reason TestAccLoggingFolderSink_folderAcceptsFullFolderPath expected a folder value of folders/{{id}} vs expecting {{id}} when only DiffSuppressFunc was used, when in real use DiffSuppressFunc should be sufficient.

Type: schema.TypeString,
Required: true,
ForceNew: true,
StateFunc: func(v interface{}) string {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is a statefunc better than a diff suppress or flattener for this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oops! Just saw this comment now. Like I said in the PR description, this is just some weirdness with one of the tests - it wasn't following the diff suppress and wrongly errored out comparing folder/1234 to 1234, but it played nicely with the StateFunc so I used that instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

(I think this is a function of the importstateverify tests doing a direct comparison of what's in state, meaning diff suppress functions aren't used, but I could be wrong.)

Copy link
Contributor

@paddycarver paddycarver left a comment

Choose a reason for hiding this comment

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

I think at some point we need to resolve the ImportStateVerify problem, but that's not really relevant to or scoped to this PR, so that may be a conversation for another day.

Type: schema.TypeString,
Required: true,
ForceNew: true,
StateFunc: func(v interface{}) string {
Copy link
Contributor

Choose a reason for hiding this comment

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

(I think this is a function of the importstateverify tests doing a direct comparison of what's in state, meaning diff suppress functions aren't used, but I could be wrong.)

@rileykarson rileykarson merged commit 035a581 into hashicorp:master Sep 6, 2018
chrisst pushed a commit to chrisst/terraform-provider-google that referenced this pull request Nov 9, 2018
…1860)

Fixes hashicorp#1494.

* Add import support for `google_logging_organization_sink`, `google_logging_folder_sink`, `google_logging_billing_account_sink`.

Using `StateFunc` over `DiffSuppressFunc` should only affect tests; for some reason `TestAccLoggingFolderSink_folderAcceptsFullFolderPath` expected a `folder` value of `folders/{{id}}` vs expecting `{{id}}` when only `DiffSuppressFunc` was used, when in real use `DiffSuppressFunc` should be sufficient.
@ghost
Copy link

ghost commented Nov 17, 2018

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants