-
Notifications
You must be signed in to change notification settings - Fork 78
Relax Terraform provider version re-creation condition #1042
Conversation
For context, I was encountering the error where upgrading an accesslist to v15 required adding
However, when I added the version (
|
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.
I don't know the code well enough to provide relevant feedback, but this has my approval in spirit.
The tests are broken because of the relaxed condition. As this PR is already approved, I wrote a fix in another PR: #1043 |
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.
Just a few wording changes, but otherwise LGTM.
|
||
const ( | ||
DefaultRoleKubeModifierErrSummary = "DefaultRoleKubeResources modifier failed" | ||
DefaultRoleKubeModifierDescription = `This modifier re-render the role.spec.allow.kubernetes_resources from the user provided config instead of using the state. |
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.
s/re-render/re-renders/ or s/re-render/will re-render/
s/user provided/user-provided/
} | ||
allowRaw, ok := spec.Attrs["allow"] | ||
if !ok { | ||
resp.Diagnostics.AddError(DefaultRoleKubeModifierErrSummary, "Failed to get 'spec' from TF object.") |
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.
s/spec/allow/ in error message
bc4fb04
to
81c656c
Compare
I spoke with @r0mant and we don't want to fix the role bug in v15 as this might be breaking for a small amount of users who already had roles upgraded from previous versions before reaching v15). I will push the plan modifier in v16 and skip the broken test for now. |
81c656c
to
5ac9b3c
Compare
Fixes gravitational/teleport#39638
This PR keeps the mandatory version attribute but does not trigger re-creation when it changes like the v14 provider was doing. We might enable re-creation back in a future version.
Relaxing the re-creation is safe on any non-computed field. So basically every resource but the role with kubernetes_resource set.
This change is required because it's blocking people from upgrading to v15. I will investigate other fixes for the roles with Kubernetes resources attrs.