v1alpha1

package
Version: v0.21.2 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: Apache-2.0 Imports: 8 Imported by: 19

Documentation

Index

Constants

View Source
const (
	// AnnotationTenantNamespacePrefix is the key of the annotation
	// of a Steward client namespace defining the prefix of tenant namespaces
	// belonging to this client.
	AnnotationTenantNamespacePrefix = steward.GroupName + "/tenant-namespace-prefix"

	// AnnotationTenantNamespaceSuffixLength is the key of the annotation
	// of a Steward client namespace defining the number of characters used for
	// the random suffix of a tenant namespace name.
	AnnotationTenantNamespaceSuffixLength = steward.GroupName + "/tenant-namespace-suffix-length"

	// AnnotationTenantRole is the key of the annotation of a Steward client
	// namespace defining the name of the ClusterRole to be assigned to the
	// default service account of a tenant namespace.
	AnnotationTenantRole = steward.GroupName + "/tenant-role"

	// AnnotationSecretRename is the key of the annotation used to rename a secret.
	// If this annotation is set on a secret it will be created in the run namespace
	// with this name if it is listed in the pipelineRuns spec.secrets list.
	AnnotationSecretRename = steward.GroupName + "/secret-rename-to"
)

annotations

View Source
const (
	// LabelSystemManaged is the key of the label whose presence indicates
	// that this resource is managed by the Steward system and should not be
	// modified otherwise.
	// The value of the label is ignored and should be empty.
	LabelSystemManaged = steward.GroupName + "/system-managed"

	// LabelIgnore is the key of the label whose presence indicates
	// that this resource object should be ignored by the Steward system.
	// The value of the label is ignored and should be empty.
	LabelIgnore = steward.GroupName + "/ignore"

	// LabelOwnerClientName is the key of the label that identifies the Steward
	// _client_ that the labelled object is owned by.
	// As Steward clients are currently represented by K8s namespaces only,
	// the label value is the name of the respective client namespace.
	// This may change in the future when Steward clients are represented by
	// dedicated custom resources.
	LabelOwnerClientName = steward.GroupName + "/owner-client-name"

	// LabelOwnerClientNamespace is the key of the label that identifies the
	// namespace assigned to the Steward _client_ that the labelled object is
	// owned by.
	LabelOwnerClientNamespace = steward.GroupName + "/owner-client-namespace"

	// LabelOwnerTenantName is the key of the label that identifies the Steward
	// _tenant_ that the labelled object is owned by.
	// The label value is the name of the Tenant custom resource.
	LabelOwnerTenantName = steward.GroupName + "/owner-tenant-name"

	// LabelOwnerTenantNamespace is the key of the label that identifies the
	// namespace assigned to the Steward _tenant_ that the labelled object is
	// owned by.
	LabelOwnerTenantNamespace = steward.GroupName + "/owner-tenant-namespace"

	// LabelOwnerPipelineRunName is the key of the label that identifies the
	// Steward _pipeline run_ that the labelled object is owned by.
	// The label value is the name of the PipelineRun custom resource.
	LabelOwnerPipelineRunName = steward.GroupName + "/owner-pipelinerun-name"
)

labels

View Source
const (
	// EventReasonPreparingFailed is the reason for a event occuring when the run controller
	// faces an intermittent error during preparing phase.
	EventReasonPreparingFailed = "PreparingFailed"

	// EventReasonWaitingFailed is the reason for a event occuring when the run controller
	// faces an intermittent error during wait phase.
	EventReasonWaitingFailed = "WaitingFailed"

	// EventReasonRunningFailed is the reason for a event occuring when the run controller
	// faces an intermittent error during running phase.
	EventReasonRunningFailed = "RunningFailed"

	// EventReasonCleaningFailed is the reason for a event occuring when the run controller
	// faces an intermittent error during cleanup phase.
	EventReasonCleaningFailed = "CleaningFailed"

	// EventReasonLoadPipelineRunsConfigFailed is the reason for an event occuring when the
	// loading of the pipeline runs configuration fails.
	EventReasonLoadPipelineRunsConfigFailed = "LoadPipelineRunsConfigFailed"

	// EventReasonMaintenanceMode is the reason for an event occuring when a pipeline
	// run is not started due to maintenance mode
	EventReasonMaintenanceMode = "MaintenanceMode"

	// MaintenanceModeConfigMapName is the name of the config map to enable the maintenance mode
	MaintenanceModeConfigMapName = "steward-maintenance-mode"

	// MaintenanceModeKeyName is the name of the key to enable the maintenance mode
	MaintenanceModeKeyName = "maintenanceMode"
)

