v1alpha1

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2020 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the etok v1alpha1 API group +kubebuilder:object:generate=true +groupName=etok.dev

Index

Constants

View Source
const (
	DefaultHandshakeTimeout = 10 * time.Second
)

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: "etok.dev", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func ApprovedAnnotationKey

func ApprovedAnnotationKey(runName string) string

func WorkspacePodName

func WorkspacePodName(name string) string

Types

type AttachSpec

type AttachSpec struct {
	// Enable TTY on pod and await handshake string from client
	Handshake bool `json:"handshake,omitempty"`

	// How long to wait for handshake before timing out
	HandshakeTimeout string `json:"handshakeTimeout,omitempty"`
}

AttachSpec defines behaviour for clients attaching to the pod's TTY

func (*AttachSpec) DeepCopy

func (in *AttachSpec) DeepCopy() *AttachSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttachSpec.

func (*AttachSpec) DeepCopyInto

func (in *AttachSpec) DeepCopyInto(out *AttachSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Run

type Run struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	RunSpec   `json:"spec,omitempty"`
	RunStatus `json:"status,omitempty"`
}

func (*Run) ApprovedAnnotationKey

func (r *Run) ApprovedAnnotationKey() string

ApprovedAnnotationKey is the key to be set on a workspace's annotations to indicate that this run is approved. Only necessary if the workspace has categorised the run's command as privileged.

func (*Run) DeepCopy

func (in *Run) DeepCopy() *Run

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Run.

func (*Run) DeepCopyInto

func (in *Run) DeepCopyInto(out *Run)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Run) DeepCopyObject

func (in *Run) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Run) IsReconciled added in v0.0.3

func (r *Run) IsReconciled() bool

func (*Run) PodName

func (r *Run) PodName() string

Run's pod shares its name

type RunList

type RunList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Run `json:"items"`
}

RunList contains a list of Run

func (*RunList) DeepCopy

func (in *RunList) DeepCopy() *RunList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RunList.

func (*RunList) DeepCopyInto

func (in *RunList) DeepCopyInto(out *RunList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RunList) DeepCopyObject

func (in *RunList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RunPhase

type RunPhase string
const (
	RunPhaseUnknown      RunPhase = "unknown"
	RunPhasePending      RunPhase = "pending"
	RunPhaseQueued       RunPhase = "queued"
	RunPhaseProvisioning RunPhase = "provisioning"
	RunPhaseRunning      RunPhase = "running"
	RunPhaseCompleted    RunPhase = "completed"

	RunDefaultConfigMapKey = "config.tar.gz"
)

type RunSpec

type RunSpec struct {

	// The command to run on the pod
	Command string `json:"command"`

	// The arguments to be passed to the command
	Args []string `json:"args,omitempty"`

	// ConfigMap containing the tarball to extract on the pod
	ConfigMap string `json:"configMap"`

	// The config map key identifying the tarball to extract
	ConfigMapKey string `json:"configMapKey"`

	// The path within the archive to the root module
	ConfigMapPath string `json:"configMapPath"`

	// The workspace of the run.
	Workspace string `json:"workspace"`

	// Logging verbosity.
	Verbosity int `json:"verbosity,omitempty"`

	// AttachSpec defines behaviour for clients attaching to the pod's TTY
	AttachSpec `json:",inline"`
}

RunSpec defines the desired state of Run

func (*RunSpec) DeepCopy

func (in *RunSpec) DeepCopy() *RunSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RunSpec.

func (*RunSpec) DeepCopyInto

func (in *RunSpec) DeepCopyInto(out *RunSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RunStatus

type RunStatus struct {
	// Current phase of the run's lifecycle.
	Phase RunPhase `json:"phase,omitempty"`

	// True if resource has been reconciled at least once.
	Reconciled bool `json:"reconciled,omitempty"`
}

RunStatus defines the observed state of Run

func (*RunStatus) DeepCopy

func (in *RunStatus) DeepCopy() *RunStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RunStatus.

func (*RunStatus) DeepCopyInto

func (in *RunStatus) DeepCopyInto(out *RunStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Workspace

type Workspace struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   WorkspaceSpec   `json:"spec,omitempty"`
	Status WorkspaceStatus `json:"status,omitempty"`
}

Workspace is the Schema for the workspaces API +kubebuilder:subresource:status +kubebuilder:resource:path=workspaces,scope=Namespaced,shortName={ws} +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase" +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.terraformVersion" +kubebuilder:printcolumn:name="Queue",type="string",JSONPath=".status.queue" +genclient

func (*Workspace) DeepCopy

func (in *Workspace) DeepCopy() *Workspace

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workspace.

func (*Workspace) DeepCopyInto

func (in *Workspace) DeepCopyInto(out *Workspace)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Workspace) DeepCopyObject

func (in *Workspace) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Workspace) IsPrivilegedCommand

func (ws *Workspace) IsPrivilegedCommand(cmd string) bool

func (*Workspace) IsReconciled added in v0.0.3

func (ws *Workspace) IsReconciled() bool

func (*Workspace) IsRunApproved

func (ws *Workspace) IsRunApproved(run *Run) bool

func (*Workspace) PVCName

func (ws *Workspace) PVCName() string

func (*Workspace) PodName

func (ws *Workspace) PodName() string

func (*Workspace) TerraformName

func (ws *Workspace) TerraformName() string

TerraformName provides a terraform-compatible workspace name.

type WorkspaceCacheSpec

type WorkspaceCacheSpec struct {
	// Storage class for the cache's persistent volume claim. This is a pointer
	// to distinguish between explicit empty string and nil (which triggers
	// different behaviour for dynamic provisioning of persistent volumes).
	StorageClass *string `json:"storageClass,omitempty"`

	// Size of cache's persistent volume claim.
	Size string `json:"size,omitempty"`
}

WorkspaceSpec defines the desired state of Workspace's cache storage

func (*WorkspaceCacheSpec) DeepCopy

func (in *WorkspaceCacheSpec) DeepCopy() *WorkspaceCacheSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceCacheSpec.

func (*WorkspaceCacheSpec) DeepCopyInto

func (in *WorkspaceCacheSpec) DeepCopyInto(out *WorkspaceCacheSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WorkspaceList

type WorkspaceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Workspace `json:"items"`
}

WorkspaceList contains a list of Workspace

func (*WorkspaceList) DeepCopy

func (in *WorkspaceList) DeepCopy() *WorkspaceList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceList.

func (*WorkspaceList) DeepCopyInto

func (in *WorkspaceList) DeepCopyInto(out *WorkspaceList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*WorkspaceList) DeepCopyObject

func (in *WorkspaceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type WorkspacePhase

type WorkspacePhase string
const (
	WorkspacePhaseInitializing WorkspacePhase = "initializing"
	WorkspacePhaseReady        WorkspacePhase = "ready"
	WorkspacePhaseError        WorkspacePhase = "error"
	WorkspacePhaseUnknown      WorkspacePhase = "unknown"
	WorkspacePhaseDeleting     WorkspacePhase = "deleting"
)

type WorkspaceSpec

type WorkspaceSpec struct {

	// Name of the secret resource. Its keys and values will be made available
	// as environment variables on the workspace pod.
	SecretName string `json:"secretName,omitempty"`

	// Name of the service account configured for the workspace pod.
	ServiceAccountName string `json:"serviceAccountName,omitempty"`

	// Persistent Volume Claim specification for workspace's cache.
	Cache WorkspaceCacheSpec `json:"cache,omitempty"`

	// Logging verbosity.
	Verbosity int `json:"verbosity,omitempty"`

	// List of commands that are deemed privileged. The client must set a
	// specific annotation on the workspace to approve a run with a privileged
	// command.
	PrivilegedCommands []string `json:"privilegedCommands,omitempty"`

	// Required version of Terraform on workspace pod
	TerraformVersion string `json:"terraformVersion,omitempty"`
}

WorkspaceSpec defines the desired state of Workspace

func (*WorkspaceSpec) DeepCopy

func (in *WorkspaceSpec) DeepCopy() *WorkspaceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceSpec.

func (*WorkspaceSpec) DeepCopyInto

func (in *WorkspaceSpec) DeepCopyInto(out *WorkspaceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WorkspaceStatus

type WorkspaceStatus struct {
	// Queue of runs. Parse bypass the queue.
	Queue []string `json:"queue,omitempty"`

	// Lifecycle phase of workspace.
	Phase WorkspacePhase `json:"phase,omitempty"`

	// True if resource has been reconciled at least once.
	Reconciled bool `json:"reconciled,omitempty"`
}

WorkspaceStatus defines the observed state of Workspace

func (*WorkspaceStatus) DeepCopy

func (in *WorkspaceStatus) DeepCopy() *WorkspaceStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceStatus.

func (*WorkspaceStatus) DeepCopyInto

func (in *WorkspaceStatus) DeepCopyInto(out *WorkspaceStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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