Documentation ¶
Index ¶
- func SetGVKFromScheme(object runtime.Object, scheme *runtime.Scheme) error
- type Client
- func (c *Client) CreateNamespace(namespace, manifest string) error
- func (c *Client) DeleteInstance(instanceName, namespace string) error
- func (c *Client) GetChildInstances(parent *kudoapi.Instance) ([]kudoapi.Instance, error)
- func (c *Client) GetInstance(name, namespace string) (*kudoapi.Instance, error)
- func (c *Client) GetOperator(name, namespace string) (*kudoapi.Operator, error)
- func (c *Client) GetOperatorVersion(name, namespace string) (*kudoapi.OperatorVersion, error)
- func (c *Client) InstallInstanceObjToCluster(obj *kudoapi.Instance, namespace string) (*kudoapi.Instance, error)
- func (c *Client) InstallOperatorObjToCluster(obj *kudoapi.Operator, namespace string) (*kudoapi.Operator, error)
- func (c *Client) InstallOperatorVersionObjToCluster(obj *kudoapi.OperatorVersion, namespace string) (*kudoapi.OperatorVersion, error)
- func (c *Client) InstanceExistsInCluster(operatorName, namespace, version, instanceName string) (bool, error)
- func (c *Client) IsInstanceByNameDone(name string, namespace string, oldInstance *kudoapi.Instance) (bool, error)
- func (c *Client) IsInstanceDone(instance, oldInstance *kudoapi.Instance) (bool, error)
- func (c *Client) ListInstancesAsRuntimeObject(namespace string) ([]runtime.Object, error)
- func (c *Client) ListOperatorVersions(namespace string) ([]kudoapi.OperatorVersion, error)
- func (c *Client) ListOperatorVersionsAsRuntimeObject(namespace string) ([]runtime.Object, error)
- func (c *Client) ListOperatorsAsRuntimeObject(namespace string) ([]runtime.Object, error)
- func (c *Client) OperatorExistsInCluster(name, namespace string) bool
- func (c *Client) OperatorVersionExistsInCluster(name, namespace string) bool
- func (c *Client) OperatorVersionsInstalled(operatorName, namespace string) ([]string, error)
- func (c *Client) UpdateInstance(instanceName, namespace string, operatorVersion *string, ...) error
- func (c *Client) ValidateServerForOperator(operator *kudoapi.Operator) error
- func (c *Client) VerifyServedCRDs(kubeClient *kube.Client) error
- func (c *Client) WaitForInstance(name, namespace string, oldInstance *kudoapi.Instance, timeout time.Duration) error
- func (c *Client) WaitForInstanceDeleted(name, namespace string, timeout time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetGVKFromScheme ¶ added in v0.15.0
Populate the GVK from scheme, since it is cleared by design on typed objects. https://github.com/kubernetes/client-go/issues/413
Types ¶
type Client ¶
type Client struct { KubeClientset kubernetes.Interface // contains filtered or unexported fields }
Client is a KUDO Client providing access to a kudo clientset and kubernetes clientsets
func NewClientForConfig ¶ added in v0.16.0
NewClient creates new KUDO Client
func NewClientFromK8s ¶ added in v0.3.2
func NewClientFromK8s(kudo versioned.Interface, kube kubernetes.Interface) *Client
NewClientFromK8s creates KUDO client from kubernetes client interface
func (*Client) CreateNamespace ¶ added in v0.14.0
func (*Client) DeleteInstance ¶ added in v0.8.0
DeleteInstance deletes an instance.
func (*Client) GetChildInstances ¶ added in v0.15.0
GetChildInstances returns all instances that were created as dependencies of a parent instance
func (*Client) GetInstance ¶ added in v0.5.0
GetInstance queries kubernetes api for instance of given name in given namespace returns error for error conditions. Instance not found is not considered an error and will result in 'nil, nil'
func (*Client) GetOperator ¶ added in v0.15.0
GetOperatorVersion queries kubernetes api for operator of given name in given namespace returns error for all other errors that not found, not found is treated as result being 'nil, nil'
func (*Client) GetOperatorVersion ¶ added in v0.5.0
func (c *Client) GetOperatorVersion(name, namespace string) (*kudoapi.OperatorVersion, error)
GetOperatorVersion queries kubernetes api for operatorversion of given name in given namespace returns error for all other errors that not found, not found is treated as result being 'nil, nil'
func (*Client) InstallInstanceObjToCluster ¶
func (c *Client) InstallInstanceObjToCluster(obj *kudoapi.Instance, namespace string) (*kudoapi.Instance, error)
InstallInstanceObjToCluster expects a valid Instance obj to install
func (*Client) InstallOperatorObjToCluster ¶ added in v0.3.0
func (c *Client) InstallOperatorObjToCluster(obj *kudoapi.Operator, namespace string) (*kudoapi.Operator, error)
InstallOperatorObjToCluster expects a valid Operator obj to install
func (*Client) InstallOperatorVersionObjToCluster ¶ added in v0.3.0
func (c *Client) InstallOperatorVersionObjToCluster(obj *kudoapi.OperatorVersion, namespace string) (*kudoapi.OperatorVersion, error)
InstallOperatorVersionObjToCluster expects a valid Operator obj to install
func (*Client) InstanceExistsInCluster ¶ added in v0.3.0
func (c *Client) InstanceExistsInCluster(operatorName, namespace, version, instanceName string) (bool, error)
InstanceExistsInCluster checks if any OperatorVersion object matches to the given Operator name in the cluster. An Instance has two identifiers:
- Spec.OperatorVersion.Name spec: operatorVersion: name: kafka-2.11-2.4.0
- LabelSelector metadata: creationTimestamp: "2019-02-28T14:39:20Z" generation: 1 labels: kudo.dev/operator: kafka
This function also just returns true if the Instance matches a specific OperatorVersion of an Operator
func (*Client) IsInstanceByNameDone ¶ added in v0.13.0
func (c *Client) IsInstanceByNameDone(name string, namespace string, oldInstance *kudoapi.Instance) (bool, error)
IsInstanceByNameDone provides a check on instance based on name to see if it is "finished" without retries returns true if finished otherwise false oldInstance is nil if there is no previous instance
func (*Client) IsInstanceDone ¶ added in v0.13.0
IsInstanceDone provides a check on instance to see if it is "finished" without retries oldInstance is nil if there is no previous instance
func (*Client) ListInstancesAsRuntimeObject ¶ added in v0.17.0
ListInstancesAsRuntimeObject lists all instances installed in the cluster in a given ns
func (*Client) ListOperatorVersions ¶ added in v0.17.0
func (c *Client) ListOperatorVersions(namespace string) ([]kudoapi.OperatorVersion, error)
func (*Client) ListOperatorVersionsAsRuntimeObject ¶ added in v0.17.0
ListOperatorVersionsAsRuntimeObject lists all operatorversions installed in the cluster in a given ns
func (*Client) ListOperatorsAsRuntimeObject ¶ added in v0.17.0
ListOperatorsAsRuntimeObject lists all operators installed in the cluster in a given ns
func (*Client) OperatorExistsInCluster ¶ added in v0.3.0
OperatorExistsInCluster checks if a given Operator object is installed on the current k8s cluster
func (*Client) OperatorVersionExistsInCluster ¶ added in v0.15.0
OperatorVersionExistsInCluster checks if a given OperatorVersion object is installed on the current k8s cluster
func (*Client) OperatorVersionsInstalled ¶ added in v0.4.0
OperatorVersionsInstalled lists all the versions of given operator installed in the cluster in given ns
func (*Client) UpdateInstance ¶ added in v0.5.0
func (c *Client) UpdateInstance(instanceName, namespace string, operatorVersion *string, parameters map[string]string, triggeredPlan *string, wait bool, waitTime time.Duration) error
UpdateInstance updates operatorversion on instance
func (*Client) ValidateServerForOperator ¶ added in v0.7.0
ValidateServerForOperator validates that the k8s server version and kudo version are valid for operator error message will provide detail of failure, otherwise nil
func (*Client) VerifyServedCRDs ¶ added in v0.17.0
func (*Client) WaitForInstance ¶ added in v0.13.0
func (c *Client) WaitForInstance(name, namespace string, oldInstance *kudoapi.Instance, timeout time.Duration) error
WaitForInstance waits for instance to be "complete". It uses controller-runtime `wait.PollImmediate`, the function passed to it returns done==false if it isn't done. For a situation where there is no previous state (like install), the "lastPlanStatus" will be nil until the manager sets it, then it's state will be watched (see InInstanceDone for more detail) For a situation where there is previous state (like update, upgrade, plan trigger) than it is important AND required that the "oldInstance" be provided. Without it, it is possible for this function to be "racy" and "flaky" meaning the "current" status could be the old "done" status or the new status... it's hard to know. If the oldInstance is provided the wait will then initially wait for the "new" plan to activate then return when completed. The error is either an error in working with kubernetes or a wait.ErrWaitTimeout