Skip to content

Commit

Permalink
Don't log when auto-published services and namespace exist already
Browse files Browse the repository at this point in the history
Also, be a bit less chatty w.r.t. master setDefaults
  • Loading branch information
smarterclayton committed Mar 14, 2015
1 parent b27b558 commit 893a64f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/master/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@ func setDefaults(c *Config) {
continue
}
if ip.IsLoopback() {
glog.Infof("'%v' (%v) is a loopback address, ignoring.", ip, addrs[i])
glog.V(5).Infof("'%v' (%v) is a loopback address, ignoring.", ip, addrs[i])
continue
}
found = true
c.PublicAddress = ip
glog.Infof("Will report %v as public IP address.", ip)
glog.V(2).Infof("Will report %v as public IP address.", ip)
break
}
if !found {
Expand Down Expand Up @@ -279,7 +279,7 @@ func New(c *Config) *Master {
if err != nil {
glog.Fatalf("Failed to generate service read-write IP for master service: %v", err)
}
glog.Infof("Setting master service IPs based on PortalNet subnet to %q (read-only) and %q (read-write).", serviceReadOnlyIP, serviceReadWriteIP)
glog.V(4).Infof("Setting master service IPs based on PortalNet subnet to %q (read-only) and %q (read-write).", serviceReadOnlyIP, serviceReadWriteIP)

m := &Master{
client: c.Client,
Expand Down
7 changes: 7 additions & 0 deletions pkg/master/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"time"

"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
"github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver"

"github.com/golang/glog"
Expand Down Expand Up @@ -91,6 +92,9 @@ func (m *Master) createMasterNamespaceIfNeeded(ns string) error {
},
}
_, err := m.storage["namespaces"].(apiserver.RESTCreater).Create(ctx, namespace)
if err != nil && errors.IsAlreadyExists(err) {
err = nil
}
return err
}

Expand Down Expand Up @@ -118,6 +122,9 @@ func (m *Master) createMasterServiceIfNeeded(serviceName string, serviceIP net.I
},
}
_, err := m.storage["services"].(apiserver.RESTCreater).Create(ctx, svc)
if err != nil && errors.IsAlreadyExists(err) {
err = nil
}
return err
}

Expand Down

0 comments on commit 893a64f

Please sign in to comment.