@@ -142,7 +142,7 @@ func (plugin *NetPlugin) Start(config *common.PluginConfig) error {
142
142
// Initialize base plugin.
143
143
err := plugin .Initialize (config )
144
144
if err != nil {
145
- logger .Error ("[cni-net] Failed to initialize base plugin" , zap .Error (err ))
145
+ logger .Error ("Failed to initialize base plugin" , zap .Error (err ))
146
146
return err
147
147
}
148
148
@@ -330,7 +330,7 @@ func (plugin *NetPlugin) Add(args *cniSkel.CmdArgs) error {
330
330
331
331
startTime := time .Now ()
332
332
333
- logger .Info ("[cni-net] Processing ADD command" ,
333
+ logger .Info ("Processing ADD command" ,
334
334
zap .String ("containerId" , args .ContainerID ),
335
335
zap .String ("netNS" , args .Netns ),
336
336
zap .String ("ifName" , args .IfName ),
@@ -389,7 +389,7 @@ func (plugin *NetPlugin) Add(args *cniSkel.CmdArgs) error {
389
389
res .Print ()
390
390
}
391
391
392
- logger .Info ("[cni-net] ADD command completed for pod %v with IPs:%+v err:%v. " ,
392
+ logger .Info ("ADD command completed for" ,
393
393
zap .String ("pod" , k8sPodName ),
394
394
zap .Any ("IPs" , ipamAddResult .ipv4Result .IPs ),
395
395
zap .Error (err ))
@@ -497,7 +497,7 @@ func (plugin *NetPlugin) Add(args *cniSkel.CmdArgs) error {
497
497
// Issue link: https://github.com/kubernetes/kubernetes/issues/57253
498
498
499
499
if nwInfoErr == nil {
500
- logger .Info ("[cni-net] Found network with subnet" ,
500
+ logger .Info ("Found network with subnet" ,
501
501
zap .String ("network" , networkID ),
502
502
zap .String ("subnet" , nwInfo .Subnets [0 ].Prefix .String ()))
503
503
nwInfo .IPAMType = nwCfg .IPAM .Type
@@ -545,14 +545,14 @@ func (plugin *NetPlugin) Add(args *cniSkel.CmdArgs) error {
545
545
// Create network
546
546
if nwInfoErr != nil {
547
547
// Network does not exist.
548
- logger .Info ("[cni-net] Creating network" , zap .String ("networkID" , networkID ))
548
+ logger .Info ("Creating network" , zap .String ("networkID" , networkID ))
549
549
sendEvent (plugin , fmt .Sprintf ("[cni-net] Creating network %v." , networkID ))
550
550
// opts map needs to get passed in here
551
551
if nwInfo , err = plugin .createNetworkInternal (networkID , policies , ipamAddConfig , ipamAddResult ); err != nil {
552
552
logger .Error ("Create network failed" , zap .Error (err ))
553
553
return err
554
554
}
555
- logger .Info ("[cni-net] Created network" ,
555
+ logger .Info ("Created network" ,
556
556
zap .String ("networkId" , networkID ),
557
557
zap .String ("subnet" , ipamAddResult .hostSubnetPrefix .String ()))
558
558
sendEvent (plugin , fmt .Sprintf ("[cni-net] Created network %v with subnet %v." , networkID , ipamAddResult .hostSubnetPrefix .String ()))
@@ -625,7 +625,7 @@ func (plugin *NetPlugin) createNetworkInternal(
625
625
err := plugin .Errorf ("Failed to find the master interface" )
626
626
return nwInfo , err
627
627
}
628
- logger .Info ("[cni-net] Found master interface" , zap .String ("ifname" , masterIfName ))
628
+ logger .Info ("Found master interface" , zap .String ("ifname" , masterIfName ))
629
629
630
630
// Add the master as an external interface.
631
631
err := plugin .nm .AddExternalInterface (masterIfName , ipamAddResult .hostSubnetPrefix .String ())
@@ -640,7 +640,7 @@ func (plugin *NetPlugin) createNetworkInternal(
640
640
return nwInfo , err
641
641
}
642
642
643
- logger .Info ("[cni-net] DNS Info" , zap .Any ("info" , nwDNSInfo ))
643
+ logger .Info ("DNS Info" , zap .Any ("info" , nwDNSInfo ))
644
644
645
645
// Create the network.
646
646
nwInfo = network.NetworkInfo {
@@ -662,7 +662,7 @@ func (plugin *NetPlugin) createNetworkInternal(
662
662
}
663
663
664
664
if err = addSubnetToNetworkInfo (ipamAddResult , & nwInfo ); err != nil {
665
- logger .Info ("[cni-net] Failed to add subnets to networkInfo" ,
665
+ logger .Info ("Failed to add subnets to networkInfo" ,
666
666
zap .Error (err ))
667
667
return nwInfo , err
668
668
}
@@ -826,7 +826,7 @@ func (plugin *NetPlugin) createEndpointInternal(opt *createEndpointInternalOpt)
826
826
}
827
827
828
828
// Create the endpoint.
829
- logger .Info ("[cni-net] Creating endpoint" , zap .String ("endpointInfo" , epInfo .PrettyString ()))
829
+ logger .Info ("Creating endpoint" , zap .String ("endpointInfo" , epInfo .PrettyString ()))
830
830
sendEvent (plugin , fmt .Sprintf ("[cni-net] Creating endpoint %s." , epInfo .PrettyString ()))
831
831
err = plugin .nm .CreateEndpoint (cnsclient , opt .nwInfo .Id , & epInfo )
832
832
if err != nil {
@@ -847,7 +847,7 @@ func (plugin *NetPlugin) Get(args *cniSkel.CmdArgs) error {
847
847
networkID string
848
848
)
849
849
850
- logger .Info ("[cni-net] Processing GET command" ,
850
+ logger .Info ("Processing GET command" ,
851
851
zap .String ("container" , args .ContainerID ),
852
852
zap .String ("netns" , args .Netns ),
853
853
zap .String ("ifname" , args .IfName ),
@@ -873,7 +873,7 @@ func (plugin *NetPlugin) Get(args *cniSkel.CmdArgs) error {
873
873
res .Print ()
874
874
}
875
875
876
- logger .Info ("[cni-net] GET command completed" , zap .Any ("result" , result ),
876
+ logger .Info ("GET command completed" , zap .Any ("result" , result ),
877
877
zap .Error (err ))
878
878
}()
879
879
@@ -883,22 +883,22 @@ func (plugin *NetPlugin) Get(args *cniSkel.CmdArgs) error {
883
883
return err
884
884
}
885
885
886
- logger .Info ("[cni-net] Read network configuration" , zap .Any ("config" , nwCfg ))
886
+ logger .Info ("Read network configuration" , zap .Any ("config" , nwCfg ))
887
887
888
888
iptables .DisableIPTableLock = nwCfg .DisableIPTableLock
889
889
890
890
// Initialize values from network config.
891
891
if networkID , err = plugin .getNetworkName (args .Netns , nil , nwCfg ); err != nil {
892
892
// TODO: Ideally we should return from here only.
893
- logger .Error ("[cni-net] Failed to extract network name from network config" ,
893
+ logger .Error ("Failed to extract network name from network config" ,
894
894
zap .Error (err ))
895
895
}
896
896
897
897
endpointID := GetEndpointID (args )
898
898
899
899
// Query the network.
900
900
if _ , err = plugin .nm .GetNetworkInfo (networkID ); err != nil {
901
- plugin . Errorf ("Failed to query network: %v " , err )
901
+ logger . Error ("Failed to query network" , zap . Error ( err ) )
902
902
return err
903
903
}
904
904
@@ -946,7 +946,7 @@ func (plugin *NetPlugin) Delete(args *cniSkel.CmdArgs) error {
946
946
947
947
startTime := time .Now ()
948
948
949
- logger .Info ("[cni-net] Processing DEL command" ,
949
+ logger .Info ("Processing DEL command" ,
950
950
zap .String ("containerId" , args .ContainerID ),
951
951
zap .String ("netNS" , args .Netns ),
952
952
zap .String ("ifName" , args .IfName ),
@@ -957,7 +957,7 @@ func (plugin *NetPlugin) Delete(args *cniSkel.CmdArgs) error {
957
957
args .ContainerID , args .Netns , args .IfName , args .Args , args .Path , args .StdinData ))
958
958
959
959
defer func () {
960
- logger .Info ("[cni-net] DEL command completed" ,
960
+ logger .Info ("DEL command completed" ,
961
961
zap .String ("pod" , k8sPodName ),
962
962
zap .Error (err ))
963
963
}()
@@ -970,7 +970,7 @@ func (plugin *NetPlugin) Delete(args *cniSkel.CmdArgs) error {
970
970
971
971
// Parse Pod arguments.
972
972
if k8sPodName , k8sNamespace , err = plugin .getPodInfo (args .Args ); err != nil {
973
- logger .Error ("[cni-net] Failed to get POD info" , zap .Error (err ))
973
+ logger .Error ("Failed to get POD info" , zap .Error (err ))
974
974
}
975
975
976
976
plugin .setCNIReportDetails (nwCfg , CNI_DEL , "" )
@@ -1010,7 +1010,7 @@ func (plugin *NetPlugin) Delete(args *cniSkel.CmdArgs) error {
1010
1010
case network .AzureCNS :
1011
1011
cnsClient , cnsErr := cnscli .New ("" , defaultRequestTimeout )
1012
1012
if cnsErr != nil {
1013
- logger .Error ("[cni-net] failed to create cns client" , zap .Error (cnsErr ))
1013
+ logger .Error ("failed to create cns client" , zap .Error (cnsErr ))
1014
1014
return errors .Wrap (cnsErr , "failed to create cns client" )
1015
1015
}
1016
1016
plugin .ipamInvoker = NewCNSInvoker (k8sPodName , k8sNamespace , cnsClient , util .ExecutionMode (nwCfg .ExecutionMode ), util .IpamMode (nwCfg .IPAM .Mode ))
@@ -1031,7 +1031,7 @@ func (plugin *NetPlugin) Delete(args *cniSkel.CmdArgs) error {
1031
1031
numEndpointsToDelete = plugin .nm .GetNumEndpointsByContainerID (args .ContainerID )
1032
1032
}
1033
1033
1034
- logger .Info ("[cni-net] Endpoints to be deleted" , zap .Int ("count" , numEndpointsToDelete ))
1034
+ logger .Info ("Endpoints to be deleted" , zap .Int ("count" , numEndpointsToDelete ))
1035
1035
for i := 0 ; i < numEndpointsToDelete ; i ++ {
1036
1036
// Initialize values from network config.
1037
1037
networkID , err = plugin .getNetworkName (args .Netns , nil , nwCfg )
@@ -1042,14 +1042,14 @@ func (plugin *NetPlugin) Delete(args *cniSkel.CmdArgs) error {
1042
1042
return err
1043
1043
}
1044
1044
1045
- logger .Error ("[cni-net] Failed to extract network name from network config" , zap .Error (err ))
1045
+ logger .Error ("Failed to extract network name from network config" , zap .Error (err ))
1046
1046
err = plugin .Errorf ("Failed to extract network name from network config. error: %v" , err )
1047
1047
return err
1048
1048
}
1049
1049
// Query the network.
1050
1050
if nwInfo , err = plugin .nm .GetNetworkInfo (networkID ); err != nil {
1051
1051
if ! nwCfg .MultiTenancy {
1052
- logger .Error ("[cni-net] Failed to query network" ,
1052
+ logger .Error ("Failed to query network" ,
1053
1053
zap .String ("network" , networkID ),
1054
1054
zap .Error (err ))
1055
1055
// Log the error but return success if the network is not found.
@@ -1063,14 +1063,14 @@ func (plugin *NetPlugin) Delete(args *cniSkel.CmdArgs) error {
1063
1063
endpointID := GetEndpointID (args )
1064
1064
// Query the endpoint.
1065
1065
if epInfo , err = plugin .nm .GetEndpointInfo (networkID , endpointID ); err != nil {
1066
- logger .Info ("[cni-net] GetEndpoint" ,
1066
+ logger .Info ("GetEndpoint" ,
1067
1067
zap .String ("endpoint" , endpointID ),
1068
1068
zap .Error (err ))
1069
1069
if ! nwCfg .MultiTenancy {
1070
1070
// attempt to release address associated with this Endpoint id
1071
1071
// This is to ensure clean up is done even in failure cases
1072
1072
1073
- logger .Error ("[cni-net] Failed to query endpoint" ,
1073
+ logger .Error ("Failed to query endpoint" ,
1074
1074
zap .String ("endpoint" , endpointID ),
1075
1075
zap .Error (err ))
1076
1076
logger .Error ("Release ip by ContainerID (endpoint not found)" ,
@@ -1138,7 +1138,7 @@ func (plugin *NetPlugin) Update(args *cniSkel.CmdArgs) error {
1138
1138
1139
1139
startTime := time .Now ()
1140
1140
1141
- logger .Info ("[cni-net] Processing UPDATE command" ,
1141
+ logger .Info ("Processing UPDATE command" ,
1142
1142
zap .String ("netns" , args .Netns ),
1143
1143
zap .String ("args" , args .Args ),
1144
1144
zap .String ("path" , args .Path ))
@@ -1149,7 +1149,7 @@ func (plugin *NetPlugin) Update(args *cniSkel.CmdArgs) error {
1149
1149
return err
1150
1150
}
1151
1151
1152
- logger .Info ("[cni-net] Read network configuration" , zap .Any ("config" , nwCfg ))
1152
+ logger .Info ("Read network configuration" , zap .Any ("config" , nwCfg ))
1153
1153
1154
1154
iptables .DisableIPTableLock = nwCfg .DisableIPTableLock
1155
1155
plugin .setCNIReportDetails (nwCfg , CNI_UPDATE , "" )
@@ -1181,14 +1181,14 @@ func (plugin *NetPlugin) Update(args *cniSkel.CmdArgs) error {
1181
1181
res .Print ()
1182
1182
}
1183
1183
1184
- logger .Info ("[cni-net] UPDATE command completed" ,
1184
+ logger .Info ("UPDATE command completed" ,
1185
1185
zap .Any ("result" , result ),
1186
1186
zap .Error (err ))
1187
1187
}()
1188
1188
1189
1189
// Parse Pod arguments.
1190
1190
if podCfg , err = cni .ParseCniArgs (args .Args ); err != nil {
1191
- logger .Error ("[cni-net] Error while parsing CNI Args during UPDATE" ,
1191
+ logger .Error ("Error while parsing CNI Args during UPDATE" ,
1192
1192
zap .Error (err ))
1193
1193
return err
1194
1194
}
0 commit comments