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: cannot update cluster since clustername is not set #69

Merged
merged 2 commits into from
Sep 9, 2024

Conversation

cloudcarver
Copy link
Contributor

@cloudcarver cloudcarver commented Sep 9, 2024

The update method will throw the error: "Cluster name cannot be changed, previous is default-control-plane, now is not set".

@cloudcarver cloudcarver requested a review from wjf3121 September 9, 2024 08:39
fmt.Sprintf("Cluster name cannot be changed, previous: %s, updated: %s", *previous.ClusterName, *updated.ClusterName),
)

// only check clusterName for BYOC
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we only check BYOC clusters? Hosted clusters cannot change their names either IIRC.

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 is no clusterName field exposed in the tf plugin data model. So the clusterName is not set in the updated object, which is transformed from the data model object submitted by tf plan. The previous object is created from the GET tenants API data directly. So clusterName is set in previous object.

In short, clusterName is not exposed to the tf plugin, the value is not set so we need to ignore it, and users cannot change it via tf plugin.

Copy link
Contributor

@wjf3121 wjf3121 left a comment

Choose a reason for hiding this comment

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

LGTM!

@cloudcarver cloudcarver merged commit b5f0226 into main Sep 9, 2024
10 checks passed
@cloudcarver cloudcarver deleted the mike/fix-clustername-compatibility branch September 9, 2024 09:01
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.

2 participants