Documentation ¶
Index ¶
- func ListAllNamespaces(ctx context.Context, client Client) ([]*v1.Namespace, error)
- func ListAllOfSpecifiedType(resourceType schema.GroupVersionResource, ctx context.Context, client Client) ([]*uns.Unstructured, error)
- type Client
- type ClusterClient
- type OperatorClient
- type OperatorClusterClient
- func (c *OperatorClusterClient) AddCustomInformer(inf cache.SharedInformer)
- func (c *OperatorClusterClient) CRClient() crclient.Client
- func (c *OperatorClusterClient) Config() *rest.Config
- func (c *OperatorClusterClient) Dynamic() dynamic.Interface
- func (c *OperatorClusterClient) HostPort() (string, string)
- func (c *OperatorClusterClient) Kubernetes() kubernetes.Interface
- func (c *OperatorClusterClient) OpenshiftOperatorClient() *osoperclient.Clientset
- func (c *OperatorClusterClient) OperatorHelperClient() operatorv1helpers.OperatorClient
- func (c *OperatorClusterClient) RESTMapper() meta.RESTMapper
- func (c *OperatorClusterClient) Scheme() *runtime.Scheme
- func (c *OperatorClusterClient) Start(ctx context.Context) error
- type OperatorHelperClient
- func (c *OperatorHelperClient) GetObjectMeta() (*metav1.ObjectMeta, error)
- func (c *OperatorHelperClient) GetOperatorState() (*operatorv1.OperatorSpec, *operatorv1.OperatorStatus, string, error)
- func (c *OperatorHelperClient) Informer() cache.SharedIndexInformer
- func (c *OperatorHelperClient) UpdateOperatorSpec(ctx context.Context, resourceVersion string, spec *operatorv1.OperatorSpec) (*operatorv1.OperatorSpec, string, error)
- func (c *OperatorHelperClient) UpdateOperatorStatus(ctx context.Context, resourceVersion string, status *operatorv1.OperatorStatus) (*operatorv1.OperatorStatus, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListAllNamespaces ¶
func ListAllOfSpecifiedType ¶
func ListAllOfSpecifiedType(resourceType schema.GroupVersionResource, ctx context.Context, client Client) ([]*uns.Unstructured, error)
for use with dynamic client
Types ¶
type Client ¶
type Client interface { // Clients returns all known cluster clietns. Clients() map[string]ClusterClient // ClientFor returns the ClusterClient for a given named cluster. ClientFor(name string) ClusterClient // Default returns the "default" cluster's Client. This is probably what you want. Default() ClusterClient // Start may start all informers for all clients, if applicable. Start(context.Context) error }
Client holds all apiserver connections.
type ClusterClient ¶
type ClusterClient interface { // Kuberetes returns the typed Kubernetes client Kubernetes() kubernetes.Interface // OpenshiftOperatorClient returns the clientset for operator.openshift.io OpenshiftOperatorClient() *osoperclient.Clientset // Config returns the clients rest config Config() *rest.Config // Dynamic returns an untyped, dynamic client. Dynamic() dynamic.Interface // CRClient returns the controller-runtime client, another untyped client CRClient() crclient.Client // RESTMapper returns this cluster's RESTMapper, a mapping from type to api resource RESTMapper() meta.RESTMapper Scheme() *runtime.Scheme // OpenshiftOperatorClient returns the clientset for operator.openshift.io OperatorHelperClient() operatorv1helpers.OperatorClient // HostPort returns the host and port, as a string, of this connection HostPort() (string, string) AddCustomInformer(inf cache.SharedInformer) }
ClusterClient is the connection to a single cluster / apiserver. It exposes various "clients" to this single apiserver.
type OperatorClient ¶
type OperatorClient struct {
// contains filtered or unexported fields
}
func (*OperatorClient) ClientFor ¶
func (c *OperatorClient) ClientFor(name string) ClusterClient
ClientFor returns a ClusterClient reference based on the name provided, if name is empty returns the default ClusterClient
func (*OperatorClient) Clients ¶
func (c *OperatorClient) Clients() map[string]ClusterClient
func (*OperatorClient) Default ¶
func (c *OperatorClient) Default() ClusterClient
type OperatorClusterClient ¶
type OperatorClusterClient struct {
// contains filtered or unexported fields
}
OperatorClusterClient is a bag of holding for object clients & informers. It is generally responsible for managing informer lifecycle.
int 5, wis 2, dex 10, cha 6
func NewClusterClient ¶
func NewClusterClient(cfg, protocfg *rest.Config) (*OperatorClusterClient, error)
func (*OperatorClusterClient) AddCustomInformer ¶
func (c *OperatorClusterClient) AddCustomInformer(inf cache.SharedInformer)
AddCustomInformer adds any informers not created by the factory to the ClusterClient lifecycle management.
Example for a label-selected ConfigMap watch:
c.AddCustomInformer(
v1coreinformers.NewFilteredServiceInformer( c.Kubernetes(), kapi.NamespaceAll, 5 * time.Minute, // resync Period cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, func(options *metav1.ListOptions) { // use k8s.io/apimachinery/pkg/labels for more sophisticated selectors options.LabelSelector = "operator.example.dev/mylabel=myval" }))
func (*OperatorClusterClient) CRClient ¶
func (c *OperatorClusterClient) CRClient() crclient.Client
func (*OperatorClusterClient) Config ¶
func (c *OperatorClusterClient) Config() *rest.Config
func (*OperatorClusterClient) Dynamic ¶
func (c *OperatorClusterClient) Dynamic() dynamic.Interface
Dynamic returns an untyped, dynamic client.
func (*OperatorClusterClient) HostPort ¶
func (c *OperatorClusterClient) HostPort() (string, string)
URL returns the host and port of the apiserver endpoint for this client
func (*OperatorClusterClient) Kubernetes ¶
func (c *OperatorClusterClient) Kubernetes() kubernetes.Interface
func (*OperatorClusterClient) OpenshiftOperatorClient ¶
func (c *OperatorClusterClient) OpenshiftOperatorClient() *osoperclient.Clientset
OpenshiftOperatorClient returns the clientset for operator.openshift.io
func (*OperatorClusterClient) OperatorHelperClient ¶
func (c *OperatorClusterClient) OperatorHelperClient() operatorv1helpers.OperatorClient
OperatorHelperClient returns an implementation of the v1helpers.OperatorClient interface for use by the library-go controllers.
func (*OperatorClusterClient) RESTMapper ¶
func (c *OperatorClusterClient) RESTMapper() meta.RESTMapper
func (*OperatorClusterClient) Scheme ¶
func (c *OperatorClusterClient) Scheme() *runtime.Scheme
type OperatorHelperClient ¶
type OperatorHelperClient struct {
// contains filtered or unexported fields
}
OperatorHelperClient is used by the generic library-go operator controllers; it provides accessors to the operator state.
func (*OperatorHelperClient) GetObjectMeta ¶
func (c *OperatorHelperClient) GetObjectMeta() (*metav1.ObjectMeta, error)
func (*OperatorHelperClient) GetOperatorState ¶
func (c *OperatorHelperClient) GetOperatorState() (*operatorv1.OperatorSpec, *operatorv1.OperatorStatus, string, error)
func (*OperatorHelperClient) Informer ¶
func (c *OperatorHelperClient) Informer() cache.SharedIndexInformer
func (*OperatorHelperClient) UpdateOperatorSpec ¶
func (c *OperatorHelperClient) UpdateOperatorSpec(ctx context.Context, resourceVersion string, spec *operatorv1.OperatorSpec) (*operatorv1.OperatorSpec, string, error)
func (*OperatorHelperClient) UpdateOperatorStatus ¶
func (c *OperatorHelperClient) UpdateOperatorStatus(ctx context.Context, resourceVersion string, status *operatorv1.OperatorStatus) (*operatorv1.OperatorStatus, error)