models

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStatusFromRadixJobStatus

func GetStatusFromRadixJobStatus(jobStatus v1.RadixJobStatus, specStop bool) string

GetStatusFromRadixJobStatus Returns job status as string

func GetStepSummaryScansFromRadixJob added in v1.17.0

func GetStepSummaryScansFromRadixJob(steps []v1.RadixJobStep) []v1.RadixJobStepScanOutput

GetStepSummaryScansFromRadixJob Used to get a list of summary scans of all steps on a job

func PipelineNotFoundError

func PipelineNotFoundError(appName, jobName string) error

PipelineNotFoundError Job not found

Types

type Job

type Job struct {
	// Name of the job
	//
	// required: false
	// example: radix-pipeline-20181029135644-algpv-6hznh
	Name string `json:"name"`

	// Branch branch to build from
	//
	// required: false
	// example: master
	Branch string `json:"branch"`

	// CommitID the commit ID of the branch to build
	//
	// required: false
	// example: 4faca8595c5283a9d0f17a623b9255a0d9866a2e
	CommitID string `json:"commitID"`

	// Created timestamp
	//
	// required: false
	// example: 2006-01-02T15:04:05Z
	Created string `json:"created"`

	// TriggeredBy user that triggered the job. If through webhook = sender.login. If through api = usertoken.upn
	//
	// required: false
	// example: a_user@equinor.com
	TriggeredBy string `json:"triggeredBy"`

	// Started timestamp
	//
	// required: false
	// example: 2006-01-02T15:04:05Z
	Started string `json:"started"`

	// Ended timestamp
	//
	// required: false
	// example: 2006-01-02T15:04:05Z
	Ended string `json:"ended"`

	// Status of the job
	//
	// required: false
	// Enum: Waiting,Running,Succeeded,Stopping,Stopped,Failed
	// example: Waiting
	Status string `json:"status"`

	// Name of the pipeline
	//
	// required: false
	// Enum: build-deploy
	// example: build-deploy
	Pipeline string `json:"pipeline"`

	// Array of steps
	//
	// required: false
	// type: "array"
	// items:
	//    "$ref": "#/definitions/Step"
	Steps []Step `json:"steps"`

	// Array of deployments
	//
	// required: false
	// type: "array"
	// items:
	//    "$ref": "#/definitions/DeploymentSummary"
	Deployments []*deploymentModels.DeploymentSummary `json:"deployments,omitempty"`

	// Components (array of ComponentSummary) created by the job
	//
	// required: false
	// type: "array"
	// items:
	//    "$ref": "#/definitions/ComponentSummary"
	Components []*deploymentModels.ComponentSummary `json:"components,omitempty"`
}

Job holds general information about job swagger:model Job

func GetJobFromRadixJob

func GetJobFromRadixJob(job *v1.RadixJob, jobDeployments []*deploymentModels.DeploymentSummary, jobComponents []*deploymentModels.ComponentSummary) *Job

GetJobFromRadixJob Gets job from a radix job

type JobParameters

type JobParameters struct {
	// For build pipeline: Name of the branch
	Branch string `json:"branch"`

	// For build pipeline: Commit ID of the branch
	CommitID string `json:"commitID"`

	// For build pipeline: Should image be pushed to container registry
	PushImage bool `json:"pushImage"`

	// TriggeredBy of the job - if empty will use user token upn (user principle name)
	TriggeredBy string `json:"triggeredBy"`

	// For promote pipeline: Name (ID) of deployment to promote
	DeploymentName string `json:"deploymentName"`

	// For promote pipeline: Environment to locate deployment to promote
	FromEnvironment string `json:"fromEnvironment"`

	// For promote pipeline: Target environment for promotion
	ToEnvironment string `json:"toEnvironment"`

	// ImageRepository of the component, without image name and image-tag
	ImageRepository string

	// ImageName of the component, without repository name and image-tag
	ImageName string

	// ImageTag of the image - if empty will use default logic
	ImageTag string
}

JobParameters parameters to create a pipeline job Not exposed in the API

func (JobParameters) GetPushImageTag

func (param JobParameters) GetPushImageTag() string

GetPushImageTag Represents boolean as 1 or 0

type JobSummary

type JobSummary struct {
	// Name of the job
	//
	// required: false
	// example: radix-pipeline-20181029135644-algpv-6hznh
	Name string `json:"name"`

	// AppName of the application
	//
	// required: false
	// example: radix-pipeline-20181029135644-algpv-6hznh
	AppName string `json:"appName"`

	// Branch branch to build from
	//
	// required: false
	// example: master
	Branch string `json:"branch"`

	// CommitID the commit ID of the branch to build
	//
	// required: false
	// example: 4faca8595c5283a9d0f17a623b9255a0d9866a2e
	CommitID string `json:"commitID"`

	// Created timestamp
	//
	// required: false
	// example: 2006-01-02T15:04:05Z
	Created string `json:"created"`

	// TriggeredBy user that triggered the job. If through webhook = sender.login. If through api - usertoken.upn
	//
	// required: false
	// example: a_user@equinor.com
	TriggeredBy string `json:"triggeredBy"`

	// Started timestamp
	//
	// required: false
	// example: 2006-01-02T15:04:05Z
	Started string `json:"started"`

	// Ended timestamp
	//
	// required: false
	// example: 2006-01-02T15:04:05Z
	Ended string `json:"ended"`

	// Status of the job
	//
	// required: false
	// Enum: Waiting,Running,Succeeded,Stopping,Stopped,Failed
	// example: Waiting
	Status string `json:"status"`

	// Name of the pipeline
	//
	// required: false
	// Enum: build-deploy, build
	// example: build-deploy
	Pipeline string `json:"pipeline"`

	// Environments the job deployed to
	//
	// required: false
	// example: dev,qa
	Environments []string `json:"environments,omitempty"`

	// List of RadixJobStepScanOutput for a job
	//
	// required: false
	StepSummaryScans []v1.RadixJobStepScanOutput `json:"stepSummaryScans,omitempty"`
}

