v1alpha1

package
v0.2.14 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2020 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the stok v1alpha1 API group +kubebuilder:object:generate=true +groupName=stok.goalspike.com

Index

Constants

View Source
const (
	WorkspacePhaseInitializing WorkspacePhase = "initializing"
	WorkspacePhaseReady        WorkspacePhase = "ready"
	WorkspacePhaseError        WorkspacePhase = "error"
	WorkspacePhaseUnknown      WorkspacePhase = "unknown"
	WorkspacePhaseDeleting     WorkspacePhase = "deleting"

	WorkspaceDefaultCacheSize = "1Gi"

	WorkspaceDefaultSecretName         = "stok"
	WorkspaceDefaultServiceAccountName = "stok"

	BackendTypeFilename   = "backend.tf"
	BackendConfigFilename = "backend.ini"
)
View Source
const (
	DefaultHandshakeTimeout = 10 * time.Second
)

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: "stok.goalspike.com", 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 BackendConfig

func BackendConfig(cfg map[string]string) string

Return a terraform backend configuration file (similar to an INI file)

func BackendConfigMapName

func BackendConfigMapName(workspace string) string

func BackendEmptyConfig

func BackendEmptyConfig(backendType string) string

func WorkspacePodName added in v0.2.11

func WorkspacePodName(name string) string

Types

type AttachSpec added in v0.2.11

type AttachSpec struct {
	// Toggle whether runner should wait for a handshake from client
	Handshake bool `json:"handshake"`
	// How long to wait for handshake before timing out
	// +kubebuilder:default="10s"
	HandshakeTimeout string `json:"handshakeTimeout"`
}

AttachSpec defines behavour for clients attaching to the runner TTY

func (*AttachSpec) DeepCopy added in v0.2.11

func (in *AttachSpec) DeepCopy() *AttachSpec

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

func (*AttachSpec) DeepCopyInto added in v0.2.11

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

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

type BackendSpec

type BackendSpec struct {
	// +kubebuilder:validation:Enum=local;remote;artifactory;azurerm;consul;cos;etcd;etcdv3;gcs;http;manta;oss;pg;s3;swift
	Type   string            `json:"type,omitempty"`
	Config map[string]string `json:"config,omitempty"`
}

func (*BackendSpec) DeepCopy

func (in *BackendSpec) DeepCopy() *BackendSpec

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

func (*BackendSpec) DeepCopyInto

func (in *BackendSpec) DeepCopyInto(out *BackendSpec)

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) ContainerArgs added in v0.2.12

func (r *Run) ContainerArgs() (args []string)

ContainerArgs returns the args for a run's container

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) GetHandshake added in v0.2.12

func (r *Run) GetHandshake() bool

func (*Run) GetHandshakeTimeout added in v0.2.12

func (r *Run) GetHandshakeTimeout() string

func (*Run) PodName added in v0.2.12

func (r *Run) PodName() string

Run's pod shares its name

func (*Run) WorkingDir added in v0.2.12

func (r *Run) WorkingDir() string

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 (
	RunPhasePending      RunPhase = "pending"
	RunPhaseQueued       RunPhase = "queued"
	RunPhaseProvisioning RunPhase = "provisioning"
	RunPhaseRunning      RunPhase = "running"
	RunPhaseCompleted    RunPhase = "completed"

	RunDefaultConfigMapKey = "config.tar.gz"
)

type RunSpec

