mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-09 07:45:43 +02:00
skip creation later to improve visibility of errors (#1013)
* try to emit error for missing team name in cluster name * skip creation after new cluster object * move SetStatus to k8sclient and emit event when skipping creation and rename to SetPostgresCRDStatus Co-authored-by: Felix Kunde <felix.kunde@zalando.de>
This commit is contained in:
co-authored by
Felix Kunde
parent
0e3fb9ec43
commit
0c6655a22d
@@ -102,7 +102,7 @@ func (p *Postgresql) UnmarshalJSON(data []byte) error {
|
||||
}
|
||||
|
||||
tmp.Error = err.Error()
|
||||
tmp.Status = PostgresStatus{PostgresClusterStatus: ClusterStatusInvalid}
|
||||
tmp.Status.PostgresClusterStatus = ClusterStatusInvalid
|
||||
|
||||
*p = Postgresql(tmp)
|
||||
|
||||
@@ -112,10 +112,10 @@ func (p *Postgresql) UnmarshalJSON(data []byte) error {
|
||||
|
||||
if clusterName, err := extractClusterName(tmp2.ObjectMeta.Name, tmp2.Spec.TeamID); err != nil {
|
||||
tmp2.Error = err.Error()
|
||||
tmp2.Status = PostgresStatus{PostgresClusterStatus: ClusterStatusInvalid}
|
||||
tmp2.Status.PostgresClusterStatus = ClusterStatusInvalid
|
||||
} else if err := validateCloneClusterDescription(&tmp2.Spec.Clone); err != nil {
|
||||
tmp2.Error = err.Error()
|
||||
tmp2.Status = PostgresStatus{PostgresClusterStatus: ClusterStatusInvalid}
|
||||
tmp2.Status.PostgresClusterStatus = ClusterStatusInvalid
|
||||
} else {
|
||||
tmp2.Spec.ClusterName = clusterName
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user