marshal patch when setting status
This commit is contained in:
parent
487c16a30e
commit
11f899367c
|
|
@ -151,16 +151,11 @@ func (c *Cluster) setProcessName(procName string, args ...interface{}) {
|
|||
|
||||
func (c *Cluster) setStatus(status string) {
|
||||
// TODO: eventually switch to updateStatus() for kubernetes 1.11 and above
|
||||
var (
|
||||
err error
|
||||
b []byte
|
||||
)
|
||||
if b, err = json.Marshal(status); err != nil {
|
||||
patch, err := json.Marshal(acidv1.PostgresStatus{PostgresClusterStatus: status})
|
||||
if err != nil {
|
||||
c.logger.Errorf("could not marshal status: %v", err)
|
||||
}
|
||||
|
||||
patch := []byte(fmt.Sprintf(`{"status":{"PostgresClusterStatus": %s}}`, string(b)))
|
||||
|
||||
// we cannot do a full scale update here without fetching the previous manifest (as the resourceVersion may differ),
|
||||
// however, we could do patch without it. In the future, once /status subresource is there (starting Kubernets 1.11)
|
||||
// we should take advantage of it.
|
||||
|
|
|
|||
Loading…
Reference in New Issue