mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-20 12:23:22 +00:00
add missing sub-resources test actions
Kubernetes-commit: c026b62d19d83d4f68235d1bd039a469e87d215d
This commit is contained in:
parent
74549f85f4
commit
bf85a9d89b
@ -47,6 +47,17 @@ func NewGetAction(resource schema.GroupVersionResource, namespace, name string)
|
|||||||
return action
|
return action
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewGetSubresourceAction(resource schema.GroupVersionResource, namespace, subresource, name string) GetActionImpl {
|
||||||
|
action := GetActionImpl{}
|
||||||
|
action.Verb = "get"
|
||||||
|
action.Resource = resource
|
||||||
|
action.Subresource = subresource
|
||||||
|
action.Namespace = namespace
|
||||||
|
action.Name = name
|
||||||
|
|
||||||
|
return action
|
||||||
|
}
|
||||||
|
|
||||||
func NewRootListAction(resource schema.GroupVersionResource, kind schema.GroupVersionKind, opts interface{}) ListActionImpl {
|
func NewRootListAction(resource schema.GroupVersionResource, kind schema.GroupVersionKind, opts interface{}) ListActionImpl {
|
||||||
action := ListActionImpl{}
|
action := ListActionImpl{}
|
||||||
action.Verb = "list"
|
action.Verb = "list"
|
||||||
@ -70,6 +81,20 @@ func NewListAction(resource schema.GroupVersionResource, kind schema.GroupVersio
|
|||||||
return action
|
return action
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewListSubresourceAction(resource schema.GroupVersionResource, name, subresource string, kind schema.GroupVersionKind, namespace string, opts interface{}) ListActionImpl {
|
||||||
|
action := ListActionImpl{}
|
||||||
|
action.Verb = "list"
|
||||||
|
action.Resource = resource
|
||||||
|
action.Subresource = subresource
|
||||||
|
action.Kind = kind
|
||||||
|
action.Namespace = namespace
|
||||||
|
action.Name = name
|
||||||
|
labelSelector, fieldSelector, _ := ExtractFromListOptions(opts)
|
||||||
|
action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector}
|
||||||
|
|
||||||
|
return action
|
||||||
|
}
|
||||||
|
|
||||||
func NewRootCreateAction(resource schema.GroupVersionResource, object runtime.Object) CreateActionImpl {
|
func NewRootCreateAction(resource schema.GroupVersionResource, object runtime.Object) CreateActionImpl {
|
||||||
action := CreateActionImpl{}
|
action := CreateActionImpl{}
|
||||||
action.Verb = "create"
|
action.Verb = "create"
|
||||||
@ -89,6 +114,18 @@ func NewCreateAction(resource schema.GroupVersionResource, namespace string, obj
|
|||||||
return action
|
return action
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewCreateSubresourceAction(resource schema.GroupVersionResource, name, subresource string, namespace string, object runtime.Object) CreateActionImpl {
|
||||||
|
action := CreateActionImpl{}
|
||||||
|
action.Verb = "create"
|
||||||
|
action.Resource = resource
|
||||||
|
action.Subresource = subresource
|
||||||
|
action.Namespace = namespace
|
||||||
|
action.Name = name
|
||||||
|
action.Object = object
|
||||||
|
|
||||||
|
return action
|
||||||
|
}
|
||||||
|
|
||||||
func NewRootUpdateAction(resource schema.GroupVersionResource, object runtime.Object) UpdateActionImpl {
|
func NewRootUpdateAction(resource schema.GroupVersionResource, object runtime.Object) UpdateActionImpl {
|
||||||
action := UpdateActionImpl{}
|
action := UpdateActionImpl{}
|
||||||
action.Verb = "update"
|
action.Verb = "update"
|
||||||
@ -389,6 +426,7 @@ func (a GetActionImpl) GetName() string {
|
|||||||
type ListActionImpl struct {
|
type ListActionImpl struct {
|
||||||
ActionImpl
|
ActionImpl
|
||||||
Kind schema.GroupVersionKind
|
Kind schema.GroupVersionKind
|
||||||
|
Name string
|
||||||
ListRestrictions ListRestrictions
|
ListRestrictions ListRestrictions
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -402,6 +440,7 @@ func (a ListActionImpl) GetListRestrictions() ListRestrictions {
|
|||||||
|
|
||||||
type CreateActionImpl struct {
|
type CreateActionImpl struct {
|
||||||
ActionImpl
|
ActionImpl
|
||||||
|
Name string
|
||||||
Object runtime.Object
|
Object runtime.Object
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user