Skip to content

deprecate ClusterName field of Postgresql type and remove team from REST endpoints #2015

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

Merged
merged 9 commits into from
Aug 29, 2022

Conversation

FxKu
Copy link
Member

@FxKu FxKu commented Aug 26, 2022

With #2001 we made the teamId prefix optional. The prefix was formerly checked during unmarshaling of the cluster manifest. It was calling ExtractClusterName function. On success, the PostgresSpec field ClusterName would receive the cluster name without teamId.

Leaving the field just empty led to a bug with LoadBalancer services. DNS names missing the cluster name because c.Spec.ClusterName was not set. So we tried to set it again with #2011. cl.ClusterName is wrong - it should be cl.Spec.ClusterName. Nevertheless, it is still empty when accessing it in masterDNSName.

This PR now suggest to deprecate the ClusterName field like it was originally planned in #2001. The teamId prefix option should only check if clusters start with the team Id and block them if not. Even when prefix constraint is enabled the DNS name will take the full name, because we changed the DNS template from {clustername}.{team}.{hostedzone} to {clustername}.{namespace}.{hostedzone}. There's no point in cutting of the teamId prefix from the cluster name anymore.

To provide backwards compatibilty #2011 already introduced a second DNS name that resembles the old format {cluster-with-no-team-prefix}.{team}.{hostedzone}.

Another oversight so far, has been the Operator REST API that prepends the teamID for status, history and logs endpoints. In the API server's internal clusterNamesPerTeam the teamId must also remain in the name.

"namespace", c.Namespace,
"team", c.teamName(),
Copy link
Member Author

Choose a reason for hiding this comment

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

If somebody still has the old {clustername}.{team}.{hostedzone} template in the config, we'll make sure it continues to work.

@FxKu FxKu changed the title deprecate ClusterName field of Postgresql type deprecate ClusterName field of Postgresql type and remove team from REST endpoints Aug 26, 2022
@FxKu FxKu added this to the 1.9 milestone Aug 26, 2022
@Jan-M
Copy link
Member

Jan-M commented Aug 29, 2022

👍

1 similar comment
@FxKu
Copy link
Member Author

FxKu commented Aug 29, 2022

👍

@FxKu FxKu merged commit 4c07494 into master Aug 29, 2022
@FxKu FxKu deleted the deprecate-clustername branch August 29, 2022 13:00
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