model

package
v1.122.2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyConfigOptions added in v1.65.0

type ApplyConfigOptions struct {
	DeployExternalDNS bool
}

type BoolPtr added in v1.57.18

type BoolPtr struct {
	// contains filtered or unexported fields
}

BoolPtr Nillable bool type

func (*BoolPtr) Get added in v1.57.18

func (b *BoolPtr) Get() *bool

Get returns the value of the nillable boolean

func (*BoolPtr) Set added in v1.57.18

func (b *BoolPtr) Set(s string) error

Set a new value

func (*BoolPtr) String added in v1.57.18

func (b *BoolPtr) String() string

String returns the string representation of the nillable boolean

func (*BoolPtr) Type added in v1.57.18

func (b *BoolPtr) Type() string

Type returns the type of the nillable boolean

type BuildContext added in v1.76.0

type BuildContext struct {
	// EnvironmentsToBuild List of environments with component names, which need to be built
	EnvironmentsToBuild []EnvironmentToBuild
}

BuildContext Provide optional build instruction from the prepare job to the pipeline job

type Builder added in v1.41.9

type Builder struct {
	ResourcesLimitsMemory   string
	ResourcesLimitsCPU      string
	ResourcesRequestsCPU    string
	ResourcesRequestsMemory string
}

Builder Holds info about the builder arguments

type DefaultStepImplementation

type DefaultStepImplementation struct {
	StepType pipeline.StepType

	ErrorMessage   string
	SuccessMessage string
	Error          error
	// contains filtered or unexported fields
}

DefaultStepImplementation Struct to hold the data common to all step implementations

func (*DefaultStepImplementation) ErrorMsg

func (step *DefaultStepImplementation) ErrorMsg(err error) string

ErrorMsg Error message

func (*DefaultStepImplementation) GetAppID added in v1.82.0

func (step *DefaultStepImplementation) GetAppID() radixv1.ULID

GetAppName The name of the Radix application

func (*DefaultStepImplementation) GetAppName

func (step *DefaultStepImplementation) GetAppName() string

GetAppName The name of the Radix application

func (*DefaultStepImplementation) GetDynamicClient added in v1.110.0

func (step *DefaultStepImplementation) GetDynamicClient() client.Client

GetDynamicClient Get dynamic client

func (*DefaultStepImplementation) GetKubeClient added in v1.76.0

func (step *DefaultStepImplementation) GetKubeClient() kubernetes.Interface

GetKubeClient Gets Kubernetes client

func (*DefaultStepImplementation) GetRadixClient added in v1.76.0

func (step *DefaultStepImplementation) GetRadixClient() radixclient.Interface

GetRadixClient Gets Radix client

func (*DefaultStepImplementation) GetRegistration

func (step *DefaultStepImplementation) GetRegistration() *radixv1.RadixRegistration

GetRegistration The Radix registration

func (*DefaultStepImplementation) GetTektonClient added in v1.76.0

func (step *DefaultStepImplementation) GetTektonClient() tektonclient.Interface

GetTektonClient Gets Tekton client

func (*DefaultStepImplementation) ImplementationForType

func (step *DefaultStepImplementation) ImplementationForType() pipeline.StepType

ImplementationForType The type of the step

func (*DefaultStepImplementation) Init

func (step *DefaultStepImplementation) Init(ctx context.Context, kubeClient kubernetes.Interface, radixClient radixclient.Interface, dynamicClient client.Client, tektonClient tektonclient.Interface, rr *radixv1.RadixRegistration)

Init Initialize step

func (*DefaultStepImplementation) Run

func (step *DefaultStepImplementation) Run(_ context.Context, pipelineInfo *PipelineInfo) error

Run the step

func (*DefaultStepImplementation) SucceededMsg

func (step *DefaultStepImplementation) SucceededMsg() string

SucceededMsg Success message

type EnvironmentComponentNames added in v1.115.0

type EnvironmentComponentNames map[string][]string

EnvironmentComponentNames maps environment name to component images

