We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please provide an in-depth description of the question you have:
func (svc *ServiceEvent) handleCdsResponse(rsp *service_discovery_v3.DiscoveryResponse) error { var ( err error cluster = &config_cluster_v3.Cluster{} ) current := sets.New[string]() for _, resource := range rsp.GetResources() { if err = anypb.UnmarshalTo(resource, cluster, proto.UnmarshalOptions{}); err != nil { continue } current.Insert(cluster.GetName()) // compare part[0] CDS now // Cluster_EDS need compare tow parts, compare part[1] EDS in EDS handler apiStatus := core_v2.ApiStatus_UPDATE newHash := hash.Sum64String(resource.String()) if newHash != svc.DynamicLoader.ClusterCache.GetCdsHash(cluster.GetName()) { svc.DynamicLoader.ClusterCache.SetCdsHash(cluster.GetName(), newHash) log.Debugf("[CreateApiClusterByCds] update cluster %s, status %d, cluster.type %v", cluster.GetName(), apiStatus, cluster.GetType()) svc.DynamicLoader.CreateApiClusterByCds(apiStatus, cluster) } else { log.Debugf("unchanged cluster %s", cluster.GetName()) } } removed := svc.DynamicLoader.ClusterCache.GetResourceNames().Difference(current) for key := range removed { svc.DynamicLoader.UpdateApiClusterStatus(key, core_v2.ApiStatus_DELETE) } // TODO: maybe we don't need to wait until all clusters ready before loading, like cluster delete if len(svc.DynamicLoader.clusterNames) > 0 { svc.rqt = newAdsRequest(resource_v3.EndpointType, svc.DynamicLoader.clusterNames) svc.DynamicLoader.clusterNames = nil } else { svc.DynamicLoader.ClusterCache.Flush() } return nil }
In the above code Kmesh processes the cds response. However, the error during processing is not returned, but just a return nil in the end.
func (svc *ServiceEvent) processAdsResponse(rsp *service_discovery_v3.DiscoveryResponse) { var err error log.Debugf("handle ads response, %#v\n", rsp.GetTypeUrl()) svc.ack = newAckRequest(rsp) if rsp.GetResources() == nil { return } switch rsp.GetTypeUrl() { case resource_v3.ClusterType: err = svc.handleCdsResponse(rsp) case resource_v3.EndpointType: err = svc.handleEdsResponse(rsp) case resource_v3.ListenerType: err = svc.handleLdsResponse(rsp) case resource_v3.RouteType: err = svc.handleRdsResponse(rsp) default: err = fmt.Errorf("unsupport type url %s", rsp.GetTypeUrl()) } if err != nil { log.Error(err) } }
So in the above function, won't the final error be nil?
What do you think about this question?: I don't know if this is a bug, or if there is another way of passing error in xds.
Environment:
The text was updated successfully, but these errors were encountered:
ads_envent.go
Sorry, something went wrong.
No branches or pull requests
Please provide an in-depth description of the question you have:
In the above code Kmesh processes the cds response.
However, the error during processing is not returned, but just a return nil in the end.
So in the above function, won't the final error be nil?
What do you think about this question?:
I don't know if this is a bug, or if there is another way of passing error in xds.
Environment:
The text was updated successfully, but these errors were encountered: