tekton

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Copyright 2020 WILDCARD

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Created on 24/01/2021

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Created on 06/02/2021

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Created on 06/02/2021

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Created on 27/01/2021

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Created on 24/01/2021

Index

Constants

This section is empty.

Variables

View Source
var Reason = map[string]string{
	"default":                         "",
	"couldntgetpipeline":              "Internal error",
	"invalidworkspacebindings":        "Internal error : Workspace resource missing",
	"invalidserviceaccountmappings":   "Internal error : invalid access",
	"invalidpipelineresourcebindings": "Internal error : invalid pipeline resource",
	"parametertypemismatch":           "Internal error : Pipeline generation failed",
	"couldntgettask":                  "Internal error : task missing",
	"couldntgetresource":              "Internal error : missing resource",
	"pipelineruntimeout":              "Pipeline timeout",
	"couldntgetcondition":             "Internal error : Condition missing",
	"parametermissing":                "Internal error : Pipeline",
	"pipelinevalidationfailed":        "Internal error : Pipeline generation failed",
	"pipelineinvalidgraph":            "Internal error : Pipeline invalid",
	"pipelineruncancelled":            "Pipeline cancelled",
	"pipelineruncouldntcancel":        "Pipeline couldn't cancel",
	"pending":                         "Creating steps",
}

Reason ...

Functions

func Condition

func Condition(c v1beta1.Conditions) (status string, reason string)

Condition returns a human readable text based on the status of the Condition

func FormattedStepName added in v0.1.2

func FormattedStepName(name string) string

FormattedStepName ...

func IsTerminated

func IsTerminated(c v1beta1.Conditions) bool

IsTerminated returns if a pod is terminated

func StepReasonExists

func StepReasonExists(state tkn.StepState) string

StepReasonExists ...

Types

type PipelineRunPayload

type PipelineRunPayload struct {
	NamespacedName types.NamespacedName `json:"namespaced_name"`
	Status         string               `json:"status"`
	Message        string               `json:"message"`
	RepoURL        string               `json:"repo_url"`
	Branch         string               `json:"branch"`
	CommitID       string               `json:"commit_id"`
	CommitMsg      string               `json:"commit_msg"`
	TaskRuns       []TaskRunPayload     `json:"task_runs"`
	ProjectID      int64                `json:"project_id"`
	PipelineID     int64                `json:"pipeline_id"`
	StartTime      int64                `json:"start_time"`
	CompletionTime int64                `json:"completion_time"`
}

func (PipelineRunPayload) GetTask

func (PipelineRunPayload) GetTask(taskRunName string, taskrunStatus *tkn.PipelineRunTaskRunStatus) Task

func (*PipelineRunPayload) GetTasks

func (p *PipelineRunPayload) GetTasks(pr *tkn.PipelineRun) (ts Tasks)

func (*PipelineRunPayload) SetCondition

func (p *PipelineRunPayload) SetCondition(c v1beta1.Conditions)

func (*PipelineRunPayload) UpdateTaskRuns

func (p *PipelineRunPayload) UpdateTaskRuns(taskrun TaskRunPayload)

type Step

type Step struct {
	Name    string `json:"name"`
	RawName string `json:"raw_name"`
	Status  string `json:"status"`
	Message string `json:"message"`
}

func GetSteps

func GetSteps(status tkn.TaskRunStatus) (steps []Step)

type Task

type Task struct {
	TaskRunName    string `json:"-"`
	Name           string `json:"name"`
	Status         string `json:"status"`
	StartTime      int64  `json:"start_time"`
	CompletionTime int64  `json:"completion_time"`
	Duration       string `json:"duration"`
	Message        string `json:"message"`
	Steps          []Step `json:"steps"`

	CompletionTimeRaw *metav1.Time `json:"completion_time_raw"`
	StartTimeRaw      *metav1.Time `json:"start_time_raw"`
}

type TaskRunPayload

type TaskRunPayload struct {
	NamespacedName types.NamespacedName `json:"namespaced_name"`
	Tasks          []Task               `json:"tasks"`
}

func (TaskRunPayload) GetTask

func (TaskRunPayload) GetTask(taskRun *tkn.TaskRun) Task

func (*TaskRunPayload) UpdateTask

func (t *TaskRunPayload) UpdateTask(newTask Task)

type Tasks

type Tasks []Task

func (Tasks) Len

func (t Tasks) Len() int

Len is a method for Sort

func (Tasks) Less

func (t Tasks) Less(i, j int) bool

Less is a sort method

func (Tasks) Swap

func (t Tasks) Swap(i, j int)

Swap is a method for Sort

type Tekton

type Tekton struct {
	ProjectID   int64              `json:"project_id"`
	PipelineID  int64              `json:"pipeline_id"`
	PipelineRun PipelineRunPayload `json:"pipeline_run"`
	Log         logr.Logger        `json:"-"`
}

func (*Tekton) GetClient

func (t *Tekton) GetClient(namespace string) *cli.Clients

func (*Tekton) GetWatch

func (t *Tekton) GetWatch(kind string, name string) (w watch.Interface)

GetWatch gets the watch interface for pipelineruns, taskruns and pods

func (*Tekton) PipelineRunSupervise

func (t *Tekton) PipelineRunSupervise() error

PipelineRunSupervise watches all pod event created by pipelinerun

func (*Tekton) SetClient

func (t *Tekton) SetClient(clients *cli.Clients)

func (*Tekton) SetParam

func (t *Tekton) SetParam(params cli.TektonParams)

func (*Tekton) SupTasks

func (t *Tekton) SupTasks(pr *tkn.PipelineRun)

SupTasks loops task watch

func (*Tekton) TaskRunSupervise

func (t *Tekton) TaskRunSupervise(nn types.NamespacedName) error

PipelineRunSupervise watches all pod event created by pipelinerun

func (*Tekton) UpdatePayloadTask

func (t *Tekton) UpdatePayloadTask(task Task)

Jump to

Keyboard shortcuts

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