Skip to content

Commit 27b76cd

Browse files
committed
optimizing api load
1 parent 79d19b8 commit 27b76cd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

npm/cmd/start_server.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ func startControlplane(config npmconfig.Config, flags npmconfig.Flags) error {
8181
}
8282
}
8383

84+
k8sConfig.AcceptContentTypes = "application/vnd.kubernetes.protobuf,application/json"
85+
k8sConfig.ContentType = "application/vnd.kubernetes.protobuf"
86+
8487
// Creates the clientset
8588
clientset, err := kubernetes.NewForConfig(k8sConfig)
8689
if err != nil {

npm/pkg/dataplane/dataplane_windows.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ func (dp *DataPlane) getLocalPodEndpoints() ([]*hcn.HostComputeEndpoint, error)
352352
timer := metrics.StartNewTimer()
353353
endpoints, err := dp.ioShim.Hns.ListEndpointsQuery(dp.endpointQuery.query)
354354
for _, endpoint1 := range endpoints {
355-
klog.Infof("ID: %s, Name: %+v", endpoint1.Id, endpoint1.Name)
355+
klog.Infof(" AttachedSharing: ID: %s, Name: %+v", endpoint1.Id, endpoint1.Name)
356356
} // Debugging
357357
klog.Infof("There are %+v endpoints with state: attached sharing", len(endpoints)) // Will remove after debugging
358358
metrics.RecordListEndpointsLatency(timer)
@@ -364,7 +364,7 @@ func (dp *DataPlane) getLocalPodEndpoints() ([]*hcn.HostComputeEndpoint, error)
364364
if dp.EnableNPMLite {
365365
timer = metrics.StartNewTimer()
366366
endpointsAttached, err := dp.ioShim.Hns.ListEndpointsQuery(dp.endpointQueryL1VH.query)
367-
klog.Infof("There are %+v endpoints with state: attached", len(endpointsAttached)) // Will remove after debugging
367+
klog.Infof("Attached: There are %+v endpoints with state: attached", len(endpointsAttached)) // Will remove after debugging
368368
for _, endpoint := range endpointsAttached {
369369
klog.Infof("ID: %s, Name: %+v", endpoint.Id, endpoint.Name)
370370
} // Debugging

0 commit comments

Comments
 (0)