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 eks cluster PRC replace #4415

Merged
merged 3 commits into from
Aug 29, 2024
Merged

Conversation

VenelinMartinov
Copy link
Contributor

@VenelinMartinov VenelinMartinov commented Aug 28, 2024

The eks:Cluster resource has received a new parameter with ForceNew and a default. When upgrading from an old version before the parameter was added this triggers a replace.

This PR adds a workaround for that - when the state is read the bootstrapSelfManagedAddons parameter is added with its default value if not present.

covered by TestEKSClusterUpgrade

partially fixes #4410

stacked on #4403

@VenelinMartinov VenelinMartinov changed the base branch from master to vvm/enable_prc_by_default August 28, 2024 09:47
@VenelinMartinov VenelinMartinov mentioned this pull request Aug 28, 2024
6 tasks
@VenelinMartinov VenelinMartinov changed the base branch from vvm/enable_prc_by_default to master August 28, 2024 09:50
@VenelinMartinov VenelinMartinov changed the base branch from master to vvm/enable_prc_by_default August 28, 2024 09:53
@@ -2192,6 +2192,16 @@ compatibility shim in favor of the new "name" field.`)
"node_group_name": tfbridge.AutoName("nodeGroupName", 255, "-"),
},
},
"aws_eks_cluster": {
TransformFromState: func(_ context.Context, pm resource.PropertyMap) (resource.PropertyMap, error) {
// if the defaultOutboundAccessEnabled property is not set, set it to the default value of true
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// if the defaultOutboundAccessEnabled property is not set, set it to the default value of true
// if the bootstrapSelfManagedAddons property is not set, set it to the default value of true

@@ -2192,6 +2192,16 @@ compatibility shim in favor of the new "name" field.`)
"node_group_name": tfbridge.AutoName("nodeGroupName", 255, "-"),
},
},
"aws_eks_cluster": {
TransformFromState: func(_ context.Context, pm resource.PropertyMap) (resource.PropertyMap, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, great find! This is likely pulumi/pulumi-terraform-bridge#2081

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is still not rolled out to AWS. We could roll it out together with PRC.

Copy link
Contributor

@flostadler flostadler Aug 28, 2024

Choose a reason for hiding this comment

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

Can we opt in specific resources only to pulumi/pulumi-terraform-bridge#2081?

I think both are great enhancements, but rolling them out at the same time makes it harder to reason about potential issues that come up

Copy link
Contributor Author

@VenelinMartinov VenelinMartinov Aug 28, 2024

Choose a reason for hiding this comment

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

No, we can't currently filter which resources to enable pulumi/pulumi-terraform-bridge#2081 for.

I have confirmed that indeed that fixes the EKS replacement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have so far seen no issues with either change 🤞, so it might be fine to roll out together.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd vote for rolling them out separately. pulumi/pulumi-terraform-bridge#2081 Seems relatively straight forward to roll out (famous last words), so wdyt about doing that right away?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am unsure of the effects of pulumi/pulumi-terraform-bridge#2081 without PRC - we have not tested that anywhere, so I'd be hesitant to do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There were concerns that 2081 might uncover latent panics which were hidden. The non-PRC bridge is known to transform some properties incorrectly, so running upgrades which were not run before could conceivably uncover some issues.

Copy link
Contributor Author

@VenelinMartinov VenelinMartinov Aug 28, 2024

Choose a reason for hiding this comment

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

If rolling the two together is a big concern, we could fix the EKS cluster as in this PR. This PR essentially re-implements the EKS cluster migration.

PRC might uncover similar issues in other resources though.

@VenelinMartinov
Copy link
Contributor Author

closing in favour of #4416, thanks @flostadler!

@VenelinMartinov
Copy link
Contributor Author

4416 did not fix the issue: #4410 (comment)

Reopening this.

@VenelinMartinov VenelinMartinov changed the base branch from vvm/enable_prc_by_default to t0yv0/prc August 29, 2024 14:18
Copy link
Member

@t0yv0 t0yv0 left a comment

Choose a reason for hiding this comment

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

Per our discussion today, the root cause is pulumi/pulumi-terraform-bridge#1667 that's not sending the right data into state migrations yes? Worth mentioning in the comment why this change is added, linking the root cause.

@VenelinMartinov VenelinMartinov merged commit e66ce37 into t0yv0/prc Aug 29, 2024
2 checks passed
@VenelinMartinov VenelinMartinov deleted the vvm/fix_eks_cluster_prc_replace branch August 29, 2024 14:22
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Maintainer note: consult the runbook for dealing with any breaking changes.

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

Successfully merging this pull request may close these issues.

PRC failures in AWS
3 participants