type EnvironmentSubPipelineToRun added in v1.30.0

type EnvironmentSubPipelineToRun struct {
	// Environment name
	Environment string
	// PipelineFile Name of a sub-pipeline file, which need to be run
	PipelineFile string
}

EnvironmentSubPipelineToRun An application environment sub-pipeline to be run

type EnvironmentToBuild added in v1.30.0

type EnvironmentToBuild struct {
	// Environment name
	Environment string
	// Components Names of components, which need to be built
	Components []string
}

EnvironmentToBuild An application environment to be built

type PipelineArguments

type PipelineArguments struct {
	PipelineType string
	JobName      string
	// Deprecated: use GitRef instead
	Branch string
	// GitRef Branch or tag to build from
	//
	// required: false
	// example: master
	GitRef string `json:"gitRef,omitempty"`
	// GitRefType When the pipeline job should be built from branch or tag specified in GitRef:
	// - branch
	// - tag
	// - <empty> - either branch or tag
	//
	// required false
	// enum: branch,tag,""
	// example: "branch"
	GitRefType string `json:"gitRefType,omitempty"`
	// CommitID is sent from GitHub webhook. not to be confused with PipelineInfo.GitCommitHash
	CommitID string
	ImageTag string
	// OverrideUseBuildCache override default or configured build cache option
	OverrideUseBuildCache *bool
	// RefreshBuildCache forces to rebuild cache when UseBuildCache is true in the RadixApplication or OverrideUseBuildCache is true
	RefreshBuildCache    *bool
	PushImage            bool
	DeploymentName       string
	FromEnvironment      string
	ToEnvironment        string
	ComponentsToDeploy   []string
	TriggeredFromWebhook bool
	RadixConfigFile      string

	// BuildKitImageBuilder Points to the BuildKit compliant image builder (repository and tag only)
	BuildKitImageBuilder string
	// GitCloneGitImage defines image containing git cli.
	// Must support running as user 65534.
	// Used as option to the CloneInitContainers function.
	GitCloneGitImage string
	// SeccompProfileFileName Filename of the seccomp profile injected by daemonset, relative to the /var/lib/kubelet/seccomp directory on node
	SeccompProfileFileName string
	// Used for tagging meta-information
	Clustertype string
	// RadixZone  The radix zone.
	RadixZone string
	// Clustername The name of the cluster
	Clustername string
	// ContainerRegistry The name of the container registry
	ContainerRegistry string
	// AppContainerRegistry the name of the app container registry
	AppContainerRegistry string
	// SubscriptionId Azure subscription ID
	SubscriptionId string
	// Used to indicate debugging session
	Debug bool
	// Image tag names for components: component-name:image-tag
	ImageTagNames map[string]string
	LogLevel      string
	AppName       string
	Builder       Builder

	// Name of secret with .dockerconfigjson key containing docker auths. Optional.
	// Used to authenticate external container registries when using buildkit to build dockerfiles.
	ExternalContainerRegistryDefaultAuthSecret string
	// ApplyConfigOptions holds options for applying radixconfig
	ApplyConfigOptions ApplyConfigOptions
	// GitWorkspace is the path to the git workspace
	GitWorkspace string
}

PipelineArguments Holds arguments for the pipeline

func (*PipelineArguments) GetGitRefOrDefault added in v1.81.0

func (args *PipelineArguments) GetGitRefOrDefault() string

GetGitRefOrDefault Get git event ref or "branch" by default

type PipelineInfo

