Skip to content

Commit 23e8b82

Browse files
committed
address linter issues
1 parent d341612 commit 23e8b82

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

cni/network/network.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ func (plugin *NetPlugin) getPodInfo(args string) (name, ns string, err error) {
294294
return k8sPodName, k8sNamespace, nil
295295
}
296296

297-
func (plugin *NetPlugin) setCNIReportDetails(containerID string, opType, msg string) {
297+
func (plugin *NetPlugin) setCNIReportDetails(containerID, opType, msg string) {
298298
telemetry.CNIReportSettings.OperationType = opType
299299
telemetry.CNIReportSettings.SubContext = containerID
300300
telemetry.CNIReportSettings.EventMessage = msg
@@ -1095,7 +1095,7 @@ func (plugin *NetPlugin) Delete(args *cniSkel.CmdArgs) error {
10951095

10961096
logger.Warn("Release ip by ContainerID (endpoint not found)",
10971097
zap.String("containerID", args.ContainerID))
1098-
telemetry.SendEvent(fmt.Sprintf("Release ip by ContainerID (endpoint not found): %s", args.ContainerID))
1098+
telemetry.SendEvent("Release ip by ContainerID (endpoint not found): " + args.ContainerID)
10991099
if err = plugin.ipamInvoker.Delete(nil, nwCfg, args, nwInfo.Options); err != nil {
11001100
return plugin.RetriableError(fmt.Errorf("failed to release address(no endpoint): %w", err))
11011101
}

cni/telemetry/client/telemetry_client.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,25 @@ func (c *TelemetryClient) DisconnectTelemetry() {
4747
}
4848
c.tb.Close()
4949
}
50+
5051
func (c *TelemetryClient) sendTelemetry(msg string) {
5152
if c.tb == nil {
5253
return
5354
}
5455
c.lock.Lock()
5556
defer c.lock.Unlock()
56-
c.CNIReportSettings.EventMessage = msg
5757
eventMsg := fmt.Sprintf("[%d] %s", os.Getpid(), msg)
5858
c.CNIReportSettings.EventMessage = eventMsg
5959
telemetry.SendCNIEvent(c.tb, c.CNIReportSettings)
6060
}
61+
6162
func (c *TelemetryClient) sendLog(msg string) {
6263
if c.logger == nil {
6364
return
6465
}
6566
c.logger.Info("Telemetry Event", zap.String("message", msg))
6667
}
68+
6769
func (c *TelemetryClient) SendEvent(msg string) {
6870
c.sendLog(msg)
6971
c.sendTelemetry(msg)

network/endpoint_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ func (nw *network) deleteEndpointImplHnsV2(ep *endpoint) error {
580580
}
581581

582582
logger.Info("Deleting hcn endpoint with id", zap.String("HnsId", ep.HnsId))
583-
telemetry.SendEvent(fmt.Sprintf("Deleting HCN endpoint: %s", ep.HnsId))
583+
telemetry.SendEvent("Deleting HCN endpoint: " + ep.HnsId)
584584

585585
hcnEndpoint, err = Hnsv2.GetEndpointByID(ep.HnsId)
586586
if err != nil {

network/network_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ func (nm *networkManager) deleteNetworkImplHnsV2(nw *network) error {
476476
var hcnNetwork *hcn.HostComputeNetwork
477477
var err error
478478
logger.Info("Deleting hcn network with id", zap.String("id", nw.HnsId))
479-
telemetry.SendEvent(fmt.Sprintf("Deleting HCN network: %s", nw.HnsId))
479+
telemetry.SendEvent("Deleting HCN network: " + nw.HnsId)
480480

481481
if hcnNetwork, err = Hnsv2.GetNetworkByID(nw.HnsId); err != nil {
482482
return fmt.Errorf("Failed to get hcn network with id: %s due to err: %v", nw.HnsId, err)

0 commit comments

Comments
 (0)