diff --git a/adapter/internal/controlplane/eventPublisher.go b/adapter/internal/controlplane/eventPublisher.go index bed83f7dde..4b36d2e532 100644 --- a/adapter/internal/controlplane/eventPublisher.go +++ b/adapter/internal/controlplane/eventPublisher.go @@ -199,7 +199,7 @@ func sendData() { // AddToEventQueue adds the api event to queue func AddToEventQueue(data APICPEvent) { - loggers.LoggerAPK.Infof("Event added to queue : %+v", data) + loggers.LoggerAPK.Debugf("Event added to CP Event queue : %+v", data) eventQueue <- data } diff --git a/adapter/internal/operator/controllers/dp/api_controller.go b/adapter/internal/operator/controllers/dp/api_controller.go index d078324b49..21a302200b 100644 --- a/adapter/internal/operator/controllers/dp/api_controller.go +++ b/adapter/internal/operator/controllers/dp/api_controller.go @@ -447,7 +447,6 @@ func (apiReconciler *APIReconciler) resolveAPIRefs(ctx context.Context, api dpv1 loggers.LoggerAPKOperator.Debugf("Child references are retrieved successfully for API CR %s", apiRef.String()) apiNamespacedName := utils.NamespacedName(apiState.APIDefinition).String() - loggers.LoggerAPK.Infof("label section of the api : %+v", apiState.APIDefinition.ObjectMeta.Labels) storedHash, hashFound := apiState.APIDefinition.ObjectMeta.Labels["apiHash"] if !api.Status.DeploymentStatus.Accepted { if apiReconciler.apiPropagationEnabled && !apiState.APIDefinition.Spec.SystemAPI { @@ -471,7 +470,6 @@ func (apiReconciler *APIReconciler) resolveAPIRefs(ctx context.Context, api dpv1 apiHash := apiReconciler.getAPIHash(apiState) if !hashFound || storedHash != apiHash { apiReconciler.patchAPIHash(ctx, apiHash, apiState.APIDefinition.ObjectMeta.Name, apiState.APIDefinition.ObjectMeta.Namespace) - loggers.LoggerAPK.Infof("Ok: %+v, value: %+v nam: %+v", hashFound, storedHash, apiNamespacedName) loggers.LoggerAPKOperator.Infof("API hash changed sending the API to agent") apiReconciler.apiHashes[apiNamespacedName] = apiHash // Publish the api data to CP @@ -2321,7 +2319,11 @@ func (apiReconciler *APIReconciler) validateHTTPRouteExtRefs(apiState *synchroni func (apiReconciler *APIReconciler) getAPIHash(apiState *synchronizer.APIState) string { getUniqueID := func(obj interface{}, fields ...string) string { - loggers.LoggerAPK.Infof("Type of obj: %T", obj) + defer func() { + if r := recover(); r != nil { + loggers.LoggerAPK.Infof("Error occured while extracting values using reflection. Error: %+v", r) + } + }() var sb strings.Builder objValue := reflect.ValueOf(obj) if objValue.Kind() == reflect.Ptr { @@ -2400,11 +2402,11 @@ func (apiReconciler *APIReconciler) getAPIHash(apiState *synchronizer.APIState) mutualSSLUniqueID += strconv.FormatBool(apiState.MutualSSL.Disabled) + apiState.MutualSSL.Required + strings.Join(apiState.MutualSSL.ClientCertificates, "") } joinedUniqueIDs = joinedUniqueIDs + strconv.FormatBool(apiState.SubscriptionValidation) + mutualSSLUniqueID - loggers.LoggerAPK.Infof("Prepared unique string: %s", joinedUniqueIDs) hash := sha256.Sum256([]byte(joinedUniqueIDs)) hashedString := hex.EncodeToString(hash[:]) truncatedHash := hashedString[:62] - loggers.LoggerAPK.Infof("Prepared hash: %s, truncated hash: %s", hashedString, truncatedHash) + loggers.LoggerAPK.Debugf("Prepared unique string for api %s/%s: %s, Prepared hash: %s, Truncatd hash to store: %s", apiState.APIDefinition.ObjectMeta.Name, + apiState.APIDefinition.ObjectMeta.Namespace, joinedUniqueIDs, hashedString, truncatedHash) return truncatedHash } @@ -2428,7 +2430,6 @@ func findProdSandEndpoints(apiState *synchronizer.APIState) (string, string, str } } } - loggers.LoggerAPK.Infof("Returning endpoints: %s, %s", prodEndpoint, sandEndpoint) return prodEndpoint, sandEndpoint, endpointProtocol }