-
Notifications
You must be signed in to change notification settings - Fork 28
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: fix inconsistent plan when agent data resources run during apply… #141
fix: fix inconsistent plan when agent data resources run during apply… #141
Conversation
Type: schema.TypeString, | ||
Computed: true, | ||
Description: "The type of agent.", | ||
}, |
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.
Not needed, this gets cleared here: https://github.com/thousandeyes/terraform-provider-thousandeyes/blob/main/thousandeyes/util.go#L164
@@ -54,224 +54,6 @@ var schemas = map[string]*schema.Schema{ | |||
"agent_id": { | |||
Type: schema.TypeInt, | |||
Description: "The unique ID for the ThousandEyes agent.", | |||
Optional: true, |
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.
These fields are not needed, all of them, as they get removed here: https://github.com/thousandeyes/terraform-provider-thousandeyes/blob/main/thousandeyes/util.go#L164
/review @sfreitas-te @brumarqu-te |
@pedro-te i think |
Yeah that's the thing, it seems we never supported it. But we can add this functionality in a different PR for sure. 👍🏻 |
… always.
Addresses:
I can provide an explanation on why this fixes the issue via slack if needed. But essentially, during the apply phase, terraform compares what it had in the plan with what was learned during apply, but it was unable to compare the agents as per the error message:
This is due to the fact that it's trying to match these two, I think:
This is what is present in the test resource
and this is what it learns during the apply for the data resource:
I think all those nulls being compared to the empty strings were causing the issue. Since only
agent_id
matters here, since everything else is removed here https://github.com/thousandeyes/terraform-provider-thousandeyes/blob/main/thousandeyes/util.go#L164 , I removed all other fields, so now onlyagent_id
is compared, which is always set.