Documentation ¶
Index ¶
- Constants
- Variables
- func Resource(resource string) schema.GroupResource
- type CustomJSON
- type Elasticsearch
- type Intent
- type JenkinsFile
- type JenkinsfileRunnerSpec
- type Logging
- type PipelineRun
- type PipelineRunDetails
- type PipelineRunList
- type PipelineSpec
- type PipelineStatus
- type Profiles
- type Result
- type State
- type StateItem
Constants ¶
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" // 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" // LabelOwnerPipelineRunNamespace is the key of the label that identifies // the namespace of the Steward _pipeline run_ that the labelled object is // owned by. LabelOwnerPipelineRunNamespace = steward.GroupName + "/owner-pipelinerun-namespace" )
labels
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
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" )
const ( // 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
const GroupVersion = "v1alpha1"
GroupVersion is the version for the scheme
Variables ¶
var ( // SchemeBuilder builds the scheme SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme ... AddToScheme = SchemeBuilder.AddToScheme )
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 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
func (in *JenkinsfileRunnerSpec) DeepCopy() *JenkinsfileRunnerSpec
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Logging.
func (*Logging) DeepCopyInto ¶
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
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Profiles.
func (*Profiles) DeepCopyInto ¶ added in v0.6.0
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StateItem.
func (*StateItem) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.