@@ -7,14 +7,14 @@ import (
77 "sync"
88 "time"
99
10- "github.com/golang/glog"
1110 "k8s.io/apimachinery/pkg/util/runtime"
1211 "k8s.io/apimachinery/pkg/util/wait"
1312 "k8s.io/client-go/util/retry"
13+ "k8s.io/klog"
1414
1515 "github.com/aws/aws-sdk-go/aws"
1616 "github.com/aws/aws-sdk-go/service/ec2"
17- "k8s.io/api/core/v1"
17+ v1 "k8s.io/api/core/v1"
1818 informer "k8s.io/client-go/informers/core/v1"
1919 "k8s.io/client-go/kubernetes"
2020 "k8s.io/client-go/tools/cache"
@@ -93,11 +93,10 @@ func (c *Controller) processNextWorkItem() bool {
9393 if quit {
9494 return false
9595 }
96- glog .Infof ("Get key %s" , key .(string ))
9796
9897 defer c .workqueue .Forget (key )
9998 if srcDstEnabled , err := c .checkSrcDstAttributeEnabled (key .(string )); err != nil {
100- glog .Error (err )
99+ klog .Error (err )
101100 c .workqueue .AddRateLimited (key )
102101 } else if srcDstEnabled {
103102 return true
@@ -116,7 +115,6 @@ func (c *Controller) handler(obj interface{}) {
116115 if err != nil {
117116 return
118117 }
119- glog .Infof ("Adding key %s" , key )
120118 c .workqueue .Add (key )
121119 return
122120}
@@ -135,19 +133,17 @@ func (c *Controller) disableSrcDstCheck(key string) error {
135133 // call AWS ec2 api to disable
136134 instanceID , err := GetInstanceIDFromProviderID (nodeCopy .Spec .ProviderID )
137135 if err != nil {
138- glog .Errorf ("Failed to retrieve Instance ID from Provider ID: %v" , nodeCopy .Spec .ProviderID )
136+ klog .Errorf ("Failed to retrieve Instance ID from Provider ID: %v" , nodeCopy .Spec .ProviderID )
139137 return err
140138 }
141139 if err = c .modifySrcDstCheckAttribute (* instanceID ); err != nil {
142- glog .Errorf ("Failed to disable src dst check for EC2 instance: %v; %v" , * instanceID , err )
140+ klog .Errorf ("Failed to disable src dst check for EC2 instance: %v; %v" , * instanceID , err )
143141 return err
144142 }
145143
146- glog .Infof ("Marking node %s with SrcDstCheckDisabledAnnotation" , nodeCopy .Name )
147144 nodeCopy .Annotations [SrcDstCheckDisabledAnnotation ] = "true"
148-
149145 if _ , err := c .client .CoreV1 ().Nodes ().Update (nodeCopy ); err != nil {
150- glog .Errorf ("Failed to set %s annotation: %v" , SrcDstCheckDisabledAnnotation , err )
146+ klog .Errorf ("Failed to set %s annotation: %v" , SrcDstCheckDisabledAnnotation , err )
151147 return err
152148 }
153149
@@ -215,7 +211,6 @@ func (c *Controller) checkSrcDstAttributeEnabled(key string) (enabled bool, err
215211
216212 if nodeObj .Annotations != nil {
217213 if _ , ok := nodeObj .Annotations [SrcDstCheckDisabledAnnotation ]; ok {
218- glog .Info ("The node has the annotation" )
219214 return true , nil
220215 }
221216 }
0 commit comments