|
@@ -25,7 +25,6 @@ import (
|
|
|
|
|
|
"github.com/coreos/flannel/pkg/ip"
|
|
|
"github.com/coreos/flannel/subnet"
|
|
|
- "github.com/golang/glog"
|
|
|
"golang.org/x/net/context"
|
|
|
v1 "k8s.io/api/core/v1"
|
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
@@ -39,6 +38,7 @@ import (
|
|
|
"k8s.io/client-go/rest"
|
|
|
"k8s.io/client-go/tools/cache"
|
|
|
"k8s.io/client-go/tools/clientcmd"
|
|
|
+ log "k8s.io/klog"
|
|
|
)
|
|
|
|
|
|
var (
|
|
@@ -113,14 +113,14 @@ func NewSubnetManager(ctx context.Context, apiUrl, kubeconfig, prefix, netConfPa
|
|
|
}
|
|
|
go sm.Run(context.Background())
|
|
|
|
|
|
- glog.Infof("Waiting %s for node controller to sync", nodeControllerSyncTimeout)
|
|
|
+ log.Infof("Waiting %s for node controller to sync", nodeControllerSyncTimeout)
|
|
|
err = wait.Poll(time.Second, nodeControllerSyncTimeout, func() (bool, error) {
|
|
|
return sm.nodeController.HasSynced(), nil
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, fmt.Errorf("error waiting for nodeController to sync state: %v", err)
|
|
|
}
|
|
|
- glog.Infof("Node controller sync successful")
|
|
|
+ log.Infof("Node controller sync successful")
|
|
|
|
|
|
return sm, nil
|
|
|
}
|
|
@@ -158,12 +158,12 @@ func newKubeSubnetManager(ctx context.Context, c clientset.Interface, sc *subnet
|
|
|
if !isNode {
|
|
|
deletedState, ok := obj.(cache.DeletedFinalStateUnknown)
|
|
|
if !ok {
|
|
|
- glog.Infof("Error received unexpected object: %v", obj)
|
|
|
+ log.Infof("Error received unexpected object: %v", obj)
|
|
|
return
|
|
|
}
|
|
|
node, ok = deletedState.Obj.(*v1.Node)
|
|
|
if !ok {
|
|
|
- glog.Infof("Error deletedFinalStateUnknown contained non-Node object: %v", deletedState.Obj)
|
|
|
+ log.Infof("Error deletedFinalStateUnknown contained non-Node object: %v", deletedState.Obj)
|
|
|
return
|
|
|
}
|
|
|
obj = node
|
|
@@ -186,7 +186,7 @@ func (ksm *kubeSubnetManager) handleAddLeaseEvent(et subnet.EventType, obj inter
|
|
|
|
|
|
l, err := ksm.nodeToLease(*n)
|
|
|
if err != nil {
|
|
|
- glog.Infof("Error turning node %q to lease: %v", n.ObjectMeta.Name, err)
|
|
|
+ log.Infof("Error turning node %q to lease: %v", n.ObjectMeta.Name, err)
|
|
|
return
|
|
|
}
|
|
|
ksm.events <- subnet.Event{et, l}
|
|
@@ -206,7 +206,7 @@ func (ksm *kubeSubnetManager) handleUpdateLeaseEvent(oldObj, newObj interface{})
|
|
|
|
|
|
l, err := ksm.nodeToLease(*n)
|
|
|
if err != nil {
|
|
|
- glog.Infof("Error turning node %q to lease: %v", n.ObjectMeta.Name, err)
|
|
|
+ log.Infof("Error turning node %q to lease: %v", n.ObjectMeta.Name, err)
|
|
|
return
|
|
|
}
|
|
|
ksm.events <- subnet.Event{subnet.EventAdded, l}
|
|
@@ -243,7 +243,7 @@ func (ksm *kubeSubnetManager) AcquireLease(ctx context.Context, attrs *subnet.Le
|
|
|
n.Annotations[ksm.annotations.BackendData] = string(bd)
|
|
|
if n.Annotations[ksm.annotations.BackendPublicIPOverwrite] != "" {
|
|
|
if n.Annotations[ksm.annotations.BackendPublicIP] != n.Annotations[ksm.annotations.BackendPublicIPOverwrite] {
|
|
|
- glog.Infof("Overriding public ip with '%s' from node annotation '%s'",
|
|
|
+ log.Infof("Overriding public ip with '%s' from node annotation '%s'",
|
|
|
n.Annotations[ksm.annotations.BackendPublicIPOverwrite],
|
|
|
ksm.annotations.BackendPublicIPOverwrite)
|
|
|
n.Annotations[ksm.annotations.BackendPublicIP] = n.Annotations[ksm.annotations.BackendPublicIPOverwrite]
|
|
@@ -275,7 +275,7 @@ func (ksm *kubeSubnetManager) AcquireLease(ctx context.Context, attrs *subnet.Le
|
|
|
}
|
|
|
err = ksm.setNodeNetworkUnavailableFalse(ctx)
|
|
|
if err != nil {
|
|
|
- glog.Errorf("Unable to set NetworkUnavailable to False for %q: %v", ksm.nodeName, err)
|
|
|
+ log.Errorf("Unable to set NetworkUnavailable to False for %q: %v", ksm.nodeName, err)
|
|
|
}
|
|
|
return &subnet.Lease{
|
|
|
Subnet: ip.FromIPNet(cidr),
|
|
@@ -296,7 +296,7 @@ func (ksm *kubeSubnetManager) WatchLeases(ctx context.Context, cursor interface{
|
|
|
}
|
|
|
|
|
|
func (ksm *kubeSubnetManager) Run(ctx context.Context) {
|
|
|
- glog.Infof("Starting kube subnet manager")
|
|
|
+ log.Infof("Starting kube subnet manager")
|
|
|
ksm.nodeController.Run(ctx.Done())
|
|
|
}
|
|
|
|