v1alpha1

package
v0.0.0-...-283c5ec Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

+k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/gocardless/theatre/pkg/apis/workloads +k8s:defaulter-gen=TypeMeta +groupName=workloads.crd.gocardless.com

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupName is taken from our parent API group
	GroupName = workloads.GroupName

	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: workloads.GroupName, Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

	// AddToScheme is required by pkg/client/...
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func Kind

func Kind(kind string) schema.GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Types

type Console

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

	Spec   ConsoleSpec   `json:"spec"`
	Status ConsoleStatus `json:"status,omitempty"`
}

Console declares an instance of a console environment to be created by a specific user +kubebuilder:printcolumn:name="User",type="string",JSONPath=".spec.user" +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +kubebuilder:printcolumn:name="Expiry",type="string",JSONPath=".status.expiryTime"

func (*Console) DeepCopy

func (in *Console) DeepCopy() *Console

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

func (*Console) DeepCopyInto

func (in *Console) DeepCopyInto(out *Console)

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

func (*Console) DeepCopyObject

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

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

func (*Console) EligibleForGC

func (c *Console) EligibleForGC() bool

EligibleForGC returns true if the console can be garbage collected. This is the case if its TTLSecondsAfterFinished has elapsed.

func (*Console) Pending

func (c *Console) Pending() bool

Pending returns true if the console is Pending

func (*Console) Running

func (c *Console) Running() bool

Running returns true if the console is Running

func (*Console) Stopped

func (c *Console) Stopped() bool

Stopped returns true if the console is Stopped

func (*Console) TTLDuration

func (c *Console) TTLDuration() time.Duration

TTLDuration returns the console's TTL as a time.Duration

type ConsoleList

type ConsoleList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []Console `json:"items"`
}

ConsoleList is a list of consoles

func (*ConsoleList) DeepCopy

func (in *ConsoleList) DeepCopy() *ConsoleList

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

func (*ConsoleList) DeepCopyInto

func (in *ConsoleList) DeepCopyInto(out *ConsoleList)

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

func (*ConsoleList) DeepCopyObject

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

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

type ConsolePhase

type ConsolePhase string
const (
	// ConsolePending means the console has been created but its pod is not yet ready
	ConsolePending ConsolePhase = "Pending"
	// ConsoleRunning means the pod has started and is running
	ConsoleRunning ConsolePhase = "Running"
	// ConsoleStopped means the console has completed or timed out
	ConsoleStopped ConsolePhase = "Stopped"
)

These are valid phases for a console

type ConsoleSpec

type ConsoleSpec struct {
	User   string `json:"user"`
	Reason string `json:"reason"`

	// Number of seconds that the console should run for.
	// If the process running within the console has not exited before this
	// timeout is reached, then the console will be terminated.
	// If this value exceeds the Maximum Timeout Seconds specified in the
	// ConsoleTemplate that this console refers to, then this timeout will be
	// clamped to that value.
	// Maximum value of 1 week (as per ConsoleTemplate.Spec.MaxTimeoutSeconds).
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=604800
	TimeoutSeconds int `json:"timeoutSeconds,omitempty"`

	ConsoleTemplateRef corev1.LocalObjectReference `json:"consoleTemplateRef"`

	// Specifies the TTL for this Console. The Console will be eligible for garbage
	// collection ConsoleTTLSecondsAfterFinished seconds after it enters the Stopped phase.
	// This field is modeled on the TTL mechanism in Kubernetes 1.12.
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=604800
	// +optional
	TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"`

	// The command and arguments to execute. If not specified the command from
	// the template specification will be used.
	Command []string `json:"command,omitempty"`
}

ConsoleSpec defines the specification for a console

func (*ConsoleSpec) DeepCopy

func (in *ConsoleSpec) DeepCopy() *ConsoleSpec

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

func (*ConsoleSpec) DeepCopyInto

func (in *ConsoleSpec) DeepCopyInto(out *ConsoleSpec)

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

type ConsoleStatus

type ConsoleStatus struct {
	PodName    string       `json:"podName"`
	ExpiryTime *metav1.Time `json:"expiryTime,omitempty"`
	// Time at which the job completed successfully
	CompletionTime *metav1.Time `json:"completionTime,omitempty"`
	Phase          ConsolePhase `json:"phase"`
}

ConsoleStatus defines the status of a created console, populated at runtime

func (*ConsoleStatus) DeepCopy

func (in *ConsoleStatus) DeepCopy() *ConsoleStatus

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

func (*ConsoleStatus) DeepCopyInto

func (in *ConsoleStatus) DeepCopyInto(out *ConsoleStatus)

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

type ConsoleTemplate

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

	Spec ConsoleTemplateSpec `json:"spec"`
}

ConsoleTemplate declares a console template that can be instantiated through a Console object

func (*ConsoleTemplate) DeepCopy

func (in *ConsoleTemplate) DeepCopy() *ConsoleTemplate

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

func (*ConsoleTemplate) DeepCopyInto

func (in *ConsoleTemplate) DeepCopyInto(out *ConsoleTemplate)

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

func (*ConsoleTemplate) DeepCopyObject

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

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

type ConsoleTemplateList

type ConsoleTemplateList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []ConsoleTemplate `json:"items"`
}

ConsoleTemplateList is a list of console templates

func (*ConsoleTemplateList) DeepCopy

func (in *ConsoleTemplateList) DeepCopy() *ConsoleTemplateList

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

func (*ConsoleTemplateList) DeepCopyInto

func (in *ConsoleTemplateList) DeepCopyInto(out *ConsoleTemplateList)

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

func (*ConsoleTemplateList) DeepCopyObject

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

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

type ConsoleTemplateSpec

type ConsoleTemplateSpec struct {
	Template corev1.PodTemplateSpec `json:"template"`

	// Default time, in seconds, that a Console will be created for.
	// Maximum value of 1 week (as per MaxTimeoutSeconds).
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=604800
	DefaultTimeoutSeconds int `json:"defaultTimeoutSeconds"`

	// Maximum time, in seconds, that a Console can be created for.
	// Maximum value of 1 week.
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=604800
	MaxTimeoutSeconds        int              `json:"maxTimeoutSeconds"`
	AdditionalAttachSubjects []rbacv1.Subject `json:"additionalAttachSubjects,omitempty"`

	// Specifies the TTL for any Console created with this template. If set, the Console
	// will be eligible for garbage collection ConsoleTTLSecondsAfterFinished seconds after
	// it enters the Stopped phase. If not set, this value defaults to 24 hours.
	// This field is modeled closely on the TTL mechanism in Kubernetes 1.12.
	// +optional
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=604800
	DefaultTTLSecondsAfterFinished *int32 `json:"defaultTtlSecondsAfterFinished,omitempty"`
}

ConsoleTemplateSpec defines the parameters that a created console will adhere to

func (*ConsoleTemplateSpec) DeepCopy

func (in *ConsoleTemplateSpec) DeepCopy() *ConsoleTemplateSpec

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

func (*ConsoleTemplateSpec) DeepCopyInto

func (in *ConsoleTemplateSpec) DeepCopyInto(out *ConsoleTemplateSpec)

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