add missed return (#20)
This commit is contained in:
parent
f86275e60c
commit
3b6454c2dc
|
|
@ -267,7 +267,6 @@ func (c *Cluster) sameVolumeWith(volume spec.Volume) (match bool, reason string)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (c *Cluster) compareStatefulSetWith(statefulSet *v1beta1.StatefulSet) (match, needsReplace, needsRollUpdate bool, reason string) {
|
func (c *Cluster) compareStatefulSetWith(statefulSet *v1beta1.StatefulSet) (match, needsReplace, needsRollUpdate bool, reason string) {
|
||||||
match = true
|
match = true
|
||||||
//TODO: improve me
|
//TODO: improve me
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@ import (
|
||||||
"k8s.io/client-go/pkg/api/v1"
|
"k8s.io/client-go/pkg/api/v1"
|
||||||
"k8s.io/client-go/pkg/apis/apps/v1beta1"
|
"k8s.io/client-go/pkg/apis/apps/v1beta1"
|
||||||
|
|
||||||
"github.com/zalando-incubator/postgres-operator/pkg/util/retryutil"
|
|
||||||
"github.com/zalando-incubator/postgres-operator/pkg/spec"
|
"github.com/zalando-incubator/postgres-operator/pkg/spec"
|
||||||
"github.com/zalando-incubator/postgres-operator/pkg/util"
|
"github.com/zalando-incubator/postgres-operator/pkg/util"
|
||||||
"github.com/zalando-incubator/postgres-operator/pkg/util/constants"
|
"github.com/zalando-incubator/postgres-operator/pkg/util/constants"
|
||||||
"github.com/zalando-incubator/postgres-operator/pkg/util/k8sutil"
|
"github.com/zalando-incubator/postgres-operator/pkg/util/k8sutil"
|
||||||
|
"github.com/zalando-incubator/postgres-operator/pkg/util/retryutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (c *Cluster) loadResources() error {
|
func (c *Cluster) loadResources() error {
|
||||||
|
|
@ -174,10 +174,11 @@ func (c *Cluster) replaceStatefulSet(newStatefulSet *v1beta1.StatefulSet) error
|
||||||
err := retryutil.Retry(constants.StatefulsetDeletionInterval, constants.StatefulsetDeletionTimeout,
|
err := retryutil.Retry(constants.StatefulsetDeletionInterval, constants.StatefulsetDeletionTimeout,
|
||||||
func() (bool, error) {
|
func() (bool, error) {
|
||||||
_, err := c.KubeClient.StatefulSets(oldStatefulset.Namespace).Get(oldStatefulset.Name)
|
_, err := c.KubeClient.StatefulSets(oldStatefulset.Namespace).Get(oldStatefulset.Name)
|
||||||
|
|
||||||
return err != nil, nil
|
return err != nil, nil
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Errorf("could not delete statefulset: %s", err)
|
return fmt.Errorf("could not delete statefulset: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// create the new statefulset with the desired spec. It would take over the remaining pods.
|
// create the new statefulset with the desired spec. It would take over the remaining pods.
|
||||||
|
|
@ -191,9 +192,9 @@ func (c *Cluster) replaceStatefulSet(newStatefulSet *v1beta1.StatefulSet) error
|
||||||
c.logger.Warnf("Number of pods for the old and updated Statefulsets is not identical")
|
c.logger.Warnf("Number of pods for the old and updated Statefulsets is not identical")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
c.Statefulset = createdStatefulset
|
c.Statefulset = createdStatefulset
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Cluster) deleteStatefulSet() error {
|
func (c *Cluster) deleteStatefulSet() error {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue