MCPcopy
hub / github.com/kubernetes/client-go / AbsPath

Method AbsPath

rest/request.go:271–281  ·  view source on GitHub ↗

AbsPath overwrites an existing path with the segments provided. Trailing slashes are preserved when a single segment is passed.

(segments ...string)

Source from the content-addressed store, hash-verified

269// AbsPath overwrites an existing path with the segments provided. Trailing slashes are preserved
270// when a single segment is passed.
271func (r *Request) AbsPath(segments ...string) *Request {
272 if r.err != nil {
273 return r
274 }
275 r.pathPrefix = path.Join(r.baseURL.Path, path.Join(segments...))
276 if len(segments) == 1 && (len(r.baseURL.Path) > 1 || len(segments[0]) > 1) && strings.HasSuffix(segments[0], "/") {
277 // preserve any trailing slashes for legacy behavior
278 r.pathPrefix += "/"
279 }
280 return r
281}
282
283// RequestURI overwrites existing path and parameters with the value of the provided server relative
284// URI.

Callers 15

GetMethod · 0.80
UpdateMethod · 0.80
EvictMethod · 0.80
ServerGroupsMethod · 0.80
ServerVersionMethod · 0.80
OpenAPISchemaMethod · 0.80
TestRequestAbsPathJoinsFunction · 0.80
TestAbsPathFunction · 0.80
CreateMethod · 0.80

Calls

no outgoing calls

Tested by 4

TestRequestAbsPathJoinsFunction · 0.64
TestAbsPathFunction · 0.64