Skip to content
New issue

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

expose creation APIRequestInfoResolver #4461

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions pkg/apiserver/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ type APIRequestInfo struct {
}

type APIRequestInfoResolver struct {
apiPrefixes util.StringSet
restMapper meta.RESTMapper
APIPrefixes util.StringSet
RestMapper meta.RESTMapper
}

// GetAPIRequestInfo returns the information from the http request. If error is not nil, APIRequestInfo holds the information as best it is known before the failure
Expand Down Expand Up @@ -253,7 +253,7 @@ func (r *APIRequestInfoResolver) GetAPIRequestInfo(req *http.Request) (APIReques
return requestInfo, fmt.Errorf("Unable to determine kind and namespace from an empty URL path")
}

for _, currPrefix := range r.apiPrefixes.List() {
for _, currPrefix := range r.APIPrefixes.List() {
// handle input of form /api/{version}/* by adjusting special paths
if currentParts[0] == currPrefix {
if len(currentParts) > 1 {
Expand Down Expand Up @@ -334,7 +334,7 @@ func (r *APIRequestInfoResolver) GetAPIRequestInfo(req *http.Request) (APIReques

// if we have a resource, we have a good shot at being able to determine kind
if len(requestInfo.Resource) > 0 {
_, requestInfo.Kind, _ = r.restMapper.VersionAndKindForResource(requestInfo.Resource)
_, requestInfo.Kind, _ = r.RestMapper.VersionAndKindForResource(requestInfo.Resource)
}

return requestInfo, nil
Expand Down