mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 12:07:47 +00:00
fix error
Signed-off-by: jyz0309 <45495947@qq.com> use InfoS handle json Signed-off-by: jyz0309 <45495947@qq.com> remove import Signed-off-by: jyz0309 <45495947@qq.com> fix comment Signed-off-by: jyz0309 <45495947@qq.com>
This commit is contained in:
parent
a0fd52b6e1
commit
c0e0fae775
@ -20,7 +20,6 @@ limitations under the License.
|
|||||||
package winkernel
|
package winkernel
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
@ -431,7 +430,7 @@ func newSourceVIP(hns HostNetworkService, network string, ip string, mac string,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (ep *endpointsInfo) Cleanup() {
|
func (ep *endpointsInfo) Cleanup() {
|
||||||
klog.V(3).InfoS("Endpoint cleanup", "spewConfig", spewSdump(ep))
|
klog.V(3).InfoS("Endpoint cleanup", "endpointsInfo", ep)
|
||||||
if !ep.GetIsLocal() && ep.refCount != nil {
|
if !ep.GetIsLocal() && ep.refCount != nil {
|
||||||
*ep.refCount--
|
*ep.refCount--
|
||||||
|
|
||||||
@ -776,7 +775,7 @@ func CleanupLeftovers() (encounteredError bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (svcInfo *serviceInfo) cleanupAllPolicies(endpoints []proxy.Endpoint) {
|
func (svcInfo *serviceInfo) cleanupAllPolicies(endpoints []proxy.Endpoint) {
|
||||||
klog.V(3).InfoS("Service cleanup", "spewConfig", spewSdump(svcInfo))
|
klog.V(3).InfoS("Service cleanup", "serviceInfo", svcInfo)
|
||||||
// Skip the svcInfo.policyApplied check to remove all the policies
|
// Skip the svcInfo.policyApplied check to remove all the policies
|
||||||
svcInfo.deleteAllHnsLoadBalancerPolicy()
|
svcInfo.deleteAllHnsLoadBalancerPolicy()
|
||||||
// Cleanup Endpoints references
|
// Cleanup Endpoints references
|
||||||
@ -818,9 +817,7 @@ func deleteAllHnsLoadBalancerPolicy() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
for _, plist := range plists {
|
for _, plist := range plists {
|
||||||
if jsonString, err := json.Marshal(plist); err == nil {
|
klog.V(3).InfoS("Remove policy", "policyList", plist)
|
||||||
klog.V(3).InfoS("Remove policy", "policyList", jsonString)
|
|
||||||
}
|
|
||||||
_, err = plist.Delete()
|
_, err = plist.Delete()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
klog.ErrorS(err, "Failed to delete policy list")
|
klog.ErrorS(err, "Failed to delete policy list")
|
||||||
@ -1188,9 +1185,8 @@ func (proxier *Proxier) syncProxyRules() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Save the hnsId for reference
|
// Save the hnsId for reference
|
||||||
if jsonString, err := json.Marshal(plist); err == nil {
|
klog.V(1).InfoS("Hns endpoint resource", "endpointInfo", newHnsEndpoint)
|
||||||
klog.V(1).InfoS("Hns endpoint resource", "endpointInfo", jsonString)
|
|
||||||
}
|
|
||||||
hnsEndpoints = append(hnsEndpoints, *newHnsEndpoint)
|
hnsEndpoints = append(hnsEndpoints, *newHnsEndpoint)
|
||||||
if newHnsEndpoint.GetIsLocal() {
|
if newHnsEndpoint.GetIsLocal() {
|
||||||
hnsLocalEndpoints = append(hnsLocalEndpoints, *newHnsEndpoint)
|
hnsLocalEndpoints = append(hnsLocalEndpoints, *newHnsEndpoint)
|
||||||
@ -1202,7 +1198,7 @@ func (proxier *Proxier) syncProxyRules() {
|
|||||||
|
|
||||||
ep.hnsID = newHnsEndpoint.hnsID
|
ep.hnsID = newHnsEndpoint.hnsID
|
||||||
|
|
||||||
klog.V(3).InfoS("Endpoint resource found", "spewConfig", spewSdump(ep))
|
klog.V(3).InfoS("Endpoint resource found", "endpointsInfo", ep)
|
||||||
}
|
}
|
||||||
|
|
||||||
klog.V(3).InfoS("Associated endpoints for service", "spewConfig", spewSdump(hnsEndpoints), "svcName", svcName.String())
|
klog.V(3).InfoS("Associated endpoints for service", "spewConfig", spewSdump(hnsEndpoints), "svcName", svcName.String())
|
||||||
|
Loading…
Reference in New Issue
Block a user