mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-29 00:17:46 +00:00
Merge pull request #81507 from eloyekunle/fix/scale-client
update scale client to support non-namespaced resources Kubernetes-commit: a118e59912ebf3fc6bd79e580048ae6fac7a7431
This commit is contained in:
commit
cc5a7c7149
2
Godeps/Godeps.json
generated
2
Godeps/Godeps.json
generated
@ -288,7 +288,7 @@
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery",
|
||||
"Rev": "0233d01ce572"
|
||||
"Rev": "e31a5531b558"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/gengo",
|
||||
|
4
go.mod
4
go.mod
@ -27,7 +27,7 @@ require (
|
||||
golang.org/x/time v0.0.0-20161028155119-f51c12702a4d
|
||||
google.golang.org/appengine v1.5.0 // indirect
|
||||
k8s.io/api v0.0.0-20190820101039-d651a1528133
|
||||
k8s.io/apimachinery v0.0.0-20190826114657-0233d01ce572
|
||||
k8s.io/apimachinery v0.0.0-20190826114657-e31a5531b558
|
||||
k8s.io/klog v0.4.0
|
||||
k8s.io/utils v0.0.0-20190801114015-581e00157fb1
|
||||
sigs.k8s.io/yaml v1.1.0
|
||||
@ -39,5 +39,5 @@ replace (
|
||||
golang.org/x/sys => golang.org/x/sys v0.0.0-20190209173611-3b5209105503
|
||||
golang.org/x/text => golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db
|
||||
k8s.io/api => k8s.io/api v0.0.0-20190820101039-d651a1528133
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190826114657-0233d01ce572
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190826114657-e31a5531b558
|
||||
)
|
||||
|
2
go.sum
2
go.sum
@ -145,7 +145,7 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
k8s.io/api v0.0.0-20190820101039-d651a1528133/go.mod h1:AlhL1I0Xqh5Tyz0HsxjEhy+iKci9l1Qy3UMDFW7iG3A=
|
||||
k8s.io/apimachinery v0.0.0-20190826114657-0233d01ce572/go.mod h1:EZoIMuAgG/4v58YL+bz0kqnivqupk28fKYxFCa5e6X8=
|
||||
k8s.io/apimachinery v0.0.0-20190826114657-e31a5531b558/go.mod h1:EZoIMuAgG/4v58YL+bz0kqnivqupk28fKYxFCa5e6X8=
|
||||
k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
|
||||
k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
|
||||
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
|
||||
|
@ -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