deprecate ClusterName field of Postgresql type and remove team from REST endpoints #2015
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 becl.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.