mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #81507 from eloyekunle/fix/scale-client
update scale client to support non-namespaced resources
This commit is contained in:
commit
a118e59912
@ -150,7 +150,7 @@ func (c *namespacedScaleClient) Get(resource schema.GroupResource, name string)
|
||||
|
||||
result := c.client.clientBase.Get().
|
||||
AbsPath(path).
|
||||
Namespace(c.namespace).
|
||||
NamespaceIfScoped(c.namespace, c.namespace != "").
|
||||
Resource(gvr.Resource).
|
||||
Name(name).
|
||||
SubResource("scale").
|
||||
@ -191,7 +191,7 @@ func (c *namespacedScaleClient) Update(resource schema.GroupResource, scale *aut
|
||||
|
||||
result := c.client.clientBase.Put().
|
||||
AbsPath(path).
|
||||
Namespace(c.namespace).
|
||||
NamespaceIfScoped(c.namespace, c.namespace != "").
|
||||
Resource(gvr.Resource).
|
||||
Name(scale.Name).
|
||||
SubResource("scale").
|
||||
@ -211,7 +211,7 @@ func (c *namespacedScaleClient) Patch(gvr schema.GroupVersionResource, name stri
|
||||
groupVersion := gvr.GroupVersion()
|
||||
result := c.client.clientBase.Patch(pt).
|
||||
AbsPath(c.client.apiPathFor(groupVersion)).
|
||||
Namespace(c.namespace).
|
||||
NamespaceIfScoped(c.namespace, c.namespace != "").
|
||||
Resource(gvr.Resource).
|
||||
Name(name).
|
||||
SubResource("scale").
|
||||
|
@ -23,8 +23,9 @@ import (
|
||||
)
|
||||
|
||||
// ScalesGetter can produce a ScaleInterface
|
||||
// for a particular namespace.
|
||||
type ScalesGetter interface {
|
||||
// Scales produces a ScaleInterface for a particular namespace.
|
||||
// Set namespace to the empty string for non-namespaced resources.
|
||||
Scales(namespace string) ScaleInterface
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user