remove spew
Signed-off-by: jyz0309 <45495947@qq.com> remove spew Signed-off-by: jyz0309 <45495947@qq.com> remove LogJson Signed-off-by: jyz0309 <45495947@qq.com> change name Signed-off-by: jyz0309 <45495947@qq.com> remove spew Signed-off-by: jyz0309 <45495947@qq.com>
This commit is contained in:
@@ -194,7 +194,7 @@ func (hns hnsV1) getLoadBalancer(endpoints []endpointsInfo, flags loadBalancerFl
|
|||||||
} else if len(elbPolicy.VIPs) != 0 {
|
} else if len(elbPolicy.VIPs) != 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
LogJson("policyList", plist, "Found existing Hns loadbalancer policy resource", 1)
|
klog.V(1).InfoS("Found existing Hns loadbalancer policy resource", "policies", plist)
|
||||||
return &loadBalancerInfo{
|
return &loadBalancerInfo{
|
||||||
hnsID: plist.ID,
|
hnsID: plist.ID,
|
||||||
}, nil
|
}, nil
|
||||||
@@ -220,7 +220,7 @@ func (hns hnsV1) getLoadBalancer(endpoints []endpointsInfo, flags loadBalancerFl
|
|||||||
)
|
)
|
||||||
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
LogJson("policyList", lb, "Hns loadbalancer policy resource", 1)
|
klog.V(1).InfoS("Hns loadbalancer policy resource", "policies", lb)
|
||||||
} else {
|
} else {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -239,7 +239,7 @@ func (hns hnsV1) deleteLoadBalancer(hnsID string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
LogJson("policyList", hnsloadBalancer, "Removing Policy", 2)
|
klog.V(2).InfoS("Removing Policy", "policies", hnsloadBalancer)
|
||||||
|
|
||||||
_, err = hnsloadBalancer.Delete()
|
_, err = hnsloadBalancer.Delete()
|
||||||
return err
|
return err
|
||||||
|
@@ -202,7 +202,7 @@ func (hns hnsV2) getLoadBalancer(endpoints []endpointsInfo, flags loadBalancerFl
|
|||||||
} else if len(plist.FrontendVIPs) != 0 {
|
} else if len(plist.FrontendVIPs) != 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
LogJson("policyList", plist, "Found existing Hns loadbalancer policy resource", 1)
|
klog.V(1).InfoS("Found existing Hns loadbalancer policy resource", "policies", plist)
|
||||||
return &loadBalancerInfo{
|
return &loadBalancerInfo{
|
||||||
hnsID: plist.Id,
|
hnsID: plist.Id,
|
||||||
}, nil
|
}, nil
|
||||||
@@ -281,8 +281,7 @@ func (hns hnsV2) getLoadBalancer(endpoints []endpointsInfo, flags loadBalancerFl
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
LogJson("hostComputeLoadBalancer", lb, "Hns loadbalancer policy resource", 1)
|
klog.V(1).InfoS("Hns loadbalancer policy resource", "loadBalancer", lb)
|
||||||
|
|
||||||
return &loadBalancerInfo{
|
return &loadBalancerInfo{
|
||||||
hnsID: lb.Id,
|
hnsID: lb.Id,
|
||||||
}, err
|
}, err
|
||||||
|
@@ -31,7 +31,6 @@ import (
|
|||||||
|
|
||||||
"github.com/Microsoft/hcsshim"
|
"github.com/Microsoft/hcsshim"
|
||||||
"github.com/Microsoft/hcsshim/hcn"
|
"github.com/Microsoft/hcsshim/hcn"
|
||||||
"github.com/davecgh/go-spew/spew"
|
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
discovery "k8s.io/api/discovery/v1"
|
discovery "k8s.io/api/discovery/v1"
|
||||||
"k8s.io/apimachinery/pkg/types"
|
"k8s.io/apimachinery/pkg/types"
|
||||||
@@ -221,12 +220,6 @@ func (t DualStackCompatTester) DualStackCompatible(networkName string) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func spewSdump(v interface{}) string {
|
|
||||||
scs := spew.NewDefaultConfig()
|
|
||||||
scs.DisableMethods = true
|
|
||||||
return scs.Sdump(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// internal struct for endpoints information
|
// internal struct for endpoints information
|
||||||
type endpointsInfo struct {
|
type endpointsInfo struct {
|
||||||
ip string
|
ip string
|
||||||
@@ -817,7 +810,7 @@ func deleteAllHnsLoadBalancerPolicy() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
for _, plist := range plists {
|
for _, plist := range plists {
|
||||||
klog.V(3).InfoS("Remove policy", "policyList", plist)
|
klog.V(3).InfoS("Remove policy", "policies", plist)
|
||||||
_, 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")
|
||||||
@@ -1046,7 +1039,7 @@ func (proxier *Proxier) syncProxyRules() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if svcInfo.policyApplied {
|
if svcInfo.policyApplied {
|
||||||
klog.V(4).InfoS("Policy already applied", "spewConfig", spewSdump(svcInfo))
|
klog.V(4).InfoS("Policy already applied", "serviceInfo", svcInfo)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1143,7 +1136,7 @@ func (proxier *Proxier) syncProxyRules() {
|
|||||||
|
|
||||||
newHnsEndpoint, err = hns.createEndpoint(hnsEndpoint, hnsNetworkName)
|
newHnsEndpoint, err = hns.createEndpoint(hnsEndpoint, hnsNetworkName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
klog.ErrorS(err, "Remote endpoint creation failed", "spewConfig", spewSdump(hnsEndpoint))
|
klog.ErrorS(err, "Remote endpoint creation failed", "endpointsInfo", hnsEndpoint)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1185,7 +1178,7 @@ func (proxier *Proxier) syncProxyRules() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Save the hnsId for reference
|
// Save the hnsId for reference
|
||||||
klog.V(1).InfoS("Hns endpoint resource", "endpointInfo", newHnsEndpoint)
|
klog.V(1).InfoS("Hns endpoint resource", "endpointsInfo", newHnsEndpoint)
|
||||||
|
|
||||||
hnsEndpoints = append(hnsEndpoints, *newHnsEndpoint)
|
hnsEndpoints = append(hnsEndpoints, *newHnsEndpoint)
|
||||||
if newHnsEndpoint.GetIsLocal() {
|
if newHnsEndpoint.GetIsLocal() {
|
||||||
@@ -1201,7 +1194,7 @@ func (proxier *Proxier) syncProxyRules() {
|
|||||||
klog.V(3).InfoS("Endpoint resource found", "endpointsInfo", 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", "endpointsInfo", hnsEndpoints, "svcName", svcName.String())
|
||||||
|
|
||||||
if len(svcInfo.hnsID) > 0 {
|
if len(svcInfo.hnsID) > 0 {
|
||||||
// This should not happen
|
// This should not happen
|
||||||
@@ -1213,7 +1206,7 @@ func (proxier *Proxier) syncProxyRules() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
klog.V(4).Infof("Trying to Apply Policies for service", "spewConfig", spewSdump(svcInfo))
|
klog.V(4).Infof("Trying to apply Policies for service", "serviceInfo", svcInfo)
|
||||||
var hnsLoadBalancer *loadBalancerInfo
|
var hnsLoadBalancer *loadBalancerInfo
|
||||||
var sourceVip = proxier.sourceVip
|
var sourceVip = proxier.sourceVip
|
||||||
if containsPublicIP || containsNodeIP {
|
if containsPublicIP || containsNodeIP {
|
||||||
@@ -1316,7 +1309,7 @@ func (proxier *Proxier) syncProxyRules() {
|
|||||||
klog.V(3).InfoS("Hns LoadBalancer resource created for loadBalancer Ingress resources", "lbIngressIP", lbIngressIP)
|
klog.V(3).InfoS("Hns LoadBalancer resource created for loadBalancer Ingress resources", "lbIngressIP", lbIngressIP)
|
||||||
}
|
}
|
||||||
svcInfo.policyApplied = true
|
svcInfo.policyApplied = true
|
||||||
klog.V(2).InfoS("Policy Successfully applied for service", "spewConfig", spewSdump(svcInfo))
|
klog.V(2).InfoS("Policy successfully applied for service", "serviceInfo", svcInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
if proxier.healthzServer != nil {
|
if proxier.healthzServer != nil {
|
||||||
|
Reference in New Issue
Block a user