JobSummary holds general information about job swagger:model JobSummary

func GetSummaryFromRadixJob

func GetSummaryFromRadixJob(job *v1.RadixJob) *JobSummary

GetSummaryFromRadixJob Used to get job summary from a radix job

func (*JobSummary) GetCreated added in v1.9.0

func (job *JobSummary) GetCreated() string

func (*JobSummary) GetEnded added in v1.9.0

func (job *JobSummary) GetEnded() string

func (*JobSummary) GetStarted added in v1.9.0

func (job *JobSummary) GetStarted() string

func (*JobSummary) GetStatus added in v1.9.0

func (job *JobSummary) GetStatus() string

type ProgressStatus

type ProgressStatus int

ProgressStatus Enumeration of the statuses of a job or step

const (
	// Running Active
	Running ProgressStatus = iota

	// Succeeded Job/step succeeded
	Succeeded

	// Failed Job/step failed
	Failed

	// Waiting Job/step pending
	Waiting

	// Stopping job
	Stopping

	// Stopped job
	Stopped
)

func (ProgressStatus) String

func (p ProgressStatus) String() string

type Step

type Step struct {
	// Name of the step
	//
	// required: false
	// example: build
	Name string `json:"name"`

	// Status of the step
	//
	// required: false
	// Enum: Waiting,Running,Succeeded,Failed
	// example: Waiting
	Status string `json:"status"`

	// Started timestamp
	//
	// required: false
	// example: 2006-01-02T15:04:05Z
	Started string `json:"started"`

	// Ended timestamp
	//
	// required: false
	// example: 2006-01-02T15:04:05Z
	Ended string `json:"ended"`

	// Pod name
	//
	// required: false
	PodName string `json:"-"`

	// Components associated components
	//
	// required: false
	Components []string `json:"components,omitempty"`

	// Information about vulnerabilities found in scan step
	//
	// required: false
	VulnerabilityScan *VulnerabilityScan `json:"scan,omitempty"`
}

Step holds general information about job step swagger:model Step

func GetJobStepsFromRadixJob

func GetJobStepsFromRadixJob(job *v1.RadixJob) []Step

GetJobStepsFromRadixJob Gets the steps from a Radix job

type StepLog

type StepLog struct {
	// Name of the step
	//
	// required: true
	Name string `json:"name"`

	// Name of the logged pod
	//
	// required: false
	PodName string `json:"podname"`

	// Log of step
	Log string `json:"log"`

	Sort int32 `json:"sort"`
}

StepLog holds logs for a given step swagger:model StepLog

type Vulnerability added in v1.13.2

type Vulnerability struct {
	// Name of the vulnerabile package
	//
	// required: true
	// example: bash
	PackageName string `json:"packageName"`
	// Version of the affected package
	//
	// required: true
	// example: 5.0-4
	Version string `json:"version"`
	// Name of the scanned target
	//
	// required: true
	// example: radixprod.azurecr.io/myapp-api:cz413 (debian 10.10)
	Target string `json:"target"`
	// Title of the vulnerability
	//
	// required: false
	// example: bash: when effective UID is not equal to its real UID the saved UID is not dropped
	Title string `json:"title"`
	// A detailed description of the vulnerability
	//
	// required: false
	// example: An issue was discovered in disable_priv_mode in shell.c in GNU Bash through 5.0 patch 11. By default, if Bash is run with its effective UID not equal to its real UID...
	Description string `json:"description"`
	// The severity of the vulnerability
	//
	// required: true
	// Enum: CRITICAL,HIGH,MEDIUM,LOW,UNKNOWN
	// example: HIGH
	Serverity string `json:"severity"`
	// The date the vulnerability was published
	//
	// required: false
	// format: date-time
	// example: 2021-03-26T17:15:00Z
	PublishedDate string `json:"publishedDate"`
	// A list of CWEs referencing the vulnerability
	//
	// required: false
	// type: "array"
	// example: ["CWE-273"]
	CWE []string `json:"cwe"`
	// A list of CVEs referencing the vulnerability
	//
	// required: false
	// type: "array"
	// example: ["CVE-2019-18276"]
	CVE []string `json:"cve"`
	// The CVSS value of the vulnerability
	//
	// required: false
	// example: 7.8
	CVSS float32 `json:"cvss"`
	// A list of URLs with more information about the vulnerability
	//
	// required: false
	// type: "array"
	// example: ["https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-18276","https://github.com/bminor/bash/commit/951bdaad7a18cc0dc1036bba86b18b90874d39ff"]
	References []string `json:"references"`
}

Vulnerability holds detailed information about a vulnerability swagger:model Vulnerability

type VulnerabilityScan added in v1.13.0

type VulnerabilityScan struct {
	// Status of the vulnerability scan
	//
	// required: true
	// Enum: Success,Missing
	// example: Success
	Status string `json:"status"`

	// Reason for the status
	//
	// required: false
	// example: Scan results not found in output from scan job
	Reason string `json:"reason,omitempty"`

	// Overview of severities and count from list of vulnerabilities
	//
	// required: false
	Vulnerabilities map[string]uint `json:"vulnerabilities,omitempty"`
}

VulnerabilityScan holds information about vulnerabilities found during scan swagger:model VulnerabilityScan

func GetVulnerabilityScanFromRadixJobStep added in v1.13.0

func GetVulnerabilityScanFromRadixJobStep(step v1.RadixJobStep) *VulnerabilityScan

Jump to

Keyboard shortcuts

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