client

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 54 Imported by: 0

Documentation

Overview

Package client TODO

Package client ...

Index

Constants

View Source
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

func (c *Client) ApplyFile(fileBytes []byte) error

ApplyFile accepts manifest file contents, parses into []runtime.Object and applies them against the cluster.

func (*Client) ApplyObject

func (c *Client) ApplyObject(obj runtime.Object) error

ApplyObject applies object.

func (*Client) ClusterName

func (c *Client) ClusterName() string

ClusterName returns the name of the k8s cluster.

func (*Client) CreateNamespace

func (c *Client) CreateNamespace(name string) error

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

func (c *Client) DeleteAllMonitoringResources(ctx context.Context, namespace string) error

DeleteAllMonitoringResources deletes all resources related to monitoring from k8s cluster.

func (*Client) DeleteFile

func (c *Client) DeleteFile(fileBytes []byte) error

DeleteFile accepts manifest file contents parses into []runtime.Object and deletes them from the cluster.

func (*Client) DeleteObject

func (c *Client) DeleteObject(obj runtime.Object) error

DeleteObject deletes object from the k8s cluster.

func (Client) DoCSVWait

func (c Client) DoCSVWait(ctx context.Context, key types.NamespacedName) error

DoCSVWait waits until for a CSV to be applied.

func (*Client) DoPackageWait

func (c *Client) DoPackageWait(ctx context.Context, name string) error

DoPackageWait for the package to be available in OLM.

func (Client) DoRolloutWait

func (c Client) DoRolloutWait(ctx context.Context, key types.NamespacedName) error

DoRolloutWait waits until a deployment has been rolled out susccessfully or there is an error.

func (*Client) GenerateKubeConfigWithToken

func (c *Client) GenerateKubeConfigWithToken(user string, secret *corev1.Secret) ([]byte, error)

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) GetEvents

func (c *Client) GetEvents(ctx context.Context, name string) (string, error)

GetEvents retrieves events from a pod by a 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) GetLogs

func (c *Client) GetLogs(ctx context.Context, pod, container string) (string, error)

GetLogs returns logs for pod.

func (*Client) GetNodes

func (c *Client) GetNodes(ctx context.Context) (*corev1.NodeList, error)

GetNodes returns list of nodes.

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

func (c *Client) GetPersistentVolumes(ctx context.Context) (*corev1.PersistentVolumeList, error)

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) GetSecret

func (c *Client) GetSecret(ctx context.Context, name, namespace string) (*corev1.Secret, error)

GetSecret returns secret by name.

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

func (c *Client) GetServerVersion() (*version.Info, error)

GetServerVersion returns server version.

func (*Client) GetStorageClasses

func (c *Client) GetStorageClasses(ctx context.Context) (*storagev1.StorageClassList, error)

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) ListSecrets

func (c *Client) ListSecrets(ctx context.Context) (*corev1.SecretList, error)

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

type ClusterInfo struct {
	Name    string  `json:"name"`
	Cluster Cluster `json:"cluster"`
}

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

type ContextInfo struct {
	Name    string  `json:"name"`
	Context Context `json:"context"`
}

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)
	// 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)
	// 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
}

KubeClientConnector ...

type MockKubeClientConnector

type MockKubeClientConnector struct {
	mock.Mock
}

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) DoCSVWait

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

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

func (_m *MockKubeClientConnector) GetEvents(ctx context.Context, name string) (string, error)

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) GetNodes

GetNodes provides a mock function with given fields: ctx

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

ListCRDs provides a mock function with given fields: ctx, labelSelector

func (*MockKubeClientConnector) ListCRs

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) 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

type SortableEvents []corev1.Event

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)

type User

type User struct {
	Token string `json:"token"`
}

User contains information that describes identity information. This is use to tell the kubernetes cluster who you are.

type UserInfo

type UserInfo struct {
	Name string `json:"name"`
	User User   `json:"user"`
}

UserInfo is a struct used to parse User config from kubeconfig.

Directories

Path Synopsis
Package database TODO
Package database TODO

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL