manual changes to patch subresource

This commit is contained in:
Chao Xu
2016-07-11 22:29:52 -07:00
parent d4df168186
commit dc2e12d2f8
7 changed files with 54 additions and 12 deletions

View File

@@ -17,6 +17,7 @@ limitations under the License.
package core
import (
"path"
"strings"
"k8s.io/kubernetes/pkg/api"
@@ -139,11 +140,25 @@ func NewPatchAction(resource unversioned.GroupVersionResource, namespace string,
return action
}
func NewPatchSubresourceAction(resource unversioned.GroupVersionResource, subresource string) PatchActionImpl {
func NewRootPatchSubresourceAction(resource unversioned.GroupVersionResource, name string, patch []byte, subresources ...string) PatchActionImpl {
action := PatchActionImpl{}
action.Verb = "patch"
action.Resource = resource
action.Subresource = subresource
action.Subresource = path.Join(subresources...)
action.Name = name
action.Patch = patch
return action
}
func NewPatchSubresourceAction(resource unversioned.GroupVersionResource, namespace, name string, patch []byte, subresources ...string) PatchActionImpl {
action := PatchActionImpl{}
action.Verb = "patch"
action.Resource = resource
action.Subresource = path.Join(subresources...)
action.Namespace = namespace
action.Name = name
action.Patch = patch
return action
}