示例#1
0
func (c *scales) Update(kind string, scale *extensions.Scale) (result *extensions.Scale, err error) {
	result = &extensions.Scale{}
	resource, _ := meta.KindToResource(kind, false)
	err = c.client.Put().
		Namespace(scale.Namespace).
		Resource(resource).
		Name(scale.Name).
		SubResource("scale").
		Body(scale).
		Do().
		Into(result)
	return
}
示例#2
0
// Get takes the reference to scale subresource and returns the subresource or error, if one occurs.
func (c *scales) Get(kind string, name string) (result *extensions.Scale, err error) {
	result = &extensions.Scale{}
	resource, _ := meta.KindToResource(kind, false)
	err = c.client.Get().Namespace(c.ns).Resource(resource).Name(name).SubResource("scale").Do().Into(result)
	return
}