Documentation ¶
Index ¶
- func GeneratePatch(object runtime.Object, raw, originalRaw runtime.RawExtension) ([]byte, error)
- func ParseUserGroup(groupEncoded string) (groups []string)
- func ParseUserIdentity(idEncoded string) (id string)
- type FakeKubeControl
- func (r *FakeKubeControl) Create(namespace string, raw runtime.RawExtension, ...) (runtime.Object, error)
- func (r *FakeKubeControl) Delete(gvk *schema.GroupVersionKind, resource, namespace, name string) error
- func (r *FakeKubeControl) Get(gvk *schema.GroupVersionKind, resource, namespace, name string, ...) (runtime.Object, error)
- func (r *FakeKubeControl) Impersonate(userID string, userGroups []string) KubeControlInterface
- func (r *FakeKubeControl) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error)
- func (r *FakeKubeControl) List(resource, namespace string, options *metav1.ListOptions, serverPrint bool) (runtime.Object, error)
- func (r *FakeKubeControl) Patch(namespace, name string, gvk schema.GroupVersionKind, pt types.PatchType, ...) (runtime.Object, error)
- func (r *FakeKubeControl) Replace(namespace string, overwrite bool, raw runtime.RawExtension) (runtime.Object, error)
- func (r *FakeKubeControl) SetObject(gvk *schema.GroupVersionKind, resource, namespace, name string, ...)
- func (r *FakeKubeControl) UnsetImpersonate() KubeControlInterface
- type Helper
- type KubeControl
- func (r *KubeControl) Create(namespace string, raw runtime.RawExtension, ...) (runtime.Object, error)
- func (r *KubeControl) Delete(gvk *schema.GroupVersionKind, resource, namespace, name string) error
- func (r *KubeControl) Get(gvk *schema.GroupVersionKind, resource, namespace, name string, ...) (runtime.Object, error)
- func (r *KubeControl) Impersonate(userID string, userGroups []string) KubeControlInterface
- func (r *KubeControl) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error)
- func (r *KubeControl) List(resource, namespace string, options *metav1.ListOptions, serverPrint bool) (runtime.Object, error)
- func (r *KubeControl) Patch(namespace, name string, gvk schema.GroupVersionKind, pt types.PatchType, ...) (runtime.Object, error)
- func (r *KubeControl) Replace(namespace string, overwrite bool, raw runtime.RawExtension) (runtime.Object, error)
- func (r *KubeControl) UnsetImpersonate() KubeControlInterface
- type KubeControlInterface
- type Mapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GeneratePatch ¶
func ParseUserGroup ¶
func ParseUserIdentity ¶
Types ¶
type FakeKubeControl ¶
type FakeKubeControl struct {
// contains filtered or unexported fields
}
Fake interface for testing
func NewFakeKubeControl ¶
func NewFakeKubeControl() *FakeKubeControl
func (*FakeKubeControl) Delete ¶
func (r *FakeKubeControl) Delete(gvk *schema.GroupVersionKind, resource, namespace, name string) error
func (*FakeKubeControl) Get ¶
func (r *FakeKubeControl) Get( gvk *schema.GroupVersionKind, resource, namespace, name string, serverPrint bool) (runtime.Object, error)
Get a resource
func (*FakeKubeControl) Impersonate ¶
func (r *FakeKubeControl) Impersonate(userID string, userGroups []string) KubeControlInterface
func (*FakeKubeControl) KindFor ¶
func (r *FakeKubeControl) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error)
func (*FakeKubeControl) List ¶
func (r *FakeKubeControl) List(resource, namespace string, options *metav1.ListOptions, serverPrint bool) (runtime.Object, error)
List resources
func (*FakeKubeControl) Patch ¶
func (r *FakeKubeControl) Patch( namespace, name string, gvk schema.GroupVersionKind, pt types.PatchType, data []byte) (runtime.Object, error)
func (*FakeKubeControl) Replace ¶
func (r *FakeKubeControl) Replace( namespace string, overwrite bool, raw runtime.RawExtension) (runtime.Object, error)
func (*FakeKubeControl) SetObject ¶
func (r *FakeKubeControl) SetObject(gvk *schema.GroupVersionKind, resource, namespace, name string, object runtime.Object)
func (*FakeKubeControl) UnsetImpersonate ¶
func (r *FakeKubeControl) UnsetImpersonate() KubeControlInterface
type Helper ¶
type Helper struct { // The name of this resource as the server would recognize it Resource string // A RESTClient capable of mutating this resource. RESTClient *rest.RESTClient // True if the resource type is scoped to namespaces NamespaceScoped bool // Enable server print ServerPrint bool }
Helper provides methods for retrieving or mutating a RESTful resource.
type KubeControl ¶
type KubeControl struct {
// contains filtered or unexported fields
}
func NewKubeControl ¶
func NewKubeControl(mapper *Mapper, config *rest.Config) *KubeControl
func (*KubeControl) Delete ¶
func (r *KubeControl) Delete(gvk *schema.GroupVersionKind, resource, namespace, name string) error
func (*KubeControl) Get ¶
func (r *KubeControl) Get( gvk *schema.GroupVersionKind, resource, namespace, name string, serverPrint bool) (runtime.Object, error)
Get a resource
func (*KubeControl) Impersonate ¶
func (r *KubeControl) Impersonate(userID string, userGroups []string) KubeControlInterface
func (*KubeControl) KindFor ¶
func (r *KubeControl) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error)
func (*KubeControl) List ¶
func (r *KubeControl) List( resource, namespace string, options *metav1.ListOptions, serverPrint bool) (runtime.Object, error)
List resources
func (*KubeControl) Patch ¶
func (r *KubeControl) Patch( namespace, name string, gvk schema.GroupVersionKind, pt types.PatchType, data []byte) (runtime.Object, error)
func (*KubeControl) Replace ¶
func (r *KubeControl) Replace(namespace string, overwrite bool, raw runtime.RawExtension) (runtime.Object, error)
func (*KubeControl) UnsetImpersonate ¶
func (r *KubeControl) UnsetImpersonate() KubeControlInterface
type KubeControlInterface ¶
type KubeControlInterface interface { // Impersonate a user Impersonate(userID string, userGroups []string) KubeControlInterface // Unset impersonate headers UnsetImpersonate() KubeControlInterface // Create creates an object Create(namespace string, raw runtime.RawExtension, deco func(obj runtime.Object) runtime.Object) (runtime.Object, error) // Delete a resource Delete(gvk *schema.GroupVersionKind, resource, namespace, name string) error // Get a resource Get(gvk *schema.GroupVersionKind, resource, namespace, name string, serverPrint bool) (runtime.Object, error) // List resources List(resource, namespace string, options *metav1.ListOptions, serverPrint bool) (runtime.Object, error) // Update resource Replace(namespace string, overwrite bool, obj runtime.RawExtension) (runtime.Object, error) // Patch resource Patch(namespace, name string, gvk schema.GroupVersionKind, pt types.PatchType, data []byte) (runtime.Object, error) // KindFor returns kind of a resource KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error) }
KubeControlInterface to call kubernetes api
type Mapper ¶
type Mapper struct {
// contains filtered or unexported fields
}
Mapper is a struct to define resource mapping
func NewFakeMapper ¶
func NewFakeMapper(resources []*restmapper.APIGroupResources) *Mapper
NewFakeMapper is helper function to create fake mapper
func NewMapper ¶
func NewMapper(discoveryclient discovery.CachedDiscoveryInterface, stopCh <-chan struct{}) *Mapper
NewMapper is to create the mapper struct
func (*Mapper) Mapper ¶
func (p *Mapper) Mapper() meta.RESTMapper
func (*Mapper) MappingFor ¶
func (p *Mapper) MappingFor(resourceOrKindArg string) (*meta.RESTMapping, error)
MappingFor returns the RESTMapping for the Kind given, or the Kind referenced by the resource. Prefers a fully specified GroupVersionResource match. If one is not found, we match on a fully specified GroupVersionKind, or fallback to a match on GroupKind.
func (*Mapper) MappingForGVK ¶
func (p *Mapper) MappingForGVK(gvk schema.GroupVersionKind) (*meta.RESTMapping, error)
MappingForGVK returns the RESTMapping for a gvk
Click to show internal directories.
Click to hide internal directories.