type PipelineInfo struct {
	Definition        *pipeline.Definition
	RadixApplication  *radixv1.RadixApplication
	BuildSecret       *corev1.Secret
	PipelineArguments PipelineArguments
	Steps             []Step

	// TargetEnvironments holds information about which environments to build and deploy.
	// It is populated by the prepare-pipeline step by inspecting PipelineArguments
	TargetEnvironments []TargetEnvironment

	// GitCommitHash is derived by inspecting HEAD commit after cloning user repository in prepare-pipelines step.
	// not to be confused with PipelineInfo.PipelineArguments.CommitID
	GitCommitHash string
	GitTags       string

	// Holds information about components to be built for each environment
	BuildComponentImages pipeline.EnvironmentBuildComponentImages

	// Hold information about components to be deployed
	DeployEnvironmentComponentImages pipeline.DeployEnvironmentComponentImages

	// Pipeline job build context
	BuildContext *BuildContext
	// EnvironmentSubPipelinesToRun Sub-pipeline pipeline file named, if they are configured to be run
	EnvironmentSubPipelinesToRun []EnvironmentSubPipelineToRun

	EnvironmentSubPipelineParams map[string]SubPipelineParams

	// EnvironmentSubPipelineComponentNames maps environment name to component image paths
	EnvironmentSubPipelineComponentNames EnvironmentComponentNames

	StopPipeline        bool
	StopPipelineMessage string
}

PipelineInfo Holds info about the pipeline to run

func InitPipeline

func InitPipeline(pipelineType *pipeline.Definition, pipelineArguments *PipelineArguments, stepImplementations ...Step) (*PipelineInfo, error)

InitPipeline Initialize pipeline with step implementations

func (*PipelineInfo) GetAppName added in v1.76.0

func (p *PipelineInfo) GetAppName() string

GetAppName Get app name

func (*PipelineInfo) GetAppNamespace added in v1.76.0

func (p *PipelineInfo) GetAppNamespace() string

GetAppNamespace Get app namespace

func (*PipelineInfo) GetGitRef added in v1.81.0

func (p *PipelineInfo) GetGitRef() string

GetGitRef Get branch or tag

func (*PipelineInfo) GetGitRefOrDefault added in v1.81.0

func (p *PipelineInfo) GetGitRefOrDefault() string

GetGitRefOrDefault Get git event ref or "branch" by default

func (*PipelineInfo) GetGitRefType added in v1.81.0

func (p *PipelineInfo) GetGitRefType() string

GetGitRefType Get git event ref type

func (*PipelineInfo) GetGitRefTypeOrDefault added in v1.81.0

func (p *PipelineInfo) GetGitRefTypeOrDefault() string

GetGitRefTypeOrDefault Get git event ref type or "branch" by default

func (*PipelineInfo) GetGitWorkspace added in v1.76.0

func (p *PipelineInfo) GetGitWorkspace() string

GetGitWorkspace Get git workspace

func (*PipelineInfo) GetRadixApplication added in v1.76.0

func (p *PipelineInfo) GetRadixApplication() *radixv1.RadixApplication

GetRadixApplication Get radix application

func (*PipelineInfo) GetRadixConfigFileInWorkspace added in v1.76.0

func (p *PipelineInfo) GetRadixConfigFileInWorkspace() string

GetRadixConfigFileInWorkspace Get radix config file

func (*PipelineInfo) GetRadixDeployToEnvironment added in v1.76.0

func (p *PipelineInfo) GetRadixDeployToEnvironment() string

GetRadixDeployToEnvironment Get radix deploy to environment

func (*PipelineInfo) GetRadixImageTag added in v1.76.0

func (p *PipelineInfo) GetRadixImageTag() string

GetRadixImageTag Get radix image tag

func (*PipelineInfo) GetRadixPipelineJobName added in v1.76.0

func (p *PipelineInfo) GetRadixPipelineJobName() string

GetRadixPipelineJobName Get radix pipeline job name

func (*PipelineInfo) GetRadixPipelineType added in v1.76.0

func (p *PipelineInfo) GetRadixPipelineType() radixv1.RadixPipelineType

GetRadixPipelineType Get radix pipeline type

func (*PipelineInfo) GetRadixPromoteDeployment added in v1.76.0

func (p *PipelineInfo) GetRadixPromoteDeployment() string

GetRadixPromoteDeployment Get radix promote deployment

func (*PipelineInfo) GetRadixPromoteFromEnvironment added in v1.76.0

