Documentation ¶
Index ¶
- Constants
- func ExternalConfig() (*rest.Config, error)
- func HomeDir() string
- type ClusterDynamicClient
- func (w *ClusterDynamicClient) Create(obj *unstructured.Unstructured, options metav1.CreateOptions, ...) (*unstructured.Unstructured, error)
- func (w *ClusterDynamicClient) Delete(name string, options metav1.DeleteOptions, subresources ...string) error
- func (w *ClusterDynamicClient) DeleteCollection(options metav1.DeleteOptions, listOptions metav1.ListOptions) error
- func (w *ClusterDynamicClient) Get(name string, options metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error)
- func (w *ClusterDynamicClient) List(opts metav1.ListOptions) (*unstructured.UnstructuredList, error)
- func (w *ClusterDynamicClient) Patch(name string, pt types.PatchType, data []byte, options metav1.PatchOptions, ...) (*unstructured.Unstructured, error)
- func (w *ClusterDynamicClient) Update(obj *unstructured.Unstructured, options metav1.UpdateOptions, ...) (*unstructured.Unstructured, error)
- func (w *ClusterDynamicClient) UpdateStatus(obj *unstructured.Unstructured, options metav1.UpdateOptions) (*unstructured.Unstructured, error)
- func (w *ClusterDynamicClient) Watch(opts metav1.ListOptions) (watch.Interface, error)
- type CtrlOptions
- type DClient
- type DynamicClientOption
- type DynamicClientOptions
- type DynamicClientWrapper
- type Option
Constants ¶
const (
// HarborClusterNameLabel contains the harbor cluster name of the cr.
HarborClusterNameLabel = "goharbor.io/harbor-cluster"
)
Variables ¶
This section is empty.
Functions ¶
func ExternalConfig ¶
ExternalConfig returns a config object which uses the service account kubernetes gives to pods.
Types ¶
type ClusterDynamicClient ¶
type ClusterDynamicClient struct {
// contains filtered or unexported fields
}
func (*ClusterDynamicClient) Create ¶
func (w *ClusterDynamicClient) Create(obj *unstructured.Unstructured, options metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error)
Create wraps a client-go dynamic.Create call with a context.
func (*ClusterDynamicClient) Delete ¶
func (w *ClusterDynamicClient) Delete(name string, options metav1.DeleteOptions, subresources ...string) error
Delete wraps a client-go dynamic.Delete call with a context.
func (*ClusterDynamicClient) DeleteCollection ¶
func (w *ClusterDynamicClient) DeleteCollection(options metav1.DeleteOptions, listOptions metav1.ListOptions) error
DeleteCollection wraps a client-go dynamic.DeleteCollection call with a context.
func (*ClusterDynamicClient) Get ¶
func (w *ClusterDynamicClient) Get(name string, options metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error)
Get wraps a client-go dynamic.Get call with a context.
func (*ClusterDynamicClient) List ¶
func (w *ClusterDynamicClient) List(opts metav1.ListOptions) (*unstructured.UnstructuredList, error)
Get wraps a client-go dynamic.Get call with a context.
func (*ClusterDynamicClient) Patch ¶
func (w *ClusterDynamicClient) Patch(name string, pt types.PatchType, data []byte, options metav1.PatchOptions, subresources ...string) (*unstructured.Unstructured, error)
Patch wraps a client-go dynamic.Patch call with a context.
func (*ClusterDynamicClient) Update ¶
func (w *ClusterDynamicClient) Update(obj *unstructured.Unstructured, options metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error)
Update wraps a client-go dynamic.Update call with a context.
func (*ClusterDynamicClient) UpdateStatus ¶
func (w *ClusterDynamicClient) UpdateStatus(obj *unstructured.Unstructured, options metav1.UpdateOptions) (*unstructured.Unstructured, error)
UpdateStatus wraps a client-go dynamic.UpdateStatus call with a context.
func (*ClusterDynamicClient) Watch ¶
func (w *ClusterDynamicClient) Watch(opts metav1.ListOptions) (watch.Interface, error)
Watch wraps a client-go dynamic.Watch call with a context.
type CtrlOptions ¶
type DClient ¶
type DClient interface { Create(obj *unstructured.Unstructured, options metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error) Update(obj *unstructured.Unstructured, options metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error) Delete(name string, options metav1.DeleteOptions, subresources ...string) error Get(name string, options metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error) List(opts metav1.ListOptions) (*unstructured.UnstructuredList, error) }
DClient wraps a client-go dynamic.
type DynamicClientOption ¶
type DynamicClientOption func(opt *DynamicClientOptions)
DynamicClientOption is option template.
func WithResource ¶
func WithResource(resource schema.GroupVersionResource) DynamicClientOption
WithResource option.
type DynamicClientOptions ¶
type DynamicClientOptions struct { // Resource namespace Namespace string // Resource schema Resource schema.GroupVersionResource }
DynamicClientOptions provide options for initializing ClusterDynamicClient.
type DynamicClientWrapper ¶
type DynamicClientWrapper struct {
// contains filtered or unexported fields
}
DynamicClientWrapper wraps the dynamic client to DClient.
func DynamicClient ¶
func DynamicClient() (*DynamicClientWrapper, error)
DynamicClient returns a dynamic client wrapper.
func (*DynamicClientWrapper) DynamicClient ¶
func (d *DynamicClientWrapper) DynamicClient(ctx context.Context, options ...DynamicClientOption) DClient
DynamicClient returns a DClient copy. Required options: WithResource and WithNamespace.
func (*DynamicClientWrapper) RawClient ¶
func (d *DynamicClientWrapper) RawClient() dynamic.Interface
RawClient returns the used dynamic.Interface.
type Option ¶
type Option func(ops *CtrlOptions)
func WithClient ¶
func WithConfigStore ¶
func WithConfigStore(store *configstore.Store) Option
func WithDClient ¶
func WithDClient(dClient *DynamicClientWrapper) Option