mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-09-30 12:34:32 +02:00
use old LB DNS format when teamId prefix is disabled (#2011)
* use old LB DNS format when teamId prefix is disabled * support both old and new format in external-dns * switch dns template from team to namespace
This commit is contained in:
@@ -159,17 +159,24 @@ func (c *Controller) acquireInitialListOfClusters() error {
|
||||
}
|
||||
|
||||
func (c *Controller) addCluster(lg *logrus.Entry, clusterName spec.NamespacedName, pgSpec *acidv1.Postgresql) (*cluster.Cluster, error) {
|
||||
var (
|
||||
extractedClusterName string
|
||||
err error
|
||||
)
|
||||
|
||||
if c.opConfig.EnableTeamIdClusternamePrefix {
|
||||
if _, err := acidv1.ExtractClusterName(clusterName.Name, pgSpec.Spec.TeamID); err != nil {
|
||||
if extractedClusterName, err = acidv1.ExtractClusterName(clusterName.Name, pgSpec.Spec.TeamID); err != nil {
|
||||
c.KubeClient.SetPostgresCRDStatus(clusterName, acidv1.ClusterStatusInvalid)
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
extractedClusterName = clusterName.Name
|
||||
}
|
||||
|
||||
cl := cluster.New(c.makeClusterConfig(), c.KubeClient, *pgSpec, lg, c.eventRecorder)
|
||||
cl.Run(c.stopCh)
|
||||
teamName := strings.ToLower(cl.Spec.TeamID)
|
||||
cl.ClusterName = extractedClusterName
|
||||
|
||||
defer c.clustersMu.Unlock()
|
||||
c.clustersMu.Lock()
|
||||
|
||||
Reference in New Issue
Block a user