K8s events

View Source
const (
	// StatusReasonFailed indicates that the reason for the status
	// is an unspecified failure.
	StatusReasonFailed = "Failed"

	// StatusReasonDependentResourceState indicates that the reason for the
	// status is the state of another resource controlled by this resource.
	StatusReasonDependentResourceState = "InvalidDependentResource"
)
View Source
const GroupVersion = "v1alpha1"

GroupVersion is the version for the scheme

Variables

View Source
var (
	// SchemeBuilder builds the scheme
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme ...
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: x.GroupName, Version: GroupVersion}

SchemeGroupVersion ...

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type CustomJSON

type CustomJSON struct {
	Value interface{}
}

CustomJSON is used for fields where any JSON value is allowed. It exists only to provide deep copy methods. The zero value represents a JSON null value.

func (*CustomJSON) DeepCopy

func (c *CustomJSON) DeepCopy() *CustomJSON

DeepCopy creates a new CustomJSON as a deep copy of the receiver.

func (*CustomJSON) DeepCopyInto

func (c *CustomJSON) DeepCopyInto(out *CustomJSON)

DeepCopyInto writes a deep copy of the receiver into out. c must be non-nil.

func (*CustomJSON) MarshalJSON

func (c *CustomJSON) MarshalJSON() ([]byte, error)

MarshalJSON fulfills interface encoding.json.Marshaler

func (*CustomJSON) UnmarshalJSON

func (c *CustomJSON) UnmarshalJSON(data []byte) error

UnmarshalJSON fulfills interface encoding.json.Unmarshaler

type Elasticsearch

type Elasticsearch struct {
	// The identifier of this pipeline run, attached as
	// field `runid` to each log entry.
	// It can by any JSON value (object, array, string,
	// number, bool).
	RunID *CustomJSON `json:"runID"`

	// IndexURL is the HTTP(S) URL of the Elasticsearch index to write
	// logs to.
	// If not set, a default log destination will be used.
	// +optional
	IndexURL string `json:"indexURL,omitempty"`

	// AuthSecret is the name of the Kubernetes `v1/Secret` resource object
	// of type `kubernetes.io/basic-auth` that contains the username and
	// password for authenticating requests to `IndexURL`.
	// It is ignored when `IndexURL` is not set.
	// +optional
	AuthSecret string `json:"authSecret,omitempty"`
}

Elasticsearch contains logging configuration for the Elasticsearch log implementation.

func (*Elasticsearch) DeepCopy

func (in *Elasticsearch) DeepCopy() *Elasticsearch

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

func (*Elasticsearch) DeepCopyInto

func (in *Elasticsearch) DeepCopyInto(out *Elasticsearch)

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

type Intent

type Intent string

Intent denotes how the pipeline run should be handled

const (
	// IntentRun indicates that the pipeline should run to completion.
	IntentRun Intent = "run"
	// IntentAbort indicates that the pipeline run should be aborted
	// if it is not completed already.
	IntentAbort Intent = "abort"
)

type JenkinsFile

