Skip to content

Commit fe20e4b

Browse files
committed
fix lint errors or ignore them
1 parent 0a93cdd commit fe20e4b

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

cmd/compute-domain-controller/computedomain_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func (r *ComputeDomainReconciler) handleDeletion(ctx context.Context, domain *co
9999
}
100100

101101
func (r *ComputeDomainReconciler) ensureResourceClaimTemplates(ctx context.Context, domain *computedomainv1beta1.ComputeDomain) error {
102-
return r.ensureTemplate(ctx, domain, fmt.Sprintf("%s", domain.Name), consts.ComputeDomainWorkloadDeviceClass, "workload")
102+
return r.ensureTemplate(ctx, domain, domain.Name, consts.ComputeDomainWorkloadDeviceClass, "workload")
103103
}
104104

105105
func (r *ComputeDomainReconciler) getAllocationMode(domain *computedomainv1beta1.ComputeDomain) string {

internal/deviceplugin/real_node.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ func dial(unixSocketPath string, timeout time.Duration) (*grpc.ClientConn, error
4747
ctx, cancel := context.WithTimeout(ctx, timeout)
4848
defer cancel()
4949

50-
c, err := grpc.DialContext(
50+
c, err := grpc.DialContext( // nolint: all
5151
ctx,
5252
unixSocketPath,
5353
grpc.WithTransportCredentials(insecure.NewCredentials()),
54-
grpc.WithBlock(),
54+
grpc.WithBlock(), // nolint: all
5555
grpc.WithContextDialer(func(_ context.Context, addr string) (net.Conn, error) {
5656
return net.DialTimeout("unix", addr, timeout)
5757
}),

internal/migfaker/syncconfig.go

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,22 @@ func ContinuouslySyncMigConfigChanges(clientset kubernetes.Interface, migConfig
5555
fields.OneTermEqualSelector("metadata.name", viper.GetString(constants.EnvNodeName)),
5656
)
5757

58-
_, controller := cache.NewInformer(
59-
listWatch, &v1.Node{}, 0,
60-
cache.ResourceEventHandlerFuncs{
61-
AddFunc: func(obj interface{}) {
62-
migConfig.Set(obj.(*v1.Node).Annotations[MigConfigAnnotation])
63-
},
64-
UpdateFunc: func(oldObj, newObj interface{}) {
65-
oldAnnotation := oldObj.(*v1.Node).Annotations[MigConfigAnnotation]
66-
newAnnotation := newObj.(*v1.Node).Annotations[MigConfigAnnotation]
67-
if oldAnnotation != newAnnotation {
68-
migConfig.Set(newAnnotation)
69-
}
58+
_, controller := cache.NewInformerWithOptions(
59+
cache.InformerOptions{
60+
ListerWatcher: listWatch,
61+
ObjectType: &v1.Node{},
62+
ResyncPeriod: 0,
63+
Handler: cache.ResourceEventHandlerFuncs{
64+
AddFunc: func(obj interface{}) {
65+
migConfig.Set(obj.(*v1.Node).Annotations[MigConfigAnnotation])
66+
},
67+
UpdateFunc: func(oldObj, newObj interface{}) {
68+
oldAnnotation := oldObj.(*v1.Node).Annotations[MigConfigAnnotation]
69+
newAnnotation := newObj.(*v1.Node).Annotations[MigConfigAnnotation]
70+
if oldAnnotation != newAnnotation {
71+
migConfig.Set(newAnnotation)
72+
}
73+
},
7074
},
7175
},
7276
)

0 commit comments

Comments
 (0)