Documentation
¶
Index ¶
- Constants
- func ExternalConfig() (*rest.Config, error)
- func HomeDir() string
- func NewDynamicClient() (dynamic.Interface, error)
- type Client
- type ClusterClient
- func (w *ClusterClient) Create(obj runtime.Object) error
- func (w *ClusterClient) Delete(obj runtime.Object, opts ...client.DeleteOption) error
- func (w *ClusterClient) Get(key client.ObjectKey, obj runtime.Object) error
- func (w *ClusterClient) List(opts *client.ListOptions, list runtime.Object) error
- func (w *ClusterClient) Update(obj runtime.Object) error
- func (w *ClusterClient) WithContext(ctx context.Context) Client
- 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)
- func (w *ClusterDynamicClient) WithContext(ctx context.Context) DClient
- func (w *ClusterDynamicClient) WithNamespace(namespace string) DClient
- func (w *ClusterDynamicClient) WithResource(resource schema.GroupVersionResource) DClient
- type DClient
Constants ¶
const DefaultTimeout = 1 * time.Minute
DefaultTimeout is a reasonable timeout to use with the Client.
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.
func NewDynamicClient ¶
NewDynamicClient returns the dynamic interface.
Types ¶
type Client ¶
type Client interface { // WithContext returns a client configured to use the provided context on // subsequent requests, instead of one created from the preconfigured timeout. WithContext(ctx context.Context) Client // Get wraps a controller-runtime client.Get call with a context. Get(key client.ObjectKey, obj runtime.Object) error // List wraps a controller-runtime client.List call with a context. List(opts *client.ListOptions, list runtime.Object) error // Create wraps a controller-runtime client.Create call with a context. Create(obj runtime.Object) error // Delete wraps a controller-runtime client.Delete call with a context. Delete(obj runtime.Object, opts ...client.DeleteOption) error // Update wraps a controller-runtime client.Update call with a context. Update(obj runtime.Object) error }
Client wraps a controller-runtime client to use a default context with a timeout if no context is passed.
type ClusterClient ¶
type ClusterClient struct {
// contains filtered or unexported fields
}
func (*ClusterClient) Create ¶
func (w *ClusterClient) Create(obj runtime.Object) error
Create wraps a controller-runtime client.Create call with a context.
func (*ClusterClient) Delete ¶
func (w *ClusterClient) Delete(obj runtime.Object, opts ...client.DeleteOption) error
Delete wraps a controller-runtime client.Delete call with a context.
func (*ClusterClient) List ¶
func (w *ClusterClient) List(opts *client.ListOptions, list runtime.Object) error
List wraps a controller-runtime client.List call with a context.
func (*ClusterClient) Update ¶
func (w *ClusterClient) Update(obj runtime.Object) error
Update wraps a controller-runtime client.Update call with a context.
func (*ClusterClient) WithContext ¶
func (w *ClusterClient) WithContext(ctx context.Context) Client
WithContext returns a client configured to use the provided context on subsequent requests, instead of one created from the preconfigured timeout.
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.
func (*ClusterDynamicClient) WithContext ¶
func (w *ClusterDynamicClient) WithContext(ctx context.Context) DClient
WithContext returns a client with context.
func (*ClusterDynamicClient) WithNamespace ¶
func (w *ClusterDynamicClient) WithNamespace(namespace string) DClient
WithNamespace returns a client with namespace.
func (*ClusterDynamicClient) WithResource ¶
func (w *ClusterDynamicClient) WithResource(resource schema.GroupVersionResource) DClient
WithResource returns a client with resource.
type DClient ¶
type DClient interface { WithResource(resource schema.GroupVersionResource) DClient WithNamespace(namespace string) DClient WithContext(ctx context.Context) DClient 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.
func WrapDClient ¶
WrapDClient returns a Dynamic Client.