type JenkinsFile struct {

	// URL is the URL of the Git repository containing the pipeline definition
	// (aka `Jenkinsfile`).
	URL string `json:"repoUrl"`

	// Revision is the revision of the pipeline Git repository to be used, e.g.
	// `master`.
	Revision string `json:"revision"`

	// Path is the relative pathname of the pipeline definition file in the
	// repository check-out, typically `Jenkinsfile`.
	Path string `json:"relativePath"`

	// RepoAuthSecret is the name of the Kubernetes `v1/Secret` resource object
	// of type `kubernetes.io/basic-auth` that contains the username and
	// password for authentication when cloning from `spec.jenkinsFile.repoUrl`.
	// +optional
	RepoAuthSecret string `json:"repoAuthSecret,omitempty"`
}

JenkinsFile represents the location from where to get the pipeline

func (*JenkinsFile) DeepCopy

func (in *JenkinsFile) DeepCopy() *JenkinsFile

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

func (*JenkinsFile) DeepCopyInto

func (in *JenkinsFile) DeepCopyInto(out *JenkinsFile)

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

type JenkinsfileRunnerSpec added in v0.6.0

type JenkinsfileRunnerSpec struct {
	// Image is the image name including the tag or digest
	Image string `json:"image,omitempty"`

	// ImagePullPolicy is the pull policy for the image
	ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
}

JenkinsfileRunnerSpec carries configuration options for the Jenkinsfile Runner container.

func (*JenkinsfileRunnerSpec) DeepCopy added in v0.6.0

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

func (*JenkinsfileRunnerSpec) DeepCopyInto added in v0.6.0

func (in *JenkinsfileRunnerSpec) DeepCopyInto(out *JenkinsfileRunnerSpec)

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

type Logging

type Logging struct {

	// Elasticsearch is the configuration for pipeline logging to Elasticsearch.
	// If not specified, logging to Elasticsearch is disabled and the default
	// Jenkins log implementation is used (stdout of Jenkinsfile Runner
	// container).
	// +optional
	Elasticsearch *Elasticsearch `json:"elasticsearch"`
}

Logging contains all logging-specific configuration.

func (*Logging) DeepCopy

func (in *Logging) DeepCopy() *Logging

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

func (*Logging) DeepCopyInto

func (in *Logging) DeepCopyInto(out *Logging)

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

type PipelineRun

type PipelineRun struct {
	metav1.TypeMeta `json:",inline"`

	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec PipelineSpec `json:"spec"`

	// +optional
	Status PipelineStatus `json:"status"`
}

PipelineRun is a Kubernetes custom resource type representing the execution of a pipeline. +genclient +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*PipelineRun) DeepCopy

func (in *PipelineRun) DeepCopy() *PipelineRun

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

func (*PipelineRun) DeepCopyInto

func (in *PipelineRun) DeepCopyInto(out *PipelineRun)

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

func (*PipelineRun) DeepCopyObject

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

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

type PipelineRunDetails

type PipelineRunDetails struct {

	// JobName is the name of the job this pipeline run belongs to. It is used
	// as the name of the Jenkins job and therefore must be a valid Jenkins job
	// name. If empty, a default name will be used for the Jenkins job.
	// TODO: Regex in CRD to validate "valid Jenkins job names"
	// +optional
	JobName string `json:"jobName,omitempty"`

	// SequenceNumber is the sequence number of the pipeline run, which
	// translates into the build number of the Jenkins job.
	// +optional
	SequenceNumber int32 `json:"sequenceNumber,omitempty"`

	// Cause is a textual description of the cause of this pipeline run. Will be
	// set as cause of the Jenkins job. If empty, no cause information
	// will be available.
	// +optional
	Cause string `json:"cause,omitempty"`
}

PipelineRunDetails provides metadata for a pipeline run which is evaluated by the Jenkinsfile Runner.

func (*PipelineRunDetails) DeepCopy

func (in *PipelineRunDetails) DeepCopy() *PipelineRunDetails

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

func (*PipelineRunDetails) DeepCopyInto

func (in *PipelineRunDetails) DeepCopyInto(out *PipelineRunDetails)

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

type PipelineRunList

type PipelineRunList struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []PipelineRun `json:"items"`
}

PipelineRunList is a list of PipelineRun objects. +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*PipelineRunList) DeepCopy

