snapshot

package
v0.0.0-...-392d2aa Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const SnapshotRetryTimeout = time.Duration(3 * time.Hour)

Variables

This section is empty.

Functions

func SetupController

func SetupController(manager ctrl.Manager, log *logr.Logger) error

SetupController creates a new Integration controller and adds it to the Manager.

Types

type Adapter

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

Adapter holds the objects needed to reconcile a Release.

func NewAdapter

func NewAdapter(context context.Context, snapshot *applicationapiv1alpha1.Snapshot, application *applicationapiv1alpha1.Application, logger h.IntegrationLogger, loader loader.ObjectLoader, client client.Client,
) *Adapter

NewAdapter creates and returns an Adapter instance.

func (*Adapter) EnsureAllReleasesExist

func (a *Adapter) EnsureAllReleasesExist() (controller.OperationResult, error)

EnsureAllReleasesExist is an operation that will ensure that all pipeline Releases associated to the Snapshot and the Application's ReleasePlans exist. Otherwise, it will create new Releases for each ReleasePlan.

func (*Adapter) EnsureGlobalCandidateImageUpdated

func (a *Adapter) EnsureGlobalCandidateImageUpdated() (controller.OperationResult, error)

EnsureGlobalCandidateImageUpdated is an operation that ensure the ContainerImage in the Global Candidate List being updated when the Snapshot is created

func (*Adapter) EnsureGroupSnapshotExist

func (a *Adapter) EnsureGroupSnapshotExist() (controller.OperationResult, error)

EnsureGroupSnapshotExist is an operation that ensure the group snapshot is created for component snapshots once a new component snapshot is created for an pull request and there are multiple existing PRs belonging to the same PR group

func (*Adapter) EnsureIntegrationPipelineRunsExist

func (a *Adapter) EnsureIntegrationPipelineRunsExist() (controller.OperationResult, error)

EnsureIntegrationPipelineRunsExist is an operation that will ensure that all Integration pipeline runs associated with the Snapshot and the Application's IntegrationTestScenarios exist.

func (*Adapter) EnsureOverrideSnapshotValid

func (a *Adapter) EnsureOverrideSnapshotValid() (controller.OperationResult, error)

EnsureOverrideSnapshotValid is an operation that ensure the manually created override snapshot have valid digest and git source in snapshotComponents, mark it as invalid otherwise

func (*Adapter) EnsureRerunPipelineRunsExist

func (a *Adapter) EnsureRerunPipelineRunsExist() (controller.OperationResult, error)

EnsureRerunPipelineRunsExist is responsible for recreating integration test pipelineruns triggered by users

func (*Adapter) HandlePipelineCreationError

func (a *Adapter) HandlePipelineCreationError(err error, integrationTestScenario *v1beta2.IntegrationTestScenario, testStatuses *intgteststat.SnapshotIntegrationTestStatuses) (controller.OperationResult, error)

func (*Adapter) RequeueIfYoungerThanThreshold

func (a *Adapter) RequeueIfYoungerThanThreshold(retErr error) (controller.OperationResult, error)

RequeueIfYoungerThanThreshold checks if the adapter' snapshot is younger than the threshold defined in the function. If it is, the function returns an operation result instructing the reconciler to requeue the object and the error message passed to the function. If not, the function returns an operation result instructing the reconciler NOT to requeue the object.

type AdapterInterface

type AdapterInterface interface {
	EnsureGroupSnapshotExist() (controller.OperationResult, error)
	EnsureAllReleasesExist() (controller.OperationResult, error)
	EnsureRerunPipelineRunsExist() (controller.OperationResult, error)
	EnsureIntegrationPipelineRunsExist() (controller.OperationResult, error)
	EnsureGlobalCandidateImageUpdated() (controller.OperationResult, error)
	EnsureOverrideSnapshotValid() (controller.OperationResult, error)
}

AdapterInterface is an interface defining all the operations that should be defined in an Integration adapter.

type Reconciler

type Reconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
}

Reconciler reconciles an Snapshot object

func NewSnapshotReconciler

func NewSnapshotReconciler(client client.Client, logger *logr.Logger, scheme *runtime.Scheme) *Reconciler

NewSnapshotReconciler creates and returns a Reconciler.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

type ScenarioOptions

type ScenarioOptions struct {
	IsReRun bool
}

configuration options for scenario

Jump to

Keyboard shortcuts

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