mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-09-30 12:54:25 +02:00
deprecate ClusterName field of Postgresql type and remove team from REST endpoints (#2015)
* deprecate ClusterName field of Postgresql type * remove for teamId from operator API endpints /status /logs /history * update dns_format_string and yaml template in UI
This commit is contained in:
@@ -15,11 +15,11 @@ import (
|
||||
)
|
||||
|
||||
// ClusterStatus provides status of the cluster
|
||||
func (c *Controller) ClusterStatus(team, namespace, cluster string) (*cluster.ClusterStatus, error) {
|
||||
func (c *Controller) ClusterStatus(namespace, cluster string) (*cluster.ClusterStatus, error) {
|
||||
|
||||
clusterName := spec.NamespacedName{
|
||||
Namespace: namespace,
|
||||
Name: team + "-" + cluster,
|
||||
Name: cluster,
|
||||
}
|
||||
|
||||
c.clustersMu.RLock()
|
||||
@@ -92,11 +92,11 @@ func (c *Controller) GetStatus() *spec.ControllerStatus {
|
||||
}
|
||||
|
||||
// ClusterLogs dumps cluster ring logs
|
||||
func (c *Controller) ClusterLogs(team, namespace, name string) ([]*spec.LogEntry, error) {
|
||||
func (c *Controller) ClusterLogs(namespace, name string) ([]*spec.LogEntry, error) {
|
||||
|
||||
clusterName := spec.NamespacedName{
|
||||
Namespace: namespace,
|
||||
Name: team + "-" + name,
|
||||
Name: name,
|
||||
}
|
||||
|
||||
c.clustersMu.RLock()
|
||||
@@ -215,11 +215,11 @@ func (c *Controller) WorkerStatus(workerID uint32) (*cluster.WorkerStatus, error
|
||||
}
|
||||
|
||||
// ClusterHistory dumps history of cluster changes
|
||||
func (c *Controller) ClusterHistory(team, namespace, name string) ([]*spec.Diff, error) {
|
||||
func (c *Controller) ClusterHistory(namespace, name string) ([]*spec.Diff, error) {
|
||||
|
||||
clusterName := spec.NamespacedName{
|
||||
Namespace: namespace,
|
||||
Name: team + "-" + name,
|
||||
Name: name,
|
||||
}
|
||||
|
||||
c.clustersMu.RLock()
|
||||
|
||||
@@ -159,24 +159,16 @@ 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 extractedClusterName, err = acidv1.ExtractClusterName(clusterName.Name, pgSpec.Spec.TeamID); err != nil {
|
||||
if _, 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