func (in *PipelineRunList) DeepCopy() *PipelineRunList

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

func (*PipelineRunList) DeepCopyInto

func (in *PipelineRunList) DeepCopyInto(out *PipelineRunList)

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

func (*PipelineRunList) DeepCopyObject

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

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

type PipelineSpec

type PipelineSpec struct {
	// JenkinsfileRunner configures the Jenkinsfile Runner container.
	JenkinsfileRunner *JenkinsfileRunnerSpec `json:"jenkinsfileRunner,omitempty"`

	// JenkinsFile contains the configuration of the Jenkins pipeline definition
	// to be executed.
	JenkinsFile JenkinsFile `json:"jenkinsFile"`

	// Args contains the key-value parameters to pass to the pipeline.
	// +optional
	Args map[string]string `json:"args,omitempty"`

	// Secrets is the list of secrets to be made available to the pipeline
	// execution. Each entry in the list is the name of a Kubernetes `v1/Secret`
	// resource object in the same namespace as the PipelineRun object itself.
	// +optional
	Secrets []string `json:"secrets,omitempty"`

	// ImagePullSecrets is the list of image pull secrets required by the
	// pipeline run to pull images of custom containers from private registries.
	// Each entry in the list is the name of a Kubernetes `v1/Secret` resource
	// object of type `kubernetes.io/dockerconfigjson` in the same namespace as
	// the PipelineRun object itself.
	// +optional
	ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`

	// Intent is the intention of the client regarding the way this pipeline run
	// should be processed. The value `run` indicates that the pipeline should
	// run to completion, while the value `abort` indicates that the pipeline
	// processing should be stopped as soon as possible. An empty string value
	// is equivalent to value `run`.
	// TODO: Controller should set intent=run explicitely if not set
	// +optional
	Intent Intent `json:"intent,omitempty"`

	// Logging contains the logging configuration.
	// +optional
	Logging *Logging `json:"logging,omitempty"`

	// RunDetails provides metadata for a pipeline run which is evaluated by the
	// Jenkinsfile Runner.
	// +optional
	RunDetails *PipelineRunDetails `json:"runDetails,omitempty"`

	Profiles *Profiles `json:"profiles,omitempty"`

	Timeout *metav1.Duration `json:"timeout,omitempty"`
}

PipelineSpec is the spec of a PipelineRun

func (*PipelineSpec) DeepCopy

func (in *PipelineSpec) DeepCopy() *PipelineSpec

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

func (*PipelineSpec) DeepCopyInto

func (in *PipelineSpec) DeepCopyInto(out *PipelineSpec)

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

type PipelineStatus

type PipelineStatus struct {

	// StartedAt is the time the pipeline run has been started.
	// +optional
	StartedAt *metav1.Time `json:"startedAt,omitempty"`

	// FinishedAt is the time the pipeline run has been finished.
	// +optional
	FinishedAt *metav1.Time `json:"finishedAt,omitempty"`

	State              State                 `json:"state"`
	StateDetails       StateItem             `json:"stateDetails"`
	StateHistory       []StateItem           `json:"stateHistory"`
	Result             Result                `json:"result"`
	Container          corev1.ContainerState `json:"container,omitempty"`
	MessageShort       string                `json:"messageShort"`
	Message            string                `json:"message"`
	History            []string              `json:"history"`
	Namespace          string                `json:"namespace"`
	AuxiliaryNamespace string                `json:"auxiliaryNamespace"`
}

PipelineStatus represents the status of the pipeline

func (*PipelineStatus) DeepCopy

func (in *PipelineStatus) DeepCopy() *PipelineStatus

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

func (*PipelineStatus) DeepCopyInto

func (in *PipelineStatus) DeepCopyInto(out *PipelineStatus)

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

type Profiles added in v0.6.0

type Profiles struct {

	// Network selects the network profile. It currently determines which network connections
	// are allowed. The scope of the network profile might be extended in the future.
	// If empty, a default profile will be used.
	Network string `json:"network,omitempty"`
}

Profiles selects configuration profiles for different aspects.

func (*Profiles) DeepCopy added in v0.6.0

func (in *Profiles) DeepCopy() *Profiles

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

func (*Profiles) DeepCopyInto added in v0.6.0

func (in *Profiles) DeepCopyInto(out *Profiles)

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

type Result

type Result string

Result of the pipeline run

const (
	// ResultUndefined - undefined result
	ResultUndefined Result = ""
	// ResultSuccess - the pipeline run was processed successfully
	ResultSuccess Result = "success"
	// ResultErrorInfra - the pipeline run failed due to an infrastructure problem
	ResultErrorInfra Result = "error_infra"
	// ResultErrorContent -  the pipeline run failed due to an content problem
	ResultErrorContent Result = "error_content"
	// ResultErrorConfig - the pipeline run failed due to a client-side configuration error
	ResultErrorConfig Result = "error_config"
	// ResultAborted - the pipeline run has been aborted
	ResultAborted Result = "aborted"
	// ResultTimeout - the pipeline run timed out
	ResultTimeout Result = "timeout"
	// ResultDeleted - the pipeline run was deleted
	ResultDeleted Result = "deleted"
)

type State

type State string

State represents the state

const (
	// StateUndefined - the state was not yet set
	StateUndefined State = ""
	// StateNew - pipeline run is first checked by the controller
	StateNew State = "new"
	// StatePreparing - the namespace for the execution is prepared
	StatePreparing State = "preparing"
	// StateWaiting - the pipeline run is waiting to be processed
	StateWaiting State = "waiting"
	// StateRunning - the pipeline is running
	StateRunning State = "running"
	// StateCleaning - cleanup is ongoing
	StateCleaning State = "cleaning"
	// StateFinished - the pipeline run has finished
	StateFinished State = "finished"
)

type StateItem

type StateItem struct {
	State      State       `json:"state"`
	StartedAt  metav1.Time `json:"startedAt"`
	FinishedAt metav1.Time `json:"finishedAt,omitempty"`
}

StateItem holds start and end time of a state in the history

func (*StateItem) DeepCopy

func (in *StateItem) DeepCopy() *StateItem

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

func (*StateItem) DeepCopyInto

func (in *StateItem) DeepCopyInto(out *StateItem)

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

type Tenant

type Tenant struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`
	// +optional
	Status TenantStatus `json:"status"`
}

