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

Method Name

rest/request.go:223–241  ·  view source on GitHub ↗

Name sets the name of a resource to access (<resource>/[ns/<namespace>/]<name>)

(resourceName string)

Source from the content-addressed store, hash-verified

221
222// Name sets the name of a resource to access (<resource>/[ns/<namespace>/]<name>)
223func (r *Request) Name(resourceName string) *Request {
224 if r.err != nil {
225 return r
226 }
227 if len(resourceName) == 0 {
228 r.err = fmt.Errorf("resource name may not be empty")
229 return r
230 }
231 if len(r.resourceName) != 0 {
232 r.err = fmt.Errorf("resource name already set to %q, cannot change to %q", r.resourceName, resourceName)
233 return r
234 }
235 if msgs := IsValidPathSegmentName(resourceName); len(msgs) != 0 {
236 r.err = fmt.Errorf("invalid resource name %q: %v", resourceName, msgs)
237 return r
238 }
239 r.resourceName = resourceName
240 return r
241}
242
243// Namespace applies the namespace scope to a request (<resource>/[ns/<namespace>/]<name>)
244func (r *Request) Namespace(namespace string) *Request {

Callers 15

TestInvalidSegmentsFunction · 0.95
GetMethod · 0.45
UpdateMethod · 0.45
GetMethod · 0.45
UpdateMethod · 0.45
DeleteMethod · 0.45
PatchMethod · 0.45
GetMethod · 0.45
UpdateMethod · 0.45
UpdateStatusMethod · 0.45

Calls 2

IsValidPathSegmentNameFunction · 0.85
ErrorfMethod · 0.65