-
Notifications
You must be signed in to change notification settings - Fork 78
Terraform: Correctly handle null/unknown conversion to apitypes.BoolOption #991
base: master
Are you sure you want to change the base?
Conversation
This is how I create bots, this looks like it would break.. but TBH, we break compatibility with terraform all the time.
|
This does result in a breaking change - values that are unset would have previously been set to false. Following this PR, they will be set to null or to a configured default (which may be true) I'll discuss with some folks and figure out if we want to move forward with this breaking change. |
Conversation with Zac suggests proceeding with this as a breaking change in V15, we'll wait to merge this before v15 is cut. |
I agree that we must fix this, TF cannot pick random defaults different than Teleport ones. This change will affect some fields in Roles, which is potentially dangerous for our customers. I think we should not backport it in v14, list all affected fields in the changelog and PR, and put a big flashing warning in v15 changelog. TF users will need to fix their code before updating. |
Yup - from my testing the |
there is no such thing as backport to v14 in plugins 😢 We exclusively roll out version 15.x.x starting from the release cut-off point. However, this implies that in the event of a bug fix required by a customer using version 14, they would have to employ the Terraform provider v15 with their v14 cluster and discern how the modification is applicable to their specific use case. |
I was talking about merging this PR now, which will send the change to v14.3.1. We must hold off this PR until the v15 freeze. Even if this is a bugfix, we cannot ship this PR in v14 because this is a major breaking change that will change the result of everyone's IaC. Users will need to review the changes before upgrading the TF provider to v15. |
Is there a way to do a two phase deprecation here? Option A: Option B: For new users, Option A is ideal: no warning, correct behavior and no special Env Var/Provider Setting. If using B, users get a warning explaining (or linking to a doc page) what is changing. |
Oh got it but we still have a problem. Given that most APIs are kept unchanged between 12-15, I would assume that if the terraform picks the latest available version (15) against a cluster v14 or v13 the roles changes will be incorporated which will cause behavior breaking changes for v14... Can we gate this new behavior behind a feature flag that is only enabled if the teleport server is >= 15.0.0? I think that will be the simplest and safest solution to ship this code otherwise we will create so many problems. |
I don't think we can move forward with this fix, if you have a pre-fix resource, and update to the fixed provider, Terraform will not detect any pending changes. If you then modify some other field on the resource, the null fields will silently be changed from false to their default. This sounds dangerous. As an aside this is caused by another bug in the provider today where Terraform will not detect drift from Null -> Non-null bool values - gravitational/teleport#42427 |
Closes gravitational/teleport#35947
Closes gravitational/teleport#42432
Closes gravitational/teleport#42429
It looks like if the Terraform value was null, it previously ended up sending
false
rather than null to the Teleport API. This leads to things erroneously being set to false and triggering warnings like:I tested this change with:
Followed by:
I figure that this is potentially a breaking fix ? Surely some folks have run into this with other BoolOptions on other resources and deploying this fix will lead to values being changed when upgrading to this version ? I'd appreciate someone who understands this chiming in here.