mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 06:02:18 +00:00
Several small fixes.
This commit is contained in:
@@ -91,6 +91,15 @@ func (r *Request) Path(item string) *Request {
|
||||
return r
|
||||
}
|
||||
|
||||
// Overwrite an existing path with the path parameter.
|
||||
func (r *Request) AbsPath(path string) *Request {
|
||||
if r.err != nil {
|
||||
return r
|
||||
}
|
||||
r.path = path
|
||||
return r
|
||||
}
|
||||
|
||||
// Parse the given string as a resource label selector. Optional.
|
||||
func (r *Request) ParseSelector(item string) *Request {
|
||||
if r.err != nil {
|
||||
@@ -136,6 +145,8 @@ func (r *Request) Body(obj interface{}) *Request {
|
||||
r.body = bytes.NewBuffer(data)
|
||||
case []byte:
|
||||
r.body = bytes.NewBuffer(t)
|
||||
case io.Reader:
|
||||
r.body = obj.(io.Reader)
|
||||
default:
|
||||
data, err := api.Encode(obj)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user