From 0702d6a086e6c732c2d5f5b72d9073be5ccba4b2 Mon Sep 17 00:00:00 2001 From: Tharsanan1 Date: Wed, 25 Sep 2024 15:37:40 +0530 Subject: [PATCH] Fix test failures --- .../synchronizer/ratelimit_policy_fetcher.go | 14 -------------- apim-apk-agent/internal/utils/apis_fetcher.go | 2 +- apim-apk-agent/pkg/synchronizer/apis_fetcher.go | 5 ++--- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/apim-apk-agent/internal/synchronizer/ratelimit_policy_fetcher.go b/apim-apk-agent/internal/synchronizer/ratelimit_policy_fetcher.go index 77fabd8b..c6f7933f 100644 --- a/apim-apk-agent/internal/synchronizer/ratelimit_policy_fetcher.go +++ b/apim-apk-agent/internal/synchronizer/ratelimit_policy_fetcher.go @@ -225,20 +225,6 @@ func FetchSubscriptionRateLimitPoliciesOnEvent(ratelimitName string, organizatio return } responseBytes, err := ioutil.ReadAll(resp.Body) - var jsonResponse interface{} - err = json.Unmarshal(responseBytes, &jsonResponse) - if err != nil { - logger.LoggerSynchronizer.Infof("Error unmarshalling JSON:", err) - return - } - - // Print the JSON response in a pretty format - jsonOutput, err := json.MarshalIndent(jsonResponse, "", " ") - if err != nil { - logger.LoggerSynchronizer.Infof("Error formatting JSON:", err) - return - } - logger.LoggerSynchronizer.Infof("Json string: %s", string(jsonOutput)) logger.LoggerSynchronizer.Debugf("Response String received for Policies: %v", string(responseBytes)) if err != nil { diff --git a/apim-apk-agent/internal/utils/apis_fetcher.go b/apim-apk-agent/internal/utils/apis_fetcher.go index 97471145..60f29694 100644 --- a/apim-apk-agent/internal/utils/apis_fetcher.go +++ b/apim-apk-agent/internal/utils/apis_fetcher.go @@ -113,7 +113,7 @@ func FetchAPIsOnEvent(conf *config.Config, apiUUID *string, k8sClient client.Cli logger.LoggerUtils.Errorf("Error while generating APK-Conf: %v", apkErr) return nil, err } - logger.LoggerUtils.Infof("APK Conf: %v", apkConf) + logger.LoggerUtils.Debugf("APK Conf: %v", apkConf) certContainer := transformer.CertContainer{ ClientCertObj: artifact.CertMeta, EndpointCertObj: artifact.EndpointCertMeta, diff --git a/apim-apk-agent/pkg/synchronizer/apis_fetcher.go b/apim-apk-agent/pkg/synchronizer/apis_fetcher.go index b1803d0e..510a9f31 100644 --- a/apim-apk-agent/pkg/synchronizer/apis_fetcher.go +++ b/apim-apk-agent/pkg/synchronizer/apis_fetcher.go @@ -86,10 +86,9 @@ func SendRequestToControlPlane(req *http.Request, apiID *string, gwLabels []stri client *http.Client) bool { // Make the request if apiID != nil { - logger.LoggerSync.Infof("Sending the control plane request for the API: %q", *apiID) + logger.LoggerSync.Debugf("Sending the control plane request for the API: %q", *apiID) } else { - logger.LoggerSync.Info("Sending the control plane request") - logger.LoggerSync.Infof("Sending url: %s", req.URL.String()) + logger.LoggerSync.Debugf("Sending the control plane request, url: %s", req.URL.String()) } resp, err := client.Do(req)