Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- type Cluster
- type DefaultK8sClient
- func (d *DefaultK8sClient) DeploymentList(ctx context.Context, namespace string) (*appsv1.DeploymentList, error)
- func (d *DefaultK8sClient) DeploymentRestart(ctx context.Context, namespace, name string) error
- func (d *DefaultK8sClient) EventsWatch(ctx context.Context, namespace string) (watch.Interface, error)
- func (d *DefaultK8sClient) IngressCreate(ctx context.Context, namespace string, ingress *networkingv1.Ingress) error
- func (d *DefaultK8sClient) IngressExists(ctx context.Context, namespace string, ingress string) bool
- func (d *DefaultK8sClient) IngressUpdate(ctx context.Context, namespace string, ingress *networkingv1.Ingress) error
- func (d *DefaultK8sClient) LogsGet(ctx context.Context, namespace string, name string) (string, error)
- func (d *DefaultK8sClient) NamespaceCreate(ctx context.Context, namespace string) error
- func (d *DefaultK8sClient) NamespaceDelete(ctx context.Context, namespace string) error
- func (d *DefaultK8sClient) NamespaceExists(ctx context.Context, namespace string) bool
- func (d *DefaultK8sClient) PersistentVolumeClaimCreate(ctx context.Context, namespace, name, volumeName string) error
- func (d *DefaultK8sClient) PersistentVolumeClaimDelete(ctx context.Context, namespace, name, _ string) error
- func (d *DefaultK8sClient) PersistentVolumeClaimExists(ctx context.Context, namespace, name, _ string) bool
- func (d *DefaultK8sClient) PersistentVolumeCreate(ctx context.Context, namespace, name string) error
- func (d *DefaultK8sClient) PersistentVolumeDelete(ctx context.Context, _, name string) error
- func (d *DefaultK8sClient) PersistentVolumeExists(ctx context.Context, _, name string) bool
- func (d *DefaultK8sClient) PodList(ctx context.Context, namespace string) (*corev1.PodList, error)
- func (d *DefaultK8sClient) SecretCreateOrUpdate(ctx context.Context, secret corev1.Secret) error
- func (d *DefaultK8sClient) SecretGet(ctx context.Context, namespace, name string) (*corev1.Secret, error)
- func (d *DefaultK8sClient) ServerVersionGet() (string, error)
- func (d *DefaultK8sClient) ServiceGet(ctx context.Context, namespace string, name string) (*corev1.Service, error)
- func (d *DefaultK8sClient) StreamPodLogs(ctx context.Context, namespace string, podName string, since time.Time) (io.ReadCloser, error)
- type ExtraVolumeMount
- type Logger
- type Provider
Constants ¶
View Source
const ( Kind = "kind" Test = "test" )
Variables ¶
View Source
var ( // DefaultProvider represents the kind (https://kind.sigs.k8s.io/) provider. DefaultProvider = Provider{ Name: Kind, ClusterName: "airbyte-abctl", Context: "kind-airbyte-abctl", Kubeconfig: paths.Kubeconfig, } // TestProvider represents a test provider, for testing purposes TestProvider = Provider{ Name: Test, ClusterName: "test-airbyte-abctl", Context: "test-airbyte-abctl", Kubeconfig: filepath.Join(os.TempDir(), "abctl", paths.FileKubeconfig), } )
View Source
var DefaultPersistentVolumeSize = resource.MustParse("500Mi")
DefaultPersistentVolumeSize is the size of the disks created by the persistent-volumes and requested by the persistent-volume-claims.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // DeploymentList returns a list of all the services within the namespace DeploymentList(ctx context.Context, namespace string) (*appsv1.DeploymentList, error) // DeploymentRestart will force a restart of the deployment name in the provided namespace. // This is a blocking call, it should only return once the deployment has completed. DeploymentRestart(ctx context.Context, namespace, name string) error // IngressCreate creates an ingress in the given namespace IngressCreate(ctx context.Context, namespace string, ingress *networkingv1.Ingress) error // IngressExists returns true if the ingress exists in the namespace, false otherwise. IngressExists(ctx context.Context, namespace string, ingress string) bool // IngressUpdate updates an existing ingress in the given namespace IngressUpdate(ctx context.Context, namespace string, ingress *networkingv1.Ingress) error // NamespaceCreate creates a namespace NamespaceCreate(ctx context.Context, namespace string) error // NamespaceExists returns true if the namespace exists, false otherwise NamespaceExists(ctx context.Context, namespace string) bool // NamespaceDelete deletes the existing namespace NamespaceDelete(ctx context.Context, namespace string) error // PersistentVolumeCreate creates a persistent volume PersistentVolumeCreate(ctx context.Context, namespace, name string) error // PersistentVolumeExists returns true if the persistent volume exists, false otherwise PersistentVolumeExists(ctx context.Context, namespace, name string) bool // PersistentVolumeDelete deletes the existing persistent volume PersistentVolumeDelete(ctx context.Context, namespace, name string) error // PersistentVolumeClaimCreate creates a persistent volume claim PersistentVolumeClaimCreate(ctx context.Context, namespace, name, volumeName string) error // PersistentVolumeClaimExists returns true if the persistent volume claim exists, false otherwise PersistentVolumeClaimExists(ctx context.Context, namespace, name, volumeName string) bool // PersistentVolumeClaimDelete deletes the existing persistent volume claim PersistentVolumeClaimDelete(ctx context.Context, namespace, name, volumeName string) error // SecretCreateOrUpdate will update or create the secret name with the payload of data in the specified namespace SecretCreateOrUpdate(ctx context.Context, secret corev1.Secret) error // SecretGet returns the secrets for the namespace and name SecretGet(ctx context.Context, namespace, name string) (*corev1.Secret, error) // ServiceGet returns the service for the given namespace and name ServiceGet(ctx context.Context, namespace, name string) (*corev1.Service, error) // ServerVersionGet returns the kubernetes version. ServerVersionGet() (string, error) EventsWatch(ctx context.Context, namespace string) (watch.Interface, error) LogsGet(ctx context.Context, namespace string, name string) (string, error) StreamPodLogs(ctx context.Context, namespace string, podName string, since time.Time) (io.ReadCloser, error) PodList(ctx context.Context, namespace string) (*corev1.PodList, error) }
Client primarily for testing purposes
type Cluster ¶
type Cluster interface { // Create a cluster with the provided name. Create(ctx context.Context, portHTTP int, extraMounts []ExtraVolumeMount) error // Delete a cluster with the provided name. Delete(ctx context.Context) error // Exists returns true if the cluster exists, false otherwise. Exists(ctx context.Context) bool }
Cluster is an interface representing all the actions taken at the cluster level.
type DefaultK8sClient ¶
type DefaultK8sClient struct {
ClientSet kubernetes.Interface
}
DefaultK8sClient converts the official kubernetes client to our more manageable (and testable) interface
func (*DefaultK8sClient) DeploymentList ¶ added in v0.14.1
func (d *DefaultK8sClient) DeploymentList(ctx context.Context, namespace string) (*appsv1.DeploymentList, error)
func (*DefaultK8sClient) DeploymentRestart ¶ added in v0.13.0
func (d *DefaultK8sClient) DeploymentRestart(ctx context.Context, namespace, name string) error
func (*DefaultK8sClient) EventsWatch ¶ added in v0.5.0
func (*DefaultK8sClient) IngressCreate ¶
func (d *DefaultK8sClient) IngressCreate(ctx context.Context, namespace string, ingress *networkingv1.Ingress) error
func (*DefaultK8sClient) IngressExists ¶
func (*DefaultK8sClient) IngressUpdate ¶
func (d *DefaultK8sClient) IngressUpdate(ctx context.Context, namespace string, ingress *networkingv1.Ingress) error
func (*DefaultK8sClient) NamespaceCreate ¶ added in v0.6.0
func (d *DefaultK8sClient) NamespaceCreate(ctx context.Context, namespace string) error
func (*DefaultK8sClient) NamespaceDelete ¶
func (d *DefaultK8sClient) NamespaceDelete(ctx context.Context, namespace string) error
func (*DefaultK8sClient) NamespaceExists ¶
func (d *DefaultK8sClient) NamespaceExists(ctx context.Context, namespace string) bool
func (*DefaultK8sClient) PersistentVolumeClaimCreate ¶ added in v0.6.0
func (d *DefaultK8sClient) PersistentVolumeClaimCreate(ctx context.Context, namespace, name, volumeName string) error
func (*DefaultK8sClient) PersistentVolumeClaimDelete ¶ added in v0.6.0
func (d *DefaultK8sClient) PersistentVolumeClaimDelete(ctx context.Context, namespace, name, _ string) error
func (*DefaultK8sClient) PersistentVolumeClaimExists ¶ added in v0.6.0
func (d *DefaultK8sClient) PersistentVolumeClaimExists(ctx context.Context, namespace, name, _ string) bool
func (*DefaultK8sClient) PersistentVolumeCreate ¶ added in v0.6.0
func (d *DefaultK8sClient) PersistentVolumeCreate(ctx context.Context, namespace, name string) error
func (*DefaultK8sClient) PersistentVolumeDelete ¶ added in v0.6.0
func (d *DefaultK8sClient) PersistentVolumeDelete(ctx context.Context, _, name string) error
func (*DefaultK8sClient) PersistentVolumeExists ¶ added in v0.6.0
func (d *DefaultK8sClient) PersistentVolumeExists(ctx context.Context, _, name string) bool
func (*DefaultK8sClient) SecretCreateOrUpdate ¶
func (*DefaultK8sClient) ServerVersionGet ¶
func (d *DefaultK8sClient) ServerVersionGet() (string, error)
func (*DefaultK8sClient) ServiceGet ¶
func (*DefaultK8sClient) StreamPodLogs ¶ added in v0.15.0
func (d *DefaultK8sClient) StreamPodLogs(ctx context.Context, namespace string, podName string, since time.Time) (io.ReadCloser, error)
type ExtraVolumeMount ¶ added in v0.12.0
ExtraVolumeMount defines a host volume mount for the Kind cluster
type Logger ¶ added in v0.11.1
type Logger struct { }
Logger is an implementation of the WarningHandler that converts the k8s warning messages into abctl debug messages.
Click to show internal directories.
Click to hide internal directories.