v1

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2020 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the kubetest v1 API group +kubebuilder:object:generate=true +groupName=kubetest.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "kubetest.io", Version: "v1"}

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

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var (
	ErrFailedTestJob = xerrors.New("failed test job")
)

Functions

This section is empty.

Types

type CacheSpec added in v0.2.0

type CacheSpec struct {
	// Name cache identifier
	Name string `json:"name"`
	// Command for making cache
	Command Command `json:"command"`
	// Path specify mount path
	Path string `json:"path"`
}

func (*CacheSpec) DeepCopy added in v0.2.0

func (in *CacheSpec) DeepCopy() *CacheSpec

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

func (*CacheSpec) DeepCopyInto added in v0.2.0

func (in *CacheSpec) DeepCopyInto(out *CacheSpec)

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

type Command

type Command string

type DistributedTestSpec

type DistributedTestSpec struct {
	// Output testing list to stdout
	ListCommand Command `json:"listCommand"`
	// Delimiter for testing list ( default: new line character ( \n ) )
	ListDelimiter string `json:"listDelimiter,omitempty"`
	// Test name pattern ( enable use regular expression )
	Pattern string `json:"pattern,omitempty"`
	// MaxContainersPerPod maximum number of container per pod.
	MaxContainersPerPod int `json:"maxContainersPerPod"`
	// Restart testing for failed tests
	Retest bool `json:"retest"`
	// Delimiter for testing list of retest ( default: white space )
	RetestDelimiter string `json:"retestDelimiter,omitempty"`
	// CacheSpec for making cache before testing
	Cache []CacheSpec `json:"cache,omitempty"`
}

func (*DistributedTestSpec) DeepCopy

func (in *DistributedTestSpec) DeepCopy() *DistributedTestSpec

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

func (*DistributedTestSpec) DeepCopyInto

func (in *DistributedTestSpec) DeepCopyInto(out *DistributedTestSpec)

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

type PrepareSpec

type PrepareSpec struct {
	// Checkout whether checkout repository before testing ( default: true ).
	Checkout *bool             `json:"checkout,omitempty"`
	Image    string            `json:"image,omitempty"`
	Steps    []PrepareStepSpec `json:"steps"`
}

func (*PrepareSpec) DeepCopy

func (in *PrepareSpec) DeepCopy() *PrepareSpec

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

func (*PrepareSpec) DeepCopyInto

func (in *PrepareSpec) DeepCopyInto(out *PrepareSpec)

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

type PrepareStepSpec

type PrepareStepSpec struct {
	Name    string  `json:"name"`
	Image   string  `json:"image,omitempty"`
	Command Command `json:"command"`
	// Workdir ( default: /git/workspace )
	Workdir string          `json:"workdir,omitempty"`
	Env     []corev1.EnvVar `json:"env,omiempty"`
}

func (*PrepareStepSpec) DeepCopy

func (in *PrepareStepSpec) DeepCopy() *PrepareStepSpec

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

func (*PrepareStepSpec) DeepCopyInto

func (in *PrepareStepSpec) DeepCopyInto(out *PrepareStepSpec)

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

type TestJob

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

	Spec   TestJobSpec   `json:"spec,omitempty"`
	Status TestJobStatus `json:"status,omitempty"`
}

TestJob is the Schema for the testjobs API

func (*TestJob) DeepCopy

func (in *TestJob) DeepCopy() *TestJob

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

func (*TestJob) DeepCopyInto

func (in *TestJob) DeepCopyInto(out *TestJob)

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

func (*TestJob) DeepCopyObject

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

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

type TestJobList

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

TestJobList contains a list of TestJob

func (*TestJobList) DeepCopy

func (in *TestJobList) DeepCopy() *TestJobList

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

func (*TestJobList) DeepCopyInto

func (in *TestJobList) DeepCopyInto(out *TestJobList)

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

func (*TestJobList) DeepCopyObject

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

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

type TestJobRunner

type TestJobRunner struct {
	*kubernetes.Clientset
	// contains filtered or unexported fields
}

func NewTestJobRunner

func NewTestJobRunner(clientset *kubernetes.Clientset) *TestJobRunner

func (*TestJobRunner) DisableCommandLog

func (r *TestJobRunner) DisableCommandLog()

func (*TestJobRunner) DisablePrepareLog

func (r *TestJobRunner) DisablePrepareLog()

