Skip to content

Commit 418b4c3

Browse files
committed
ajust log level
Signed-off-by: roc <[email protected]>
1 parent 24d910b commit 418b4c3

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

internal/controller/clbbinding.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func (r *CLBBindingReconciler[T]) createListener(ctx context.Context, bd clbbind
215215
return binding, errors.WithStack(err)
216216
}
217217
if lis == nil { // 不存在,再次尝试创建
218-
log.FromContext(ctx).V(3).Info("port check failed but no port exists, retry", "listenerId", lisId, "port", binding.LoadbalancerPort, "protocol", binding.Protocol, "lbId", binding.LoadbalancerId)
218+
log.FromContext(ctx).Info("port check failed but no port exists, retry", "listenerId", lisId, "port", binding.LoadbalancerPort, "protocol", binding.Protocol, "lbId", binding.LoadbalancerId)
219219
if lisId, err := createListener(); err != nil {
220220
return binding, errors.WithStack(err)
221221
} else { // 重试创建成功,记录最新的监听器 ID
@@ -280,12 +280,12 @@ func (r *CLBBindingReconciler[T]) ensureListener(ctx context.Context, bd clbbind
280280

281281
// 没有监听器 ID,尝试直接新建(不调查接口,加速大规模场景扩容速度)
282282
if binding.ListenerId == "" {
283-
log.FromContext(ctx).V(5).Info("no listener id found, try to create listener", "binding", binding)
283+
log.FromContext(ctx).V(1).Info("no listener id found, try to create listener", "binding", binding)
284284
binding, err := r.createListener(ctx, bd, binding)
285285
if err != nil {
286286
return binding, errors.WithStack(err)
287287
}
288-
log.FromContext(ctx).V(5).Info("listener first time created", "binding", binding)
288+
log.FromContext(ctx).V(1).Info("listener first time created", "binding", binding)
289289
return binding, nil
290290
}
291291

@@ -346,7 +346,7 @@ func (r *CLBBindingReconciler[T]) ensureBackendBindings(ctx context.Context, bd
346346
if err = r.ensureState(ctx, bd, networkingv1alpha1.CLBBindingStateNoBackend); err != nil {
347347
return errors.WithStack(err)
348348
}
349-
log.FromContext(ctx).V(5).Info("not bind backend due to backend not found")
349+
log.FromContext(ctx).Info("not bind backend due to backend not found")
350350
needBind = false
351351
}
352352
// 其它错误,直接返回
@@ -360,7 +360,7 @@ func (r *CLBBindingReconciler[T]) ensureBackendBindings(ctx context.Context, bd
360360
if err = r.ensureState(ctx, bd, networkingv1alpha1.CLBBindingStateWaitBackend); err != nil {
361361
return errors.WithStack(err)
362362
}
363-
log.FromContext(ctx).V(5).Info("not bind backend due to pod not scheduled")
363+
log.FromContext(ctx).Info("not bind backend due to pod not scheduled")
364364
needBind = false
365365
}
366366
return errors.WithStack(err)
@@ -380,7 +380,7 @@ func (r *CLBBindingReconciler[T]) ensureBackendBindings(ctx context.Context, bd
380380
return errors.WithStack(err)
381381
}
382382
}
383-
log.FromContext(ctx).V(5).Info("not bind backend due to node type not supported")
383+
log.FromContext(ctx).Info("not bind backend due to node type not supported")
384384
needBind = false
385385
}
386386

@@ -390,7 +390,7 @@ func (r *CLBBindingReconciler[T]) ensureBackendBindings(ctx context.Context, bd
390390
if err = r.ensureState(ctx, bd, networkingv1alpha1.CLBBindingStateWaitBackend); err != nil {
391391
return errors.WithStack(err)
392392
}
393-
log.FromContext(ctx).V(5).Info("not bind backend due to no pod ip")
393+
log.FromContext(ctx).Info("not bind backend due to no pod ip")
394394
needBind = false
395395
}
396396

@@ -588,7 +588,7 @@ func patchResult(ctx context.Context, c client.Client, obj client.Object, result
588588
if err := kube.PatchMap(ctx, c, obj, patchMap); err != nil {
589589
return errors.WithStack(err)
590590
}
591-
log.FromContext(ctx).V(3).Info("patch clb port mapping result success", "value", string(result))
591+
log.FromContext(ctx).V(1).Info("patch clb port mapping result success", "value", string(result))
592592
}
593593

594594
if !clusterinfo.AgonesSupported { // 没安装 agones,不做后续处理
@@ -625,7 +625,7 @@ func patchResult(ctx context.Context, c client.Client, obj client.Object, result
625625
return errors.WithStack(err)
626626
}
627627
}
628-
log.FromContext(ctx).V(3).Info("patch clb port mapping result to agones gameserver success", "value", string(result))
628+
log.FromContext(ctx).V(1).Info("patch clb port mapping result to agones gameserver success", "value", string(result))
629629
}
630630
return nil
631631
}
@@ -898,13 +898,13 @@ func (r *CLBBindingReconciler[T]) cleanupPortBinding(ctx context.Context, bindin
898898
lis, err := clb.GetListenerByIdOrPort(ctx, binding.Region, binding.LoadbalancerId, binding.ListenerId, int64(binding.LoadbalancerPort), binding.Protocol)
899899
if err != nil {
900900
if clb.IsLoadBalancerNotExistsError(err) { // 忽略 lbid 不存在的错误,就当清理成功
901-
log.FromContext(ctx).V(5).Info("ignore cleanup due to lb not exists", "binding", binding)
901+
log.FromContext(ctx).V(1).Info("ignore cleanup due to lb not exists", "binding", binding)
902902
return nil
903903
}
904904
return errors.WithStack(err)
905905
}
906906
if lis == nil { // 监听器已删除,忽略
907-
log.FromContext(ctx).V(5).Info("ignore cleanup due to listener already deleted", "binding", binding)
907+
log.FromContext(ctx).V(1).Info("ignore cleanup due to listener already deleted", "binding", binding)
908908
return nil
909909
}
910910
// 清理监听器

internal/controller/pod_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func (r *PodReconciler) sync(ctx context.Context, pod *corev1.Pod) (result ctrl.
7777
}
7878
if pod.Annotations[constant.EnableCLBHostPortMapping] == "true" {
7979
if pod.Spec.NodeName == "" {
80-
log.FromContext(ctx).V(5).Info("skip host port mapping when pod not schedued to node")
80+
log.FromContext(ctx).Info("skip host port mapping when pod not schedued to node")
8181
return
8282
}
8383
result, err = r.syncCLBHostPortMapping(ctx, pod)

pkg/clb/instance.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func Create(ctx context.Context, region, vpcId, extensiveParameters string, num
102102
return nil, err
103103
}
104104
if *lb.Status == 0 { // 创建中,等待一下
105-
log.FromContext(ctx).V(5).Info("lb is still creating", "lbId", lbId)
105+
log.FromContext(ctx).V(1).Info("lb is still creating", "lbId", lbId)
106106
time.Sleep(time.Second * 3)
107107
continue
108108
}
@@ -143,7 +143,7 @@ func Delete(ctx context.Context, region string, lbIds ...string) error {
143143

144144
// 创建单个 CLB
145145
func CreateCLB(ctx context.Context, region string, req *clb.CreateLoadBalancerRequest) (lbId string, err error) {
146-
log.FromContext(ctx).V(5).Info("CreateLoadBalancer", "req", *req)
146+
log.FromContext(ctx).V(3).Info("CreateLoadBalancer", "req", *req)
147147
client := GetClient(region)
148148
before := time.Now()
149149
resp, err := client.CreateLoadBalancerWithContext(ctx, req)

pkg/clb/listener.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func CreateListenerTryBatch(ctx context.Context, region, lbId string, port, endP
115115
startTime := time.Now()
116116
CreateListenerChan <- task
117117
result := <-task.Result
118-
log.FromContext(ctx).V(3).Info("CreateListenerTryBatch performance", "cost", time.Since(startTime).String())
118+
log.FromContext(ctx).V(1).Info("CreateListenerTryBatch performance", "cost", time.Since(startTime).String())
119119
id = result.ListenerId
120120
err = result.Err
121121
return

pkg/clb/target.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ func RegisterTarget(ctx context.Context, region, lbId, listenerId string, target
223223
Target: target,
224224
Result: make(chan error),
225225
}
226-
log.FromContext(ctx).V(5).Info("RegisterTarget", "lbId", lbId, "listenerId", listenerId, "target", target)
226+
log.FromContext(ctx).V(3).Info("RegisterTarget", "lbId", lbId, "listenerId", listenerId, "target", target)
227227
RegisterTargetChan <- task
228228
err := <-task.Result
229229
return err

0 commit comments

Comments
 (0)