release_payload_controller

package
v0.0.0-...-f95860a Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 52 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ReleasePayloadAcceptedReason programmatic identifier indicating that the ReleasePayload was Accepted
	ReleasePayloadAcceptedReason string = "ReleasePayloadAccepted"

	// ReleasePayloadManuallyAcceptedReason programmatic identifier indicating that the ReleasePayload was manually Accepted
	ReleasePayloadManuallyAcceptedReason string = "ReleasePayloadManuallyAccepted"
)

These are valid Reason values for the ReleasePayloadStatus Conditions

View Source
const (
	// ReleasePayloadCreatedReason programmatic identifier indicating that the ReleasePayload created successfully
	ReleasePayloadCreatedReason string = "ReleasePayloadCreated"

	// ReleasePayloadFailedReason programmatic identifier indicating that the ReleasePayload creation failed
	ReleasePayloadFailedReason string = "ReleasePayloadFailed"
)

These are valid Reason values for the ReleasePayloadStatus Conditions

View Source
const (
	// ReleasePayloadRejectedReason programmatic identifier indicating that the ReleasePayload was Rejected
	ReleasePayloadRejectedReason string = "ReleasePayloadRejected"

	// ReleasePayloadManuallyRejectedReason programmatic identifier indicating that the ReleasePayload was manually Rejected
	ReleasePayloadManuallyRejectedReason string = "ReleasePayloadManuallyRejected"
)

These are valid Reason values for the ReleasePayloadStatus Conditions

View Source
const (
	// ReleaseCreationJobUnknownMessage release creation job unknown message
	ReleaseCreationJobUnknownMessage = "Release creation job unknown"

	// ReleaseCreationJobPendingMessage release creation job pending message
	ReleaseCreationJobPendingMessage = "Release creation job pending"

	// ReleaseCreationJobFailureMessage release creation job failure message
	ReleaseCreationJobFailureMessage = "Release creation Job failed"

	// ReleaseCreationJobSuccessMessage release creation job success message
	ReleaseCreationJobSuccessMessage = "Release creation Job completed"
)
View Source
const (
	// ReleasePayloadCreationFailedReason programmatic identifier indicating that the ReleasePayload was not created successfully
	ReleasePayloadCreationFailedReason string = "ReleasePayloadCreationFailed"
)

Variables

View Source
var ErrCoordinatesNotSet = errors.New("unable to lookup release creation job: coordinates not set")

Functions

func NewReleasePayloadControllerCommand

func NewReleasePayloadControllerCommand(name string) *cobra.Command

Types

type Controller

type Controller interface {
	// contains filtered or unexported methods
}

type JobStateController

type JobStateController struct {
	*ReleasePayloadController
}

JobStateController is responsible for updating the JobState for every entry in the BlockingJobResults and InformingJobResults lists. The JobStateController reads the following pieces of information:

  • .status.blockingJobResults[] | .results[]
  • .status.informingJobResults[] | .results[]
  • .status.upgradeJobResults[] | .results[]

and populates the following condition:

  • .status.blockingJobResults[] | .state
  • .status.informingJobResults[] | .state
  • .status.upgradeJobResults[] | .state

func NewJobStateController

func NewJobStateController(
	releasePayloadInformer releasepayloadinformer.ReleasePayloadInformer,
	releasePayloadClient releasepayloadclient.ReleaseV1alpha1Interface,
	eventRecorder events.Recorder,
) (*JobStateController, error)

type LegacyJobStatusController

type LegacyJobStatusController struct {
	*ReleasePayloadController
	// contains filtered or unexported fields
}

LegacyJobStatusController is responsible for handling the job results of releases that pre-date ReleasePayloads. These releases have their job results stored in the "release.openshift.io/verify" annotation of their respective imagestreamtag.

The results are a json encoded string of the VerificationStatusMap. The key represents the CIConfigurationName of the job. This is our only way of mapping the individual results back to their respective CIConfiguration.

The LegacyJobStatusController operates only on the ReleasePayloads that specify:

  • .spec.payloadVerificationConfig.legacyResults = True

and writes to the following locations:

  • .status.blockingJobResults[].results
  • .status.informingJobResults[].results

The legacy results are very much married to the ReleaseConfig that's defined on the "Source" imagestream when the respective release is created. Processing of these results are only concerned with the Blocking and Informing jobs defined in the ReleaseConfig. Therefore, this controller will not process anything related to the automatic upgrade jobs produced by the release-controller.

func NewLegacyJobStatusController

func NewLegacyJobStatusController(
	releasePayloadInformer releasepayloadinformer.ReleasePayloadInformer,
	releasePayloadClient releasepayloadclient.ReleaseV1alpha1Interface,
	imageStreamInformer imagev1informer.ImageStreamInformer,
	eventRecorder events.Recorder,
) (*LegacyJobStatusController, error)

type Options

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

func (*Options) AddFlags

func (o *Options) AddFlags(fs *pflag.FlagSet)

func (*Options) Run

func (o *Options) Run(ctx context.Context) error

func (*Options) Validate

func (o *Options) Validate(ctx context.Context) error

type PayloadAcceptedController

type PayloadAcceptedController struct {
	*ReleasePayloadController
}

PayloadAcceptedController is responsible for Accepting ReleasePayloads when any of the following scenarios occur:

  1. all Blocking Jobs complete successfully
  2. the payload is manually accepted

The PayloadAcceptedController reads the following pieces of information:

  • .spec.payloadOverride.override
  • .status.blockingJobResults
  • .status.releaseCreationJobResult.status

