v1

package
v0.0.0-...-fed044c Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package v1 is the v1 version of the API.

Index

Constants

This section is empty.

Variables

View Source
var (
	// SchemeBuilder initializes a scheme builder
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme is a global function that registers this API group & version to a scheme
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var (
	// ErrTagMissingLabel indicates that tag label is missing.
	ErrTagMissingLabel = errors.New("missing tag label")
	// ErrTagMissingValue indicates that tag value is missing.
	ErrTagMissingValue = errors.New("missing tag value")
	// ErrTagValueMaxLengthExceeded indicates that tag value is too long.
	ErrTagValueMaxLengthExceeded = errors.New("tag value is too long")
)
View Source
var (
	ErrUnknownLoadTestPhase = errors.New("unknown Load Test phase")
)

Possible load test errors

View Source
var SchemeGroupVersion = schema.GroupVersion{Group: testrun.GroupName, Version: "v1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type ImageDetails

type ImageDetails struct {
	Image string `json:"image"`
	Tag   string `json:"tag"`
}

ImageDetails is the image information for a resource

func (*ImageDetails) DeepCopy

func (in *ImageDetails) DeepCopy() *ImageDetails

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

func (*ImageDetails) DeepCopyInto

func (in *ImageDetails) DeepCopyInto(out *ImageDetails)

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

type LoadTest

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

	Spec   LoadTestSpec   `json:"spec"`
	Status LoadTestStatus `json:"status"`
}

LoadTest is a specification for a LoadTest resource

func BuildLoadTestObject

func BuildLoadTestObject(spec LoadTestSpec) (*LoadTest, error)

BuildLoadTestObject initialize new LoadTest custom resource

func (*LoadTest) DeepCopy

func (in *LoadTest) DeepCopy() *LoadTest

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

func (*LoadTest) DeepCopyInto

func (in *LoadTest) DeepCopyInto(out *LoadTest)

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

func (*LoadTest) DeepCopyObject

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

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

type LoadTestList

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

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

LoadTestList is a list of LoadTest resources

func (*LoadTestList) DeepCopy

func (in *LoadTestList) DeepCopy() *LoadTestList

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

func (*LoadTestList) DeepCopyInto

func (in *LoadTestList) DeepCopyInto(out *LoadTestList)

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

func (*LoadTestList) DeepCopyObject

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

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

type LoadTestPhase

type LoadTestPhase string

LoadTestPhase defines the phases that a loadtest can be in

const (
	// LoadTestCreating is after a namespaces has been created for a LoadTest
	// but before any process have been created
	LoadTestCreating LoadTestPhase = "creating"
	// LoadTestStarting is when we have created the jmeter job but there are
	// no active pods
	LoadTestStarting LoadTestPhase = "starting"
	// LoadTestRunning is the status that a loadtest has when the jmeter master job
	// has at least 1 active pod
	LoadTestRunning LoadTestPhase = "running"
	// LoadTestFinished is used when the jmeter master job has run and is finished
	// running. This does not tell us of the status of the job, to know if the job
	// was successful we need to look at the jobStatus
	LoadTestFinished LoadTestPhase = "finished"
	// LoadTestErrored is set in case of resource creating failed because of
	// incorrect data provided by user
	LoadTestErrored LoadTestPhase = "errored"
)

func LoadTestPhaseFromString

func LoadTestPhaseFromString(phase string) (LoadTestPhase, error)

LoadTestPhaseFromString tries to get LoadTestPhase from string value. Empty phase is a valid value and does not cause error, so caller should take care of checking if the phase is set to one of the pre-defined values or empty.

func (LoadTestPhase) String

func (p LoadTestPhase) String() string

String returns string representation of LoadTestPhase

type LoadTestPodsStatus

type LoadTestPodsStatus struct {
	Current *int32 `json:"current"`
	Desired *int32 `json:"desired"`
}

LoadTestPodsStatus is a specification for a LoadTestStatus resource

func (*LoadTestPodsStatus) DeepCopy

func (in *LoadTestPodsStatus) DeepCopy() *LoadTestPodsStatus

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

func (*LoadTestPodsStatus) DeepCopyInto

func (in *LoadTestPodsStatus) DeepCopyInto(out *LoadTestPodsStatus)

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

type LoadTestSpec

type LoadTestSpec struct {
	Type            LoadTestType      `json:"type"`
	Overwrite       bool              `json:"overwrite"`
	MasterConfig    ImageDetails      `json:"masterConfig"`
	WorkerConfig    ImageDetails      `json:"workerConfig"`
	DistributedPods *int32            `json:"distributedPods"`
	Tags            LoadTestTags      `json:"tags"`
	TestFile        []byte            `json:"testFile"`
	TestData        []byte            `json:"testData,omitempty"`
	EnvVars         map[string]string `json:"envVars,omitempty"`
	TargetURL       string            `json:"targetURL,omitempty"`
	Duration        time.Duration     `json:"duration,omitempty"`
}

LoadTestSpec is the spec for a LoadTest resource

func NewSpec

func NewSpec(loadTestType LoadTestType, overwrite bool, distributedPods int32, tags LoadTestTags, testFile, testData []byte, envVars map[string]string, masterConfig, workerConfig ImageDetails, targetURL string, duration time.Duration) LoadTestSpec

NewSpec initialize spec for LoadTest custom resource

func (*LoadTestSpec) DeepCopy

func (in *LoadTestSpec) DeepCopy() *LoadTestSpec

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

func (*LoadTestSpec) DeepCopyInto

func (in *LoadTestSpec) DeepCopyInto(out *LoadTestSpec)

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

type LoadTestStatus

type LoadTestStatus struct {
	Phase     LoadTestPhase      `json:"phase"`
	Namespace string             `json:"namespace"`
	JobStatus batchv1.JobStatus  `json:"jobStatus"`
	Pods      LoadTestPodsStatus `json:"pods"`
}

LoadTestStatus is the status for a LoadTest resource

func (*LoadTestStatus) DeepCopy

func (in *LoadTestStatus) DeepCopy() *LoadTestStatus

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

func (*LoadTestStatus) DeepCopyInto

func (in *LoadTestStatus) DeepCopyInto(out *LoadTestStatus)

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

type LoadTestTags

type LoadTestTags map[string]string

LoadTestTags is a list of tags of a LoadTest resource.

func LoadTestTagsFromString

func LoadTestTagsFromString(tagsStr string) (LoadTestTags, error)

LoadTestTagsFromString builds tags from string.

func (LoadTestTags) DeepCopy

func (in LoadTestTags) DeepCopy() LoadTestTags

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

func (LoadTestTags) DeepCopyInto

func (in LoadTestTags) DeepCopyInto(out *LoadTestTags)

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

type LoadTestType

type LoadTestType string

LoadTestType needs to be specified to know what tool to use when running a loadtest

const (
	// LoadTestTypeJMeter tells the controller to run the loadtest using JMeter
	LoadTestTypeJMeter LoadTestType = "JMeter"
	// LoadTestTypeFake tells controller to use fake provider
	LoadTestTypeFake LoadTestType = "Fake"
	// LoadTestTypeLocust tells controller to use Locust provider
	LoadTestTypeLocust LoadTestType = "Locust"
	// LoadTestTypeGhz tells controller to use ghz provider
	LoadTestTypeGhz LoadTestType = "Ghz"
	// LoadTestTypeK6 tells controller to use k6 provider
	LoadTestTypeK6 LoadTestType = "K6"
)

func (LoadTestType) String

func (t LoadTestType) String() string

String returns string representation of LoadTestType

type MasterConfig

type MasterConfig struct {
	Master *ImageDetails
}

MasterConfig is the configuration information for each resource type

func (*MasterConfig) DeepCopy

func (in *MasterConfig) DeepCopy() *MasterConfig

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

func (*MasterConfig) DeepCopyInto

func (in *MasterConfig) DeepCopyInto(out *MasterConfig)

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

type WorkerConfig

type WorkerConfig struct {
	Worker *ImageDetails
}

WorkerConfig is the configuration information for each resource type

func (*WorkerConfig) DeepCopy

func (in *WorkerConfig) DeepCopy() *WorkerConfig

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

func (*WorkerConfig) DeepCopyInto

func (in *WorkerConfig) DeepCopyInto(out *WorkerConfig)

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