type RunSpec struct {
	// +kubebuilder:validation:Enum={"apply","destroy","force-unlock","get","import","init","output","plan","refresh","sh","state list","state mv","state pull","state push","state rm","state show","taint","untaint","validate"}
	Command       string   `json:"command"`
	Args          []string `json:"args,omitempty"`
	Debug         bool     `json:"debug,omitempty"`
	ConfigMap     string   `json:"configMap"`
	ConfigMapKey  string   `json:"configMapKey"`
	ConfigMapPath string   `json:"configMapPath"`
	Workspace     string   `json:"workspace"`

	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.

func (*RunSpec) GetArgs

func (r *RunSpec) GetArgs() []string

Get/Set Args functions

func (*RunSpec) GetCommand

func (r *RunSpec) GetCommand() string

Get/Set Command functions

func (*RunSpec) GetConfigMap

func (r *RunSpec) GetConfigMap() string

Get/Set ConfigMap functions

func (*RunSpec) GetConfigMapKey

func (r *RunSpec) GetConfigMapKey() string

Get/Set ConfigMapKey functions

func (*RunSpec) GetConfigMapPath added in v0.2.12

func (r *RunSpec) GetConfigMapPath() string

Get/Set ConfigMapPath functions

func (*RunSpec) GetDebug

func (r *RunSpec) GetDebug() bool

Get/Set Debug functions

func (*RunSpec) GetWorkspace

func (r *RunSpec) GetWorkspace() string

Get/Set Workspace functions

func (*RunSpec) SetArgs

func (r *RunSpec) SetArgs(args []string)

func (*RunSpec) SetCommand

func (r *RunSpec) SetCommand(cmd string)

func (*RunSpec) SetConfigMap

func (r *RunSpec) SetConfigMap(name string)

func (*RunSpec) SetConfigMapKey

func (r *RunSpec) SetConfigMapKey(key string)

func (*RunSpec) SetConfigMapPath added in v0.2.12

func (r *RunSpec) SetConfigMapPath(path string)

func (*RunSpec) SetDebug

func (r *RunSpec) SetDebug(debug bool)

func (*RunSpec) SetWorkspace

func (r *RunSpec) SetWorkspace(ws string)

type RunStatus

type RunStatus struct {
	Phase RunPhase `json:"phase"`
}

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.

func (*RunStatus) GetPhase

func (r *RunStatus) GetPhase() RunPhase

Get/Set Phase functions

func (*RunStatus) SetPhase

func (r *RunStatus) SetPhase(phase RunPhase)

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 +kubebuilder:printcolumn:name="Queue",type="string",JSONPath=".status.queue" +kubebuilder:printcolumn:name="Backend",type="string",JSONPath=".spec.backend.type" +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase" +genclient

func (*Workspace) ContainerArgs added in v0.2.12

func (ws *Workspace) ContainerArgs() (args []string)

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

func (ws *Workspace) GetDebug() bool

Get/Set Debug functions

func (*Workspace) GetHandshake added in v0.2.12

func (ws *Workspace) GetHandshake() bool

func (*Workspace) GetHandshakeTimeout added in v0.2.12

func (ws *Workspace) GetHandshakeTimeout() string

func (*Workspace) PVCName added in v0.2.12

func (ws *Workspace) PVCName() string

func (*Workspace) PodName

func (ws *Workspace) PodName() string

func (*Workspace) SetDebug

func (ws *Workspace) SetDebug(debug bool)

func (*Workspace) WorkingDir added in v0.2.12

func (ws *Workspace) WorkingDir() string

type WorkspaceCacheSpec

type WorkspaceCacheSpec struct {
	StorageClass string `json:"storageClass,omitempty"`
	Size         string `json:"size,omitempty" default:"1Gi"`
}

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 added in v0.2.11

type WorkspacePhase string

type WorkspaceSpec

type WorkspaceSpec struct {
	// +kubebuilder:default=stok
	SecretName string `json:"secretName,omitempty"`
	// +kubebuilder:default=stok
	ServiceAccountName string `json:"serviceAccountName,omitempty"`

	Cache   WorkspaceCacheSpec `json:"cache,omitempty"`
	Backend BackendSpec        `json:"backend"`
	Debug   bool               `json:"debug,omitempty"`

	AttachSpec `json:",inline"`
}

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 []string       `json:"queue"`
	Phase WorkspacePhase `json:"phase"`
}

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