Documentation ¶
Overview ¶
Package client TODO
Package client ...
Index ¶
- Constants
- func DescribeEvents(el *corev1.EventList, w PrefixWriter)
- type Client
- func (c *Client) ApplyFile(fileBytes []byte) error
- func (c *Client) ApplyObject(obj runtime.Object) error
- func (c *Client) ClusterName() string
- func (c *Client) CreateNamespace(name string) error
- func (c *Client) CreateOperatorGroup(ctx context.Context, namespace, name string) (*v1.OperatorGroup, error)
- func (c *Client) CreateSubscriptionForCatalog(ctx context.Context, ...) (*v1alpha1.Subscription, error)
- func (c *Client) DeleteAllMonitoringResources(ctx context.Context, namespace string) error
- func (c *Client) DeleteFile(fileBytes []byte) error
- func (c *Client) DeleteObject(obj runtime.Object) error
- func (c *Client) DeletePod(ctx context.Context, namespace, name string) error
- func (c Client) DoCSVWait(ctx context.Context, key types.NamespacedName) error
- func (c *Client) DoPackageWait(ctx context.Context, name string) error
- func (c Client) DoRolloutWait(ctx context.Context, key types.NamespacedName) error
- func (c *Client) GenerateKubeConfigWithToken(user string, secret *corev1.Secret) ([]byte, error)
- func (c *Client) GetClusterServiceVersion(ctx context.Context, key types.NamespacedName) (*v1alpha1.ClusterServiceVersion, error)
- func (c *Client) GetDatabaseCluster(ctx context.Context, name string) (*everestv1alpha1.DatabaseCluster, error)
- func (c *Client) GetDeployment(ctx context.Context, name string, namespace string) (*appsv1.Deployment, error)
- func (c *Client) GetEvents(ctx context.Context, name string) (string, error)
- func (c *Client) GetInstallPlan(ctx context.Context, namespace string, name string) (*v1alpha1.InstallPlan, error)
- func (c *Client) GetLogs(ctx context.Context, pod, container string) (string, error)
- func (c *Client) GetNamespace(ctx context.Context, name string) (*corev1.Namespace, error)
- func (c *Client) GetNodes(ctx context.Context) (*corev1.NodeList, error)
- func (c *Client) GetOperatorGroup(ctx context.Context, namespace, name string) (*v1.OperatorGroup, error)
- func (c *Client) GetPackageManifest(ctx context.Context, name string) (*packagev1.PackageManifest, error)
- func (c *Client) GetPersistentVolumes(ctx context.Context) (*corev1.PersistentVolumeList, error)
- func (c *Client) GetPods(ctx context.Context, namespace string, labelSelector *metav1.LabelSelector) (*corev1.PodList, error)
- func (c *Client) GetSecret(ctx context.Context, name, namespace string) (*corev1.Secret, error)
- func (c *Client) GetSecretsForServiceAccount(ctx context.Context, accountName string) (*corev1.Secret, error)
- func (c *Client) GetServerVersion() (*version.Info, error)
- func (c *Client) GetStorageClasses(ctx context.Context) (*storagev1.StorageClassList, error)
- func (c *Client) GetSubscription(ctx context.Context, namespace, name string) (*v1alpha1.Subscription, error)
- func (c Client) GetSubscriptionCSV(ctx context.Context, subKey types.NamespacedName) (types.NamespacedName, error)
- func (c *Client) ListCRDs(ctx context.Context, labelSelector *metav1.LabelSelector) (*apiextv1.CustomResourceDefinitionList, error)
- func (c *Client) ListCRs(ctx context.Context, namespace string, gvr schema.GroupVersionResource, ...) (*unstructured.UnstructuredList, error)
- func (c *Client) ListClusterServiceVersion(ctx context.Context, namespace string) (*v1alpha1.ClusterServiceVersionList, error)
- func (c *Client) ListDatabaseClusters(ctx context.Context) (*everestv1alpha1.DatabaseClusterList, error)
- func (c *Client) ListDeployments(ctx context.Context, namespace string) (*appsv1.DeploymentList, error)
- func (c *Client) ListPods(ctx context.Context, namespace string, options metav1.ListOptions) (*corev1.PodList, error)
- func (c *Client) ListSecrets(ctx context.Context) (*corev1.SecretList, error)
- func (c *Client) ListSubscriptions(ctx context.Context, namespace string) (*v1alpha1.SubscriptionList, error)
- func (c *Client) UpdateInstallPlan(ctx context.Context, namespace string, installPlan *v1alpha1.InstallPlan) (*v1alpha1.InstallPlan, error)
- type Cluster
- type ClusterInfo
- type Config
- type Context
- type ContextInfo
- type KubeClientConnector
- type MockKubeClientConnector
- func (_m *MockKubeClientConnector) ApplyFile(fileBytes []byte) error
- func (_m *MockKubeClientConnector) ApplyObject(obj runtime.Object) error
- func (_m *MockKubeClientConnector) ClusterName() string
- func (_m *MockKubeClientConnector) CreateNamespace(name string) error
- func (_m *MockKubeClientConnector) CreateOperatorGroup(ctx context.Context, namespace string, name string) (*v1.OperatorGroup, error)
- func (_m *MockKubeClientConnector) CreateSubscriptionForCatalog(ctx context.Context, namespace string, name string, catalogNamespace string, ...) (*v1alpha1.Subscription, error)
- func (_m *MockKubeClientConnector) DeleteAllMonitoringResources(ctx context.Context, namespace string) error
- func (_m *MockKubeClientConnector) DeleteFile(fileBytes []byte) error
- func (_m *MockKubeClientConnector) DeleteObject(obj runtime.Object) error
- func (_m *MockKubeClientConnector) DeletePod(ctx context.Context, namespace string, name string) error
- func (_m *MockKubeClientConnector) DoCSVWait(ctx context.Context, key types.NamespacedName) error
- func (_m *MockKubeClientConnector) DoPackageWait(ctx context.Context, name string) error
- func (_m *MockKubeClientConnector) DoRolloutWait(ctx context.Context, key types.NamespacedName) error
- func (_m *MockKubeClientConnector) GenerateKubeConfigWithToken(user string, secret *corev1.Secret) ([]byte, error)
- func (_m *MockKubeClientConnector) GetClusterServiceVersion(ctx context.Context, key types.NamespacedName) (*v1alpha1.ClusterServiceVersion, error)
- func (_m *MockKubeClientConnector) GetDatabaseCluster(ctx context.Context, name string) (*apiv1alpha1.DatabaseCluster, error)
- func (_m *MockKubeClientConnector) GetDeployment(ctx context.Context, name string, namespace string) (*appsv1.Deployment, error)
- func (_m *MockKubeClientConnector) GetEvents(ctx context.Context, name string) (string, error)
- func (_m *MockKubeClientConnector) GetInstallPlan(ctx context.Context, namespace string, name string) (*v1alpha1.InstallPlan, error)
- func (_m *MockKubeClientConnector) GetLogs(ctx context.Context, pod string, container string) (string, error)
- func (_m *MockKubeClientConnector) GetNamespace(ctx context.Context, name string) (*corev1.Namespace, error)
- func (_m *MockKubeClientConnector) GetNodes(ctx context.Context) (*corev1.NodeList, error)
- func (_m *MockKubeClientConnector) GetOperatorGroup(ctx context.Context, namespace string, name string) (*v1.OperatorGroup, error)
- func (_m *MockKubeClientConnector) GetPackageManifest(ctx context.Context, name string) (*operatorsv1.PackageManifest, error)
- func (_m *MockKubeClientConnector) GetPersistentVolumes(ctx context.Context) (*corev1.PersistentVolumeList, error)
- func (_m *MockKubeClientConnector) GetPods(ctx context.Context, namespace string, labelSelector *metav1.LabelSelector) (*corev1.PodList, error)
- func (_m *MockKubeClientConnector) GetSecret(ctx context.Context, name string, namespace string) (*corev1.Secret, error)
- func (_m *MockKubeClientConnector) GetSecretsForServiceAccount(ctx context.Context, accountName string) (*corev1.Secret, error)
- func (_m *MockKubeClientConnector) GetServerVersion() (*version.Info, error)
- func (_m *MockKubeClientConnector) GetStorageClasses(ctx context.Context) (*storagev1.StorageClassList, error)
- func (_m *MockKubeClientConnector) GetSubscription(ctx context.Context, namespace string, name string) (*v1alpha1.Subscription, error)
- func (_m *MockKubeClientConnector) GetSubscriptionCSV(ctx context.Context, subKey types.NamespacedName) (types.NamespacedName, error)
- func (_m *MockKubeClientConnector) ListCRDs(ctx context.Context, labelSelector *metav1.LabelSelector) (*apiextensionsv1.CustomResourceDefinitionList, error)
- func (_m *MockKubeClientConnector) ListCRs(ctx context.Context, namespace string, gvr schema.GroupVersionResource, ...) (*unstructured.UnstructuredList, error)
- func (_m *MockKubeClientConnector) ListClusterServiceVersion(ctx context.Context, namespace string) (*v1alpha1.ClusterServiceVersionList, error)
- func (_m *MockKubeClientConnector) ListDatabaseClusters(ctx context.Context) (*apiv1alpha1.DatabaseClusterList, error)
- func (_m *MockKubeClientConnector) ListDeployments(ctx context.Context, namespace string) (*appsv1.DeploymentList, error)
- func (_m *MockKubeClientConnector) ListPods(ctx context.Context, namespace string, options metav1.ListOptions) (*corev1.PodList, error)
- func (_m *MockKubeClientConnector) ListSecrets(ctx context.Context) (*corev1.SecretList, error)
- func (_m *MockKubeClientConnector) ListSubscriptions(ctx context.Context, namespace string) (*v1alpha1.SubscriptionList, error)
- func (_m *MockKubeClientConnector) UpdateInstallPlan(ctx context.Context, namespace string, installPlan *v1alpha1.InstallPlan) (*v1alpha1.InstallPlan, error)
- type PrefixWriter
- type SortableEvents
- type User
- type UserInfo
Constants ¶
const ( LEVEL0 = iota LEVEL1 LEVEL2 LEVEL3 LEVEL4 )
Each level has 2 spaces for PrefixWriter.
Variables ¶
This section is empty.
Functions ¶
func DescribeEvents ¶
func DescribeEvents(el *corev1.EventList, w PrefixWriter)
DescribeEvents describes events.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the internal client for Kubernetes.
func NewFromKubeConfig ¶
func NewFromKubeConfig(kubeconfig string, l *zap.SugaredLogger) (*Client, error)
NewFromKubeConfig returns new Client from path to a kubeconfig.
func (*Client) ApplyFile ¶
ApplyFile accepts manifest file contents, parses into []runtime.Object and applies them against the cluster.
func (*Client) ApplyObject ¶
ApplyObject applies object.
func (*Client) ClusterName ¶
ClusterName returns the name of the k8s cluster.
func (*Client) CreateNamespace ¶
CreateNamespace creates a new namespace.
func (*Client) CreateOperatorGroup ¶
func (c *Client) CreateOperatorGroup(ctx context.Context, namespace, name string) (*v1.OperatorGroup, error)
CreateOperatorGroup creates an operator group to be used as part of a subscription.
func (*Client) CreateSubscriptionForCatalog ¶
func (c *Client) CreateSubscriptionForCatalog(ctx context.Context, namespace, name, catalogNamespace, catalog, packageName, channel, startingCSV string, approval v1alpha1.Approval, ) (*v1alpha1.Subscription, error)
CreateSubscriptionForCatalog creates an OLM subscription.
func (*Client) DeleteAllMonitoringResources ¶
DeleteAllMonitoringResources deletes all resources related to monitoring from k8s cluster.
func (*Client) DeleteFile ¶
DeleteFile accepts manifest file contents parses into []runtime.Object and deletes them from the cluster.
func (*Client) DeleteObject ¶
DeleteObject deletes object from the k8s cluster.
func (*Client) DeletePod ¶ added in v0.4.0
DeletePod deletes a pod by given name in the given namespace.
func (*Client) DoPackageWait ¶
DoPackageWait for the package to be available in OLM.
func (Client) DoRolloutWait ¶
DoRolloutWait waits until a deployment has been rolled out susccessfully or there is an error.
func (*Client) GenerateKubeConfigWithToken ¶
GenerateKubeConfigWithToken generates kubeconfig with a user and token provided as a secret.
func (*Client) GetClusterServiceVersion ¶
func (c *Client) GetClusterServiceVersion( ctx context.Context, key types.NamespacedName, ) (*v1alpha1.ClusterServiceVersion, error)
GetClusterServiceVersion retrieve a CSV by namespaced name.
func (*Client) GetDatabaseCluster ¶
func (c *Client) GetDatabaseCluster(ctx context.Context, name string) (*everestv1alpha1.DatabaseCluster, error)
GetDatabaseCluster returns PXC clusters by provided name.
func (*Client) GetDeployment ¶
func (c *Client) GetDeployment(ctx context.Context, name string, namespace string) (*appsv1.Deployment, error)
GetDeployment returns deployment by name.
func (*Client) GetInstallPlan ¶
func (c *Client) GetInstallPlan(ctx context.Context, namespace string, name string) (*v1alpha1.InstallPlan, error)
GetInstallPlan retrieves an OLM install plan by namespace and name.
func (*Client) GetNamespace ¶ added in v0.2.0
GetNamespace returns a namespace.
func (*Client) GetOperatorGroup ¶
func (c *Client) GetOperatorGroup(ctx context.Context, namespace, name string) (*v1.OperatorGroup, error)
GetOperatorGroup retrieves an operator group details by namespace and name.
func (*Client) GetPackageManifest ¶
func (c *Client) GetPackageManifest(ctx context.Context, name string) (*packagev1.PackageManifest, error)
GetPackageManifest returns a package manifest by given name.
func (*Client) GetPersistentVolumes ¶
GetPersistentVolumes returns Persistent Volumes available in the cluster.
func (*Client) GetPods ¶
func (c *Client) GetPods( ctx context.Context, namespace string, labelSelector *metav1.LabelSelector, ) (*corev1.PodList, error)
GetPods returns list of pods.
func (*Client) GetSecretsForServiceAccount ¶
func (c *Client) GetSecretsForServiceAccount(ctx context.Context, accountName string) (*corev1.Secret, error)
GetSecretsForServiceAccount returns secret by given service account name.
func (*Client) GetServerVersion ¶
GetServerVersion returns server version.
func (*Client) GetStorageClasses ¶
GetStorageClasses returns all storage classes available in the cluster.
func (*Client) GetSubscription ¶
func (c *Client) GetSubscription(ctx context.Context, namespace, name string) (*v1alpha1.Subscription, error)
GetSubscription retrieves an OLM subscription by namespace and name.
func (Client) GetSubscriptionCSV ¶
func (c Client) GetSubscriptionCSV(ctx context.Context, subKey types.NamespacedName) (types.NamespacedName, error)
GetSubscriptionCSV retrieves a subscription CSV.
func (*Client) ListCRDs ¶
func (c *Client) ListCRDs( ctx context.Context, labelSelector *metav1.LabelSelector, ) (*apiextv1.CustomResourceDefinitionList, error)
ListCRDs returns a list of CRDs.
func (*Client) ListCRs ¶
func (c *Client) ListCRs( ctx context.Context, namespace string, gvr schema.GroupVersionResource, labelSelector *metav1.LabelSelector, ) (*unstructured.UnstructuredList, error)
ListCRs returns a list of CRs.
func (*Client) ListClusterServiceVersion ¶
func (c *Client) ListClusterServiceVersion( ctx context.Context, namespace string, ) (*v1alpha1.ClusterServiceVersionList, error)
ListClusterServiceVersion list all CSVs for the given namespace.
func (*Client) ListDatabaseClusters ¶
func (c *Client) ListDatabaseClusters(ctx context.Context) (*everestv1alpha1.DatabaseClusterList, error)
ListDatabaseClusters returns list of managed PCX clusters.
func (*Client) ListDeployments ¶ added in v0.4.0
func (c *Client) ListDeployments(ctx context.Context, namespace string) (*appsv1.DeploymentList, error)
ListDeployments returns deployment by name.
func (*Client) ListPods ¶ added in v0.4.0
func (c *Client) ListPods(ctx context.Context, namespace string, options metav1.ListOptions) (*corev1.PodList, error)
ListPods lists pods.
func (*Client) ListSecrets ¶
ListSecrets returns secrets.
func (*Client) ListSubscriptions ¶
func (c *Client) ListSubscriptions(ctx context.Context, namespace string) (*v1alpha1.SubscriptionList, error)
ListSubscriptions all the subscriptions in the namespace.
func (*Client) UpdateInstallPlan ¶
func (c *Client) UpdateInstallPlan( ctx context.Context, namespace string, installPlan *v1alpha1.InstallPlan, ) (*v1alpha1.InstallPlan, error)
UpdateInstallPlan updates the existing install plan in the specified namespace.
type Cluster ¶
type Cluster struct { CertificateAuthorityData []byte `json:"certificate-authority-data"` //nolint:tagliatelle Server string `json:"server"` }
Cluster contains information about how to communicate with a kubernetes cluster.
type ClusterInfo ¶
ClusterInfo is a struct used to parse Cluster config from kubeconfig.
type Config ¶
type Config struct { // Legacy field from pkg/api/types.go TypeMeta. Kind string `json:"kind,omitempty"` // Legacy field from pkg/api/types.go TypeMeta. APIVersion string `json:"apiVersion,omitempty"` // Preferences holds general information to be use for cli interactions Clusters []ClusterInfo `json:"clusters"` // AuthInfos is a map of referencable names to user configs Users []UserInfo `json:"users"` // Contexts is a map of referencable names to context configs Contexts []ContextInfo `json:"contexts"` // CurrentContext is the name of the context that you would like to use by default CurrentContext string `json:"current-context"` //nolint:tagliatelle }
Config holds the information needed to build connect to remote kubernetes clusters as a given user.
type Context ¶
type Context struct { Cluster string `json:"cluster"` User string `json:"user"` Namespace string `json:"namespace"` }
Context is a tuple of references to a cluster (how do I communicate with a kubernetes cluster), a user (how do I identify myself), and a namespace (what subset of resources do I want to work with).
type ContextInfo ¶
ContextInfo is a struct used to parse Context config from kubeconfig.
type KubeClientConnector ¶
type KubeClientConnector interface { // ClusterName returns the name of the k8s cluster. ClusterName() string // GetSecretsForServiceAccount returns secret by given service account name. GetSecretsForServiceAccount(ctx context.Context, accountName string) (*corev1.Secret, error) // GenerateKubeConfigWithToken generates kubeconfig with a user and token provided as a secret. GenerateKubeConfigWithToken(user string, secret *corev1.Secret) ([]byte, error) // GetServerVersion returns server version. GetServerVersion() (*version.Info, error) // ListDatabaseClusters returns list of managed PCX clusters. ListDatabaseClusters(ctx context.Context) (*everestv1alpha1.DatabaseClusterList, error) // GetDatabaseCluster returns PXC clusters by provided name. GetDatabaseCluster(ctx context.Context, name string) (*everestv1alpha1.DatabaseCluster, error) // GetStorageClasses returns all storage classes available in the cluster. GetStorageClasses(ctx context.Context) (*storagev1.StorageClassList, error) // GetDeployment returns deployment by name. GetDeployment(ctx context.Context, name string, namespace string) (*appsv1.Deployment, error) // ListDeployments returns deployment by name. ListDeployments(ctx context.Context, namespace string) (*appsv1.DeploymentList, error) // GetSecret returns secret by name. GetSecret(ctx context.Context, name, namespace string) (*corev1.Secret, error) // ListSecrets returns secrets. ListSecrets(ctx context.Context) (*corev1.SecretList, error) // DeleteObject deletes object from the k8s cluster. DeleteObject(obj runtime.Object) error // ApplyObject applies object. ApplyObject(obj runtime.Object) error // GetPersistentVolumes returns Persistent Volumes available in the cluster. GetPersistentVolumes(ctx context.Context) (*corev1.PersistentVolumeList, error) // GetPods returns list of pods. GetPods(ctx context.Context, namespace string, labelSelector *metav1.LabelSelector) (*corev1.PodList, error) // ListPods lists pods. ListPods(ctx context.Context, namespace string, options metav1.ListOptions) (*corev1.PodList, error) // DeletePod deletes a pod by given name in the given namespace. DeletePod(ctx context.Context, namespace, name string) error // GetNodes returns list of nodes. GetNodes(ctx context.Context) (*corev1.NodeList, error) // GetLogs returns logs for pod. GetLogs(ctx context.Context, pod, container string) (string, error) // GetEvents retrieves events from a pod by a name. GetEvents(ctx context.Context, name string) (string, error) // ApplyFile accepts manifest file contents, parses into []runtime.Object // and applies them against the cluster. ApplyFile(fileBytes []byte) error // DoCSVWait waits until for a CSV to be applied. DoCSVWait(ctx context.Context, key types.NamespacedName) error // GetSubscriptionCSV retrieves a subscription CSV. GetSubscriptionCSV(ctx context.Context, subKey types.NamespacedName) (types.NamespacedName, error) // DoRolloutWait waits until a deployment has been rolled out susccessfully or there is an error. DoRolloutWait(ctx context.Context, key types.NamespacedName) error // CreateNamespace creates a new namespace. CreateNamespace(name string) error // GetOperatorGroup retrieves an operator group details by namespace and name. GetOperatorGroup(ctx context.Context, namespace, name string) (*v1.OperatorGroup, error) // CreateOperatorGroup creates an operator group to be used as part of a subscription. CreateOperatorGroup(ctx context.Context, namespace, name string) (*v1.OperatorGroup, error) // CreateSubscriptionForCatalog creates an OLM subscription. CreateSubscriptionForCatalog(ctx context.Context, namespace, name, catalogNamespace, catalog, packageName, channel, startingCSV string, approval v1alpha1.Approval) (*v1alpha1.Subscription, error) // GetSubscription retrieves an OLM subscription by namespace and name. GetSubscription(ctx context.Context, namespace, name string) (*v1alpha1.Subscription, error) // ListSubscriptions all the subscriptions in the namespace. ListSubscriptions(ctx context.Context, namespace string) (*v1alpha1.SubscriptionList, error) // GetInstallPlan retrieves an OLM install plan by namespace and name. GetInstallPlan(ctx context.Context, namespace string, name string) (*v1alpha1.InstallPlan, error) // DoPackageWait for the package to be available in OLM. DoPackageWait(ctx context.Context, name string) error // GetPackageManifest returns a package manifest by given name. GetPackageManifest(ctx context.Context, name string) (*packagev1.PackageManifest, error) // UpdateInstallPlan updates the existing install plan in the specified namespace. UpdateInstallPlan(ctx context.Context, namespace string, installPlan *v1alpha1.InstallPlan) (*v1alpha1.InstallPlan, error) // ListCRDs returns a list of CRDs. ListCRDs(ctx context.Context, labelSelector *metav1.LabelSelector) (*apiextv1.CustomResourceDefinitionList, error) // ListCRs returns a list of CRs. ListCRs(ctx context.Context, namespace string, gvr schema.GroupVersionResource, labelSelector *metav1.LabelSelector) (*unstructured.UnstructuredList, error) // GetClusterServiceVersion retrieve a CSV by namespaced name. GetClusterServiceVersion(ctx context.Context, key types.NamespacedName) (*v1alpha1.ClusterServiceVersion, error) // ListClusterServiceVersion list all CSVs for the given namespace. ListClusterServiceVersion(ctx context.Context, namespace string) (*v1alpha1.ClusterServiceVersionList, error) // DeleteFile accepts manifest file contents parses into []runtime.Object // and deletes them from the cluster. DeleteFile(fileBytes []byte) error // DeleteAllMonitoringResources deletes all resources related to monitoring from k8s cluster. DeleteAllMonitoringResources(ctx context.Context, namespace string) error // GetNamespace returns a namespace. GetNamespace(ctx context.Context, name string) (*corev1.Namespace, error) }
KubeClientConnector ...
type MockKubeClientConnector ¶
MockKubeClientConnector is an autogenerated mock type for the KubeClientConnector type
func NewMockKubeClientConnector ¶
func NewMockKubeClientConnector(t interface { mock.TestingT Cleanup(func()) }, ) *MockKubeClientConnector
NewMockKubeClientConnector creates a new instance of MockKubeClientConnector. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockKubeClientConnector) ApplyFile ¶
func (_m *MockKubeClientConnector) ApplyFile(fileBytes []byte) error
ApplyFile provides a mock function with given fields: fileBytes
func (*MockKubeClientConnector) ApplyObject ¶
func (_m *MockKubeClientConnector) ApplyObject(obj runtime.Object) error
ApplyObject provides a mock function with given fields: obj
func (*MockKubeClientConnector) ClusterName ¶
func (_m *MockKubeClientConnector) ClusterName() string
ClusterName provides a mock function with given fields:
func (*MockKubeClientConnector) CreateNamespace ¶
func (_m *MockKubeClientConnector) CreateNamespace(name string) error
CreateNamespace provides a mock function with given fields: name
func (*MockKubeClientConnector) CreateOperatorGroup ¶
func (_m *MockKubeClientConnector) CreateOperatorGroup(ctx context.Context, namespace string, name string) (*v1.OperatorGroup, error)
CreateOperatorGroup provides a mock function with given fields: ctx, namespace, name
func (*MockKubeClientConnector) CreateSubscriptionForCatalog ¶
func (_m *MockKubeClientConnector) CreateSubscriptionForCatalog(ctx context.Context, namespace string, name string, catalogNamespace string, catalog string, packageName string, channel string, startingCSV string, approval v1alpha1.Approval) (*v1alpha1.Subscription, error)
CreateSubscriptionForCatalog provides a mock function with given fields: ctx, namespace, name, catalogNamespace, catalog, packageName, channel, startingCSV, approval
func (*MockKubeClientConnector) DeleteAllMonitoringResources ¶
func (_m *MockKubeClientConnector) DeleteAllMonitoringResources(ctx context.Context, namespace string) error
DeleteAllMonitoringResources provides a mock function with given fields: ctx, namespace
func (*MockKubeClientConnector) DeleteFile ¶
func (_m *MockKubeClientConnector) DeleteFile(fileBytes []byte) error
DeleteFile provides a mock function with given fields: fileBytes
func (*MockKubeClientConnector) DeleteObject ¶
func (_m *MockKubeClientConnector) DeleteObject(obj runtime.Object) error
DeleteObject provides a mock function with given fields: obj
func (*MockKubeClientConnector) DeletePod ¶ added in v0.4.0
func (_m *MockKubeClientConnector) DeletePod(ctx context.Context, namespace string, name string) error
DeletePod provides a mock function with given fields: ctx, namespace, name
func (*MockKubeClientConnector) DoCSVWait ¶
func (_m *MockKubeClientConnector) DoCSVWait(ctx context.Context, key types.NamespacedName) error
DoCSVWait provides a mock function with given fields: ctx, key
func (*MockKubeClientConnector) DoPackageWait ¶
func (_m *MockKubeClientConnector) DoPackageWait(ctx context.Context, name string) error
DoPackageWait provides a mock function with given fields: ctx, name
func (*MockKubeClientConnector) DoRolloutWait ¶
func (_m *MockKubeClientConnector) DoRolloutWait(ctx context.Context, key types.NamespacedName) error
DoRolloutWait provides a mock function with given fields: ctx, key
func (*MockKubeClientConnector) GenerateKubeConfigWithToken ¶
func (_m *MockKubeClientConnector) GenerateKubeConfigWithToken(user string, secret *corev1.Secret) ([]byte, error)
GenerateKubeConfigWithToken provides a mock function with given fields: user, secret
func (*MockKubeClientConnector) GetClusterServiceVersion ¶
func (_m *MockKubeClientConnector) GetClusterServiceVersion(ctx context.Context, key types.NamespacedName) (*v1alpha1.ClusterServiceVersion, error)
GetClusterServiceVersion provides a mock function with given fields: ctx, key
func (*MockKubeClientConnector) GetDatabaseCluster ¶
func (_m *MockKubeClientConnector) GetDatabaseCluster(ctx context.Context, name string) (*apiv1alpha1.DatabaseCluster, error)
GetDatabaseCluster provides a mock function with given fields: ctx, name
func (*MockKubeClientConnector) GetDeployment ¶
func (_m *MockKubeClientConnector) GetDeployment(ctx context.Context, name string, namespace string) (*appsv1.Deployment, error)
GetDeployment provides a mock function with given fields: ctx, name, namespace
func (*MockKubeClientConnector) GetEvents ¶
GetEvents provides a mock function with given fields: ctx, name
func (*MockKubeClientConnector) GetInstallPlan ¶
func (_m *MockKubeClientConnector) GetInstallPlan(ctx context.Context, namespace string, name string) (*v1alpha1.InstallPlan, error)
GetInstallPlan provides a mock function with given fields: ctx, namespace, name
func (*MockKubeClientConnector) GetLogs ¶
func (_m *MockKubeClientConnector) GetLogs(ctx context.Context, pod string, container string) (string, error)
GetLogs provides a mock function with given fields: ctx, pod, container
func (*MockKubeClientConnector) GetNamespace ¶ added in v0.2.0
func (_m *MockKubeClientConnector) GetNamespace(ctx context.Context, name string) (*corev1.Namespace, error)
GetNamespace provides a mock function with given fields: ctx, name
func (*MockKubeClientConnector) GetOperatorGroup ¶
func (_m *MockKubeClientConnector) GetOperatorGroup(ctx context.Context, namespace string, name string) (*v1.OperatorGroup, error)
GetOperatorGroup provides a mock function with given fields: ctx, namespace, name
func (*MockKubeClientConnector) GetPackageManifest ¶
func (_m *MockKubeClientConnector) GetPackageManifest(ctx context.Context, name string) (*operatorsv1.PackageManifest, error)
GetPackageManifest provides a mock function with given fields: ctx, name
func (*MockKubeClientConnector) GetPersistentVolumes ¶
func (_m *MockKubeClientConnector) GetPersistentVolumes(ctx context.Context) (*corev1.PersistentVolumeList, error)
GetPersistentVolumes provides a mock function with given fields: ctx
func (*MockKubeClientConnector) GetPods ¶
func (_m *MockKubeClientConnector) GetPods(ctx context.Context, namespace string, labelSelector *metav1.LabelSelector) (*corev1.PodList, error)
GetPods provides a mock function with given fields: ctx, namespace, labelSelector
func (*MockKubeClientConnector) GetSecret ¶
func (_m *MockKubeClientConnector) GetSecret(ctx context.Context, name string, namespace string) (*corev1.Secret, error)
GetSecret provides a mock function with given fields: ctx, name, namespace
func (*MockKubeClientConnector) GetSecretsForServiceAccount ¶
func (_m *MockKubeClientConnector) GetSecretsForServiceAccount(ctx context.Context, accountName string) (*corev1.Secret, error)
GetSecretsForServiceAccount provides a mock function with given fields: ctx, accountName
func (*MockKubeClientConnector) GetServerVersion ¶
func (_m *MockKubeClientConnector) GetServerVersion() (*version.Info, error)
GetServerVersion provides a mock function with given fields:
func (*MockKubeClientConnector) GetStorageClasses ¶
func (_m *MockKubeClientConnector) GetStorageClasses(ctx context.Context) (*storagev1.StorageClassList, error)
GetStorageClasses provides a mock function with given fields: ctx
func (*MockKubeClientConnector) GetSubscription ¶
func (_m *MockKubeClientConnector) GetSubscription(ctx context.Context, namespace string, name string) (*v1alpha1.Subscription, error)
GetSubscription provides a mock function with given fields: ctx, namespace, name
func (*MockKubeClientConnector) GetSubscriptionCSV ¶
func (_m *MockKubeClientConnector) GetSubscriptionCSV(ctx context.Context, subKey types.NamespacedName) (types.NamespacedName, error)
GetSubscriptionCSV provides a mock function with given fields: ctx, subKey
func (*MockKubeClientConnector) ListCRDs ¶
func (_m *MockKubeClientConnector) ListCRDs(ctx context.Context, labelSelector *metav1.LabelSelector) (*apiextensionsv1.CustomResourceDefinitionList, error)
ListCRDs provides a mock function with given fields: ctx, labelSelector
func (*MockKubeClientConnector) ListCRs ¶
func (_m *MockKubeClientConnector) ListCRs(ctx context.Context, namespace string, gvr schema.GroupVersionResource, labelSelector *metav1.LabelSelector) (*unstructured.UnstructuredList, error)
ListCRs provides a mock function with given fields: ctx, namespace, gvr, labelSelector
func (*MockKubeClientConnector) ListClusterServiceVersion ¶
func (_m *MockKubeClientConnector) ListClusterServiceVersion(ctx context.Context, namespace string) (*v1alpha1.ClusterServiceVersionList, error)
ListClusterServiceVersion provides a mock function with given fields: ctx, namespace
func (*MockKubeClientConnector) ListDatabaseClusters ¶
func (_m *MockKubeClientConnector) ListDatabaseClusters(ctx context.Context) (*apiv1alpha1.DatabaseClusterList, error)
ListDatabaseClusters provides a mock function with given fields: ctx
func (*MockKubeClientConnector) ListDeployments ¶ added in v0.4.0
func (_m *MockKubeClientConnector) ListDeployments(ctx context.Context, namespace string) (*appsv1.DeploymentList, error)
ListDeployments provides a mock function with given fields: ctx, namespace
func (*MockKubeClientConnector) ListPods ¶ added in v0.4.0
func (_m *MockKubeClientConnector) ListPods(ctx context.Context, namespace string, options metav1.ListOptions) (*corev1.PodList, error)
ListPods provides a mock function with given fields: ctx, namespace, options
func (*MockKubeClientConnector) ListSecrets ¶
func (_m *MockKubeClientConnector) ListSecrets(ctx context.Context) (*corev1.SecretList, error)
ListSecrets provides a mock function with given fields: ctx
func (*MockKubeClientConnector) ListSubscriptions ¶
func (_m *MockKubeClientConnector) ListSubscriptions(ctx context.Context, namespace string) (*v1alpha1.SubscriptionList, error)
ListSubscriptions provides a mock function with given fields: ctx, namespace
func (*MockKubeClientConnector) UpdateInstallPlan ¶
func (_m *MockKubeClientConnector) UpdateInstallPlan(ctx context.Context, namespace string, installPlan *v1alpha1.InstallPlan) (*v1alpha1.InstallPlan, error)
UpdateInstallPlan provides a mock function with given fields: ctx, namespace, installPlan
type PrefixWriter ¶
type PrefixWriter interface { // Writef writes text with the specified indentation level. Writef(level int, format string, a ...interface{}) // WriteLine writes an entire line with no indentation level. WriteLine(a ...interface{}) // Flush forces indentation to be reset. Flush() }
PrefixWriter can write text at various indentation levels.
func NewPrefixWriter ¶
func NewPrefixWriter(out io.Writer) PrefixWriter
NewPrefixWriter creates a new PrefixWriter.
type SortableEvents ¶
SortableEvents implements sort.Interface for []api.Event based on the Timestamp field.
func (SortableEvents) Len ¶
func (list SortableEvents) Len() int
func (SortableEvents) Less ¶
func (list SortableEvents) Less(i, j int) bool
func (SortableEvents) Swap ¶
func (list SortableEvents) Swap(i, j int)