func (*TestJobRunner) DisableResultLog added in v0.2.0

func (r *TestJobRunner) DisableResultLog()

func (*TestJobRunner) Run

func (r *TestJobRunner) Run(ctx context.Context, testjob TestJob) error

func (*TestJobRunner) SetLogger

func (r *TestJobRunner) SetLogger(logger func(*kubejob.ContainerLog))

func (*TestJobRunner) SetToken

func (r *TestJobRunner) SetToken(token string)

type TestJobSecretKeyRef

type TestJobSecretKeyRef struct {
	Name string `json:"name"`
	Key  string `json:"key"`
}

func (*TestJobSecretKeyRef) DeepCopy

func (in *TestJobSecretKeyRef) DeepCopy() *TestJobSecretKeyRef

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

func (*TestJobSecretKeyRef) DeepCopyInto

func (in *TestJobSecretKeyRef) DeepCopyInto(out *TestJobSecretKeyRef)

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

type TestJobSpec

type TestJobSpec struct {

	// Image name for clone and checkout by git protocol.
	GitImage string `json:"gitImage,omitempty"`
	// Checkout whether checkout repository before testing ( default: true ).
	Checkout *bool `json:"checkout,omitempty"`
	// Image name.
	Image string `json:"image"`
	// Repository name.
	Repo string `json:"repo"`
	// Command for testing.
	Command Command `json:"command"`
	// Workdir ( default: /git/workspace )
	Workdir string `json:"workdir,omitempty"`
	// Branch name.
	Branch string `json:"branch,omitempty"`
	// Revision.
	Rev string `json:"rev,omitempty"`
	// OAuth token to fetch private repository
	Token *TestJobToken `json:"token,omitempty"`
	// List of environment variables to set in the container.
	Env []corev1.EnvVar `json:"env,omiempty"`
	// Volumes list of volumes that can be mounted by containers belonging to the pod.
	// More info: https://kubernetes.io/docs/concepts/storage/volumes
	Volumes []corev1.Volume `json:"volumes,omitempty"`
	// VolumeMounts pod volumes to mount into the container's filesystem.
	VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
	// Log extend parameter to output log.
	Log map[string]string `json:"log,omitempty"`
	// ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this TestJobSpec.
	// If specified, these secrets will be passed to individual puller implementations for them to use. For example,
	// in the case of docker, only DockerConfig type secrets are honored.
	// More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
	// Prepare steps before testing
	Prepare PrepareSpec `json:"prepare,omitempty"`
	// Distributed testing parameter
	DistributedTest *DistributedTestSpec `json:"distributedTest,omitempty"`
}

TestJobSpec defines the desired state of TestJob

func (*TestJobSpec) DeepCopy

func (in *TestJobSpec) DeepCopy() *TestJobSpec

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

func (*TestJobSpec) DeepCopyInto

func (in *TestJobSpec) DeepCopyInto(out *TestJobSpec)

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

type TestJobStatus

type TestJobStatus struct {

	// Whether the testjob is running
	Running bool `json:"running,omitempty"`
}

TestJobStatus defines the observed state of TestJob

func (*TestJobStatus) DeepCopy

func (in *TestJobStatus) DeepCopy() *TestJobStatus

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

func (*TestJobStatus) DeepCopyInto

func (in *TestJobStatus) DeepCopyInto(out *TestJobStatus)

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

type TestJobToken

type TestJobToken struct {
	SecretKeyRef TestJobSecretKeyRef `json:"secretKeyRef"`
}

func (*TestJobToken) DeepCopy

func (in *TestJobToken) DeepCopy() *TestJobToken

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

func (*TestJobToken) DeepCopyInto

func (in *TestJobToken) DeepCopyInto(out *TestJobToken)

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

type TestResultLog added in v0.2.0

type TestResultLog struct {
	Status         TestResultStatus    `json:"status"`
	Job            string              `json:"job"`
	ElapsedTimeSec int                 `json:"elapsedTimeSec"`
	StartedAt      time.Time           `json:"startedAt"`
	Details        TestResultLogDetail `json:"details"`
}

type TestResultLogDetail added in v0.2.0

type TestResultLogDetail struct {
}

type TestResultStatus added in v0.2.0

type TestResultStatus string
const (
	TestResultStatusSuccess TestResultStatus = "success"
	TestResultStatusFailure TestResultStatus = "failure"
)

Jump to

Keyboard shortcuts

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