Tenant is representing a Tenant and its status +genclient +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*Tenant) DeepCopy

func (in *Tenant) DeepCopy() *Tenant

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

func (*Tenant) DeepCopyInto

func (in *Tenant) DeepCopyInto(out *Tenant)

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

func (*Tenant) DeepCopyObject

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

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

type TenantList

type TenantList struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Tenant `json:"items"`
}

TenantList is a list of Tenants +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*TenantList) DeepCopy

func (in *TenantList) DeepCopy() *TenantList

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

func (*TenantList) DeepCopyInto

func (in *TenantList) DeepCopyInto(out *TenantList)

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

func (*TenantList) DeepCopyObject

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

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

type TenantStatus

type TenantStatus struct {
	knativeduck.Status `json:",inline"`

	TenantNamespaceName string `json:"tenantNamespaceName,omitempty"`
}

TenantStatus contains the status of a Tenant

func (*TenantStatus) DeepCopy

func (in *TenantStatus) DeepCopy() *TenantStatus

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

func (*TenantStatus) DeepCopyInto

func (in *TenantStatus) DeepCopyInto(out *TenantStatus)

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

func (*TenantStatus) GetCondition

func (s *TenantStatus) GetCondition(condType knativeapis.ConditionType) *knativeapis.Condition

GetCondition returns the condition matching the given condition type.

func (*TenantStatus) SetCondition

func (s *TenantStatus) SetCondition(cond *knativeapis.Condition)

SetCondition sets the given condition.

Jump to

Keyboard shortcuts

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