Documentation
¶
Index ¶
- type CRDClient
- type CRDInterface
- type CRDWrapper
- type CRDWrapperConfig
- type Config
- type Set
- func (c *Set) APIExtensionsV1() apiextensionsv1.ApiextensionsV1Interface
- func (c *Set) CRD(cfg CRDWrapperConfig) CRDInterface
- func (c *Set) Dynamic() dynamic.Interface
- func (c *Set) HTTPClient() *http.Client
- func (c *Set) Kubernetes() kubernetes.Interface
- func (c *Set) Metadata() metadata.Interface
- func (c *Set) RESTConfig() *rest.Config
- func (c *Set) RESTMapper() meta.RESTMapper
- func (c *Set) SetRESTMapper(restMapper meta.RESTMapper)
- func (c *Set) WithImpersonation(user string) (SetInterface, error)
- type SetInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CRDClient ¶
type CRDClient interface {
// EnsureCreated ensures a CRD exists and is ready
Ensure(ctx context.Context, crd v1.CustomResourceDefinition, allowBreakingChanges bool) error
// Delete removes a CRD if it exists
Delete(ctx context.Context, name string) error
// Get retrieves a CRD by name
Get(ctx context.Context, name string) (*v1.CustomResourceDefinition, error)
}
CRDClient represents operations for managing CustomResourceDefinitions
type CRDInterface ¶
type CRDInterface interface {
// Ensure ensures a CRD exists, up-to-date, and is ready. This can be
// a dangerous operation as it will update the CRD if it already exists.
//
// If allowBreakingChanges is false and the update contains breaking schema
// changes, an error is returned. Set to true to force the update anyway.
Ensure(ctx context.Context, crd v1.CustomResourceDefinition, allowBreakingChanges bool) error
// Get retrieves a CRD by name
Get(ctx context.Context, name string) (*v1.CustomResourceDefinition, error)
// Delete removes a CRD if it exists
Delete(ctx context.Context, name string) error
}
CRDInterface provides a simplified interface for CRD operations
type CRDWrapper ¶
type CRDWrapper struct {
// contains filtered or unexported fields
}
CRDWrapper provides a simplified interface for CRD operations
func (*CRDWrapper) Delete ¶
func (w *CRDWrapper) Delete(ctx context.Context, name string) error
Delete removes a CRD if it exists
func (*CRDWrapper) Ensure ¶
func (w *CRDWrapper) Ensure(ctx context.Context, desired v1.CustomResourceDefinition, allowBreakingChanges bool) error
Ensure ensures a CRD exists, up-to-date, and is ready. This can be a dangerous operation as it will update the CRD if it already exists.
If a CRD does exist, it will compare the existing CRD with the desired CRD and update it if necessary. If the existing CRD has breaking changes and allowBreakingChanges is false, it will return an error.
func (*CRDWrapper) Get ¶
func (w *CRDWrapper) Get(ctx context.Context, name string) (*v1.CustomResourceDefinition, error)
Get retrieves a CRD by name
type CRDWrapperConfig ¶
type CRDWrapperConfig struct {
Client apiextensionsv1.ApiextensionsV1Interface
PollInterval time.Duration
Timeout time.Duration
}
CRDWrapperConfig contains configuration for the CRD wrapper
func DefaultCRDWrapperConfig ¶
func DefaultCRDWrapperConfig() CRDWrapperConfig
DefaultConfig returns a CRDWrapperConfig with default values
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set provides a unified interface for different Kubernetes clients
func (*Set) APIExtensionsV1 ¶
func (c *Set) APIExtensionsV1() apiextensionsv1.ApiextensionsV1Interface
APIExtensionsV1 returns the API extensions client
func (*Set) CRD ¶
func (c *Set) CRD(cfg CRDWrapperConfig) CRDInterface
CRD returns a new CRDInterface instance
func (*Set) HTTPClient ¶
func (*Set) Kubernetes ¶
func (c *Set) Kubernetes() kubernetes.Interface
Kubernetes returns the standard Kubernetes clientset
func (*Set) RESTConfig ¶
RESTConfig returns a copy of the underlying REST config
func (*Set) RESTMapper ¶
func (c *Set) RESTMapper() meta.RESTMapper
RESTMapper returns the REST mapper
func (*Set) SetRESTMapper ¶
func (c *Set) SetRESTMapper(restMapper meta.RESTMapper)
SetRESTMapper sets the REST mapper for the client
func (*Set) WithImpersonation ¶
func (c *Set) WithImpersonation(user string) (SetInterface, error)
WithImpersonation returns a new client that impersonates the given user
type SetInterface ¶
type SetInterface interface {
HTTPClient() *http.Client
// Kubernetes returns the standard Kubernetes clientset
Kubernetes() kubernetes.Interface
// Dynamic returns the dynamic client
Dynamic() dynamic.Interface
// APIExtensionsV1 returns the API extensions client
APIExtensionsV1() apiextensionsv1.ApiextensionsV1Interface
// RESTConfig returns a copy of the underlying REST config
RESTConfig() *rest.Config
// CRD returns a new CRDInterface instance
CRD(cfg CRDWrapperConfig) CRDInterface
// WithImpersonation returns a new client that impersonates the given user
WithImpersonation(user string) (SetInterface, error)
RESTMapper() meta.RESTMapper
SetRESTMapper(restMapper meta.RESTMapper)
}
SetInterface provides a unified interface for different Kubernetes clients