func (p *PipelineInfo) GetRadixPromoteFromEnvironment() string

GetRadixPromoteFromEnvironment Get radix promote from environment

func (PipelineInfo) GetSubPipelineParamReferencesForEnvironment added in v1.115.0

func (p PipelineInfo) GetSubPipelineParamReferencesForEnvironment(envName string) (pipelinev1.Params, error)

GetSubPipelineParamReferencesForEnvironment returns the Tekton Params whose values are Tekton variable-substitution references (e.g. "$(params.radix.git-ref)"). These are intended to be appended to a Pipeline task's parameter list so that each task receives the reserved params forwarded from the Pipeline-level object parameters.

func (PipelineInfo) GetSubPipelineParamSpecsForEnvironment added in v1.115.0

func (p PipelineInfo) GetSubPipelineParamSpecsForEnvironment(envName string) (pipelinev1.ParamSpecs, error)

GetSubPipelineParamSpecsForEnvironment returns the Tekton ParamSpecs to be appended to a Pipeline's parameter declarations for the given environment. These specs define the shape of the reserved "radix" and "radix-image" object parameters so that tasks within the Pipeline can reference them.

func (PipelineInfo) GetSubPipelineParamValuesForEnvironment added in v1.115.0

func (p PipelineInfo) GetSubPipelineParamValuesForEnvironment(envName string) (pipelinev1.Params, error)

GetSubPipelineParamValuesForEnvironment returns the Tekton Params with actual values to be set on a PipelineRun for the given environment. The "radix" param carries pipeline metadata (git ref, commit, etc.) and the "radix-image" param carries a map of component names to their resolved image paths.

func (*PipelineInfo) IsPipelineType added in v1.45.0

func (p *PipelineInfo) IsPipelineType(pipelineType radixv1.RadixPipelineType) bool

IsPipelineType Check pipeline type

func (*PipelineInfo) IsRefreshingBuildCache added in v1.80.0

func (p *PipelineInfo) IsRefreshingBuildCache() bool

IsRefreshingBuildCache Check if build cache should be refreshed

func (*PipelineInfo) IsUsingBuildCache added in v1.59.0

func (p *PipelineInfo) IsUsingBuildCache() bool

IsUsingBuildCache Check if build cache should be used

type Step

type Step interface {
	Init(context.Context, kubernetes.Interface, radixclient.Interface, client.Client, tektonclient.Interface, *radixv1.RadixRegistration)

	ImplementationForType() pipeline.StepType
	ErrorMsg(error) string
	SucceededMsg() string
	Run(context.Context, *PipelineInfo) error

	GetAppName() string
	GetRegistration() *radixv1.RadixRegistration
	GetKubeClient() kubernetes.Interface
	GetRadixClient() radixclient.Interface
	GetTektonClient() tektonclient.Interface
	GetDynamicClient() client.Client
}

Step Generic interface for any Step implementation

type SubPipelineParams added in v1.113.0

type SubPipelineParams struct {
	PipelineType string `propname:"pipeline-type"`
	Environment  string `propname:"environment"`
	GitSSHUrl    string `propname:"git-ssh-url"`
	GitRef       string `propname:"git-ref"`
	GitRefType   string `propname:"git-ref-type"`
	GitCommit    string `propname:"git-commit"`
	GitTags      string `propname:"git-tags"`
}

type TargetEnvironment added in v1.81.1

type TargetEnvironment struct {
	Environment           string
	ActiveRadixDeployment *radixv1.RadixDeployment
}

func (TargetEnvironment) CompareApplicationWithDeploymentHash added in v1.81.1

func (t TargetEnvironment) CompareApplicationWithDeploymentHash(ra *radixv1.RadixApplication) (bool, error)

CompareApplicationWithDeploymentHash generates a hash for ra and compares it with the values stored in annotation radix.equinor.com/radix-config-hash of the ActiveRadixDeployment. Returns true if the two hashes match, and false if they do not match, or ActiveRadixDeployment is nil or the annotation does not exist or has an empty value

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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