Use PATCH while updating Services and StatefulSets

This commit is contained in:
Murat Kabilov
2017-05-12 11:41:34 +02:00
parent 8026c69222
commit 9b0d0d487c
2 changed files with 30 additions and 6 deletions
+7
View File
@@ -7,6 +7,7 @@ import (
"time"
etcdclient "github.com/coreos/etcd/client"
"k8s.io/apimachinery/pkg/util/json"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/pkg/apis/apps/v1beta1"
"k8s.io/client-go/pkg/labels"
@@ -44,6 +45,12 @@ func normalizeUserFlags(userFlags []string) (flags []string, err error) {
return
}
func specPatch(spec interface{}) ([]byte, error) {
return json.Marshal(struct {
Spec interface{} `json:"spec"`
}{spec})
}
func (c *Cluster) logStatefulSetChanges(old, new *v1beta1.StatefulSet, isUpdate bool, reason string) {
if isUpdate {
c.logger.Infof("StatefulSet '%s' has been changed",