Merge pull request #8169 from maximrub/fix/bug-8168-alibaba-cloud-endpoint-reloving

fix bug 8168 GetEndpoint resolving fail
This commit is contained in:
Kubernetes Prow Robot 2025-06-24 03:24:30 -07:00 committed by GitHub
commit c509bb2ef7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -89,9 +89,10 @@ func (resolver *LocationResolver) TryResolve(param *ResolveParam) (endpoint stri
return
}
err = json.Unmarshal([]byte(response.GetHttpContentString()), &getEndpointResponse)
content := response.GetHttpContentString()
err = json.Unmarshal([]byte(content), &getEndpointResponse)
if err != nil {
klog.Errorf("failed to unmarshal endpoint response, error: %v", err)
klog.Errorf("failed to resolve endpoint, error: %v, response: %s", err, content)
support = false
return
}
@ -153,7 +154,7 @@ type EndpointsObj struct {
// EndpointObj wrapper endpoint
type EndpointObj struct {
Protocols map[string]string
Protocols json.RawMessage
Type string
Namespace string
Id string