and populates the following condition:

  • .status.conditions.PayloadAccepted

func NewPayloadAcceptedController

func NewPayloadAcceptedController(
	releasePayloadInformer releasepayloadinformer.ReleasePayloadInformer,
	releasePayloadClient releasepayloadclient.ReleaseV1alpha1Interface,
	eventRecorder events.Recorder,
) (*PayloadAcceptedController, error)

type PayloadCreationController

type PayloadCreationController struct {
	*ReleasePayloadController
}

PayloadCreationController is responsible for setting the PayloadCreated and PayloadFailed conditions based on whether the release payload creation job completed successfully or not. The PayloadCreationController reads the following pieces of information:

  • .status.releaseCreationJobResult.status

and populates the following conditions:

  • .status.conditions.PayloadCreated
  • .status.conditions.PayloadFailed

func NewPayloadCreationController

func NewPayloadCreationController(
	releasePayloadInformer releasepayloadinformer.ReleasePayloadInformer,
	releasePayloadClient releasepayloadclient.ReleaseV1alpha1Interface,
	eventRecorder events.Recorder,
) (*PayloadCreationController, error)

type PayloadRejectedController

type PayloadRejectedController struct {
	*ReleasePayloadController
}

PayloadRejectedController is responsible for Rejecting ReleasePayloads when any of the following scenarios occur:

  1. any Blocking Job fails
  2. the payload is manually rejected
  3. the release creation job fails

The PayloadRejectedController reads the following pieces of information:

  • .spec.payloadOverride.override
  • .status.blockingJobResults
  • .status.releaseCreationJobResult.status

and populates the following condition:

  • .status.conditions.PayloadRejected

func NewPayloadRejectedController

func NewPayloadRejectedController(
	releasePayloadInformer releasepayloadinformer.ReleasePayloadInformer,
	releasePayloadClient releasepayloadclient.ReleaseV1alpha1Interface,
	eventRecorder events.Recorder,
) (*PayloadRejectedController, error)

type PayloadVerificationController

type PayloadVerificationController struct {
	*ReleasePayloadController
}

PayloadVerificationController is responsible for the initial population of the following pieces of the ReleasePayload:

  • .status.blockingJobResults
  • .status.informingJobResults
  • .status.upgradeJobResults

This information is obtained by reading `.spec.payloadVerification` and populating the respective JobResults accordingly.

func NewPayloadVerificationController

func NewPayloadVerificationController(
	releasePayloadInformer releasepayloadinformer.ReleasePayloadInformer,
	releasePayloadClient releasepayloadclient.ReleaseV1alpha1Interface,
	eventRecorder events.Recorder,
) (*PayloadVerificationController, error)

type ProwJobStatusController

type ProwJobStatusController struct {
	*ReleasePayloadController
	// contains filtered or unexported fields
}

ProwJobStatusController is responsible for watching ProwJobs, in the prow-namespace, and updating the respective ReleasePayload with the status, of the job, when it completes. The ProwJobStatusController watches for changes to the following resources:

  • ProwJob

and writes to the following locations:

  • .status.blockingJobResults[].results
  • .status.informingJobResults[].results

func NewProwJobStatusController

func NewProwJobStatusController(
	releasePayloadInformer releasepayloadinformer.ReleasePayloadInformer,
	releasePayloadClient releasepayloadclient.ReleaseV1alpha1Interface,
	prowJobInformer prowjobinformer.ProwJobInformer,
	eventRecorder events.Recorder,
) (*ProwJobStatusController, error)

type ReleaseCreationJobController

type ReleaseCreationJobController struct {
	*ReleasePayloadController
}

ReleaseCreationJobController is responsible for writing the coordinates of the release creation job. The jobsNamespace is populated from a command-line parameter and contains the namespace where the release-controller creates the release creation batch/v1 jobs. The ReleaseCreationJobController writes the following pieces of information:

  • .status.ReleaseCreationJobResult.ReleaseCreationJobCoordinates.Namespace
  • .status.ReleaseCreationJobResult.ReleaseCreationJobCoordinates.Name

func NewReleaseCreationJobController

func NewReleaseCreationJobController(
	releasePayloadInformer releasepayloadinformer.ReleasePayloadInformer,
	releasePayloadClient releasepayloadclient.ReleaseV1alpha1Interface,
	eventRecorder events.Recorder,
) (*ReleaseCreationJobController, error)

type ReleaseCreationStatusController

type ReleaseCreationStatusController struct {
	*ReleasePayloadController
	// contains filtered or unexported fields
}

ReleaseCreationStatusController is responsible for watching batchv1.Jobs, in the job-namespace, and updating the respective ReleasePayload with the status, of the job, when it completes. The ReleaseCreationStatusController watches for changes to the following resources:

  • batchv1.Jobs

and write the following information:

  • .status.releaseCreationJobResult.status
  • .status.releaseCreationJobResult.message

func NewReleaseCreationStatusController

func NewReleaseCreationStatusController(
	releasePayloadInformer releasepayloadinformer.ReleasePayloadInformer,
	releasePayloadClient releasepayloadclient.ReleaseV1alpha1Interface,
	batchJobInformer batchv1informers.JobInformer,
	eventRecorder events.Recorder,
) (*ReleaseCreationStatusController, error)

type ReleasePayloadController

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

func (*ReleasePayloadController) Enqueue

func (c *ReleasePayloadController) Enqueue(obj interface{})

func (*ReleasePayloadController) RunWorkers

func (c *ReleasePayloadController) RunWorkers(ctx context.Context, workers int)

Jump to

Keyboard shortcuts

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