tasks

package
v0.0.0-...-7613b02 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUploadsHandler

func AddUploadsHandler(ctx context.Context, task *models.TaskInfo, queue *queue.Queue) error

func ContentOverridesForRepo

func ContentOverridesForRepo(orgId string, domainName string, templateUUID string, pulpContentPath string, repo api.RepositoryResponse) ([]caliri.ContentOverrideDTO, error)

func DeleteRepositorySnapshotsHandler

func DeleteRepositorySnapshotsHandler(ctx context.Context, task *models.TaskInfo, _ *queue.Queue) error

func DeleteSnapshotsHandler

func DeleteSnapshotsHandler(ctx context.Context, task *models.TaskInfo, _ *queue.Queue) error

func DeleteTemplateHandler

func DeleteTemplateHandler(ctx context.Context, task *models.TaskInfo, _ *queue.Queue) error

func GenContentDto

func GenContentDto(repo api.RepositoryResponse) caliri.ContentDTO

func GenOverrideDTO

func GenOverrideDTO(ctx context.Context, daoReg *dao.DaoRegistry, orgId, domainName, contentPath string, template api.TemplateResponse) ([]caliri.ContentOverrideDTO, error)

genOverrideDTOs uses the RepoConfigUUIDs to query the db and generate a mapping of content labels to distribution URLs for the snapshot within the template. For all repos, we include an override for an 'empty' sslcacert, so it does not use the configured default on the client. For custom repos, we override the base URL, due to the fact that we use different domains for RH and custom repos.

func IntrospectHandler

func IntrospectHandler(ctx context.Context, task *models.TaskInfo, _ *queue.Queue) error

func IsTaskCancelled

func IsTaskCancelled(ctx context.Context) bool

IsTaskCancelled returns true if context is cancelled for expected reason

func LogForTask

func LogForTask(taskID, typename, requestID string) *zerolog.Logger

func RemoveUneededOverrides

func RemoveUneededOverrides(ctx context.Context, cpClient candlepin_client.CandlepinClient, templateUUID string, expectedDTOs []caliri.ContentOverrideDTO) error

func SnapshotHandler

func SnapshotHandler(ctx context.Context, task *models.TaskInfo, queue *queue.Queue) error

func UnneededOverrides

func UnneededOverrides(existingDtos []caliri.ContentOverrideDTO, expectedDTOs []caliri.ContentOverrideDTO) []caliri.ContentOverrideDTO

UnneededOverrides given a list of existing overrides, and expected overrides, return the existing overrides that are no longer needed

func UpdateLatestSnapshotHandler

func UpdateLatestSnapshotHandler(ctx context.Context, task *models.TaskInfo, queue *queue.Queue) error

UpdateLatestSnapshotHandler for the given repo config UUID, fetches all templates (with use_latest=true) containing that repository. For each template, updates the pulp distribution to serve the latest snapshot for that repository.

func UpdateRepositoryHandler

func UpdateRepositoryHandler(ctx context.Context, task *models.TaskInfo, _ *queue.Queue) error

func UpdateTemplateContentHandler

func UpdateTemplateContentHandler(ctx context.Context, task *models.TaskInfo, queue *queue.Queue) error

Types

type AddUploads

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

func (*AddUploads) AddContentToRepo

func (ur *AddUploads) AddContentToRepo(contentHrefs []string) (versionHref string, err error)

func (*AddUploads) ConvertArtifactsToPackages

func (ur *AddUploads) ConvertArtifactsToPackages(artifacts []api.Artifact) (contentHrefs []string, err error)

func (*AddUploads) ConvertUploadsToArtifacts

func (ur *AddUploads) ConvertUploadsToArtifacts() ([]api.Artifact, error)

func (*AddUploads) GetDistributionTaskHref

func (ur *AddUploads) GetDistributionTaskHref() *string

func (*AddUploads) GetPublicationTaskHref

func (ur *AddUploads) GetPublicationTaskHref() *string

func (*AddUploads) GetSnapshotIdent

func (ur *AddUploads) GetSnapshotIdent() *string

func (*AddUploads) GetSnapshotUUID

func (ur *AddUploads) GetSnapshotUUID() *string

func (*AddUploads) ImportPackageData

func (ur *AddUploads) ImportPackageData(versionHref string) error

func (*AddUploads) Run

func (ur *AddUploads) Run() (err error)

func (*AddUploads) SaveDistributionTaskHref

func (ur *AddUploads) SaveDistributionTaskHref(href string) error

func (*AddUploads) SavePublicationTaskHref

func (ur *AddUploads) SavePublicationTaskHref(href string) error

func (*AddUploads) SaveSnapshotIdent

func (ur *AddUploads) SaveSnapshotIdent(id string) error

func (*AddUploads) SaveSnapshotUUID

func (ur *AddUploads) SaveSnapshotUUID(uuid string) error

func (*AddUploads) UpdatePayload

func (ur *AddUploads) UpdatePayload() error

type AddUploadsPayload

type AddUploadsPayload struct {
	RepositoryConfigUUID string
	Artifacts            []api.Artifact
	Uploads              []api.Upload

	VersionHref          *string // href of repo version created as part of this
	PublicationTaskHref  *string
	DistributionTaskHref *string
	SnapshotIdent        *string
	SnapshotUUID         *string
}

type DeleteRepositorySnapshots

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

func (*DeleteRepositorySnapshots) Run

type DeleteRepositorySnapshotsPayload

type DeleteRepositorySnapshotsPayload struct {
	RepoConfigUUID string
}

type DeleteSnapshots

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

func (*DeleteSnapshots) Run

func (ds *DeleteSnapshots) Run() error

type DeleteTemplates

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

func (*DeleteTemplates) Run

func (d *DeleteTemplates) Run() error

type DeleteTemplatesPayload

type DeleteTemplatesPayload struct {
	TemplateUUID    string
	RepoConfigUUIDs []string
}

type IntrospectionTask

type IntrospectionTask struct {
	URL string
	// contains filtered or unexported fields
}

func (*IntrospectionTask) Run

func (i *IntrospectionTask) Run() error

type ResumableSnapshotInterface

type ResumableSnapshotInterface interface {
	SavePublicationTaskHref(href string) error
	GetPublicationTaskHref() *string

	SaveDistributionTaskHref(href string) error
	GetDistributionTaskHref() *string

	SaveSnapshotIdent(id string) error
	GetSnapshotIdent() *string

	SaveSnapshotUUID(uuid string) error
	GetSnapshotUUID() *string
}

ResumableSnapshotInterface used to store various references needed

for snapshotHelper to be resumable.  Typically implemented by the task using the helper

type SnapshotHelper

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

SnapshotHelper is meant to be used by another task, and be able to turn a repository Version into a

snapshot, with everything needed in pulp (publication, distributions)

func (*SnapshotHelper) Cleanup

func (sh *SnapshotHelper) Cleanup() error

func (*SnapshotHelper) Run

func (sh *SnapshotHelper) Run(versionHref string) error

type SnapshotRepository

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

func (*SnapshotRepository) GetDistributionTaskHref

func (sr *SnapshotRepository) GetDistributionTaskHref() *string

func (*SnapshotRepository) GetOrphanedLatestVersion

func (sr *SnapshotRepository) GetOrphanedLatestVersion(repoConfigUUID string) (*string, error)

GetOrphanedLatestVersion

 If a snapshot is made, but something bad happens between the repo version being made and its publication or distribution,
		the repo version is 'lost', as there is no snapshot referring to it.  If this happens we can grab the latest
	    repo version from pulp, and check if any snapshot exists with that version href.  If not then this is an orphaned version

func (*SnapshotRepository) GetPublicationTaskHref

func (sr *SnapshotRepository) GetPublicationTaskHref() *string

func (*SnapshotRepository) GetSnapshotIdent

func (sr *SnapshotRepository) GetSnapshotIdent() *string

func (*SnapshotRepository) GetSnapshotUUID

func (sr *SnapshotRepository) GetSnapshotUUID() *string

func (*SnapshotRepository) Run

func (sr *SnapshotRepository) Run() (err error)

SnapshotRepository creates a snapshot of a given repository config

func (*SnapshotRepository) SaveDistributionTaskHref

func (sr *SnapshotRepository) SaveDistributionTaskHref(href string) error

func (*SnapshotRepository) SavePublicationTaskHref

func (sr *SnapshotRepository) SavePublicationTaskHref(href string) error

func (*SnapshotRepository) SaveSnapshotIdent

func (sr *SnapshotRepository) SaveSnapshotIdent(id string) error

func (*SnapshotRepository) SaveSnapshotUUID

func (sr *SnapshotRepository) SaveSnapshotUUID(uuid string) error

func (*SnapshotRepository) UpdatePayload

func (sr *SnapshotRepository) UpdatePayload() error

type UpdateLatestSnapshot

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

func (*UpdateLatestSnapshot) Run

func (t *UpdateLatestSnapshot) Run() error

type UpdateLatestSnapshotPayload

type UpdateLatestSnapshotPayload struct {
	RepositoryConfigUUID string
}

type UpdateRepository

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

func (*UpdateRepository) Run

func (ur *UpdateRepository) Run() error

func (*UpdateRepository) UpdateCPContent

func (ur *UpdateRepository) UpdateCPContent(content caliri.ContentDTO) error

UpdateCPContent updates the content in candlepin (name & GPG Key)

func (*UpdateRepository) UpdateContentOverrides

func (ur *UpdateRepository) UpdateContentOverrides() error

type UpdateRepositoryPayload

type UpdateRepositoryPayload struct {
	RepositoryConfigUUID string
}

type UpdateTemplateContent

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

func (*UpdateTemplateContent) RunCandlepin

func (t *UpdateTemplateContent) RunCandlepin(env *caliri.EnvironmentDTO) error

RunCandlepin creates an environment for the template and content sets for each repository. Each content set's URL is the distribution URL created during RunPulp(). May promote or demote content from the environment, depending on if the repository is being added or removed from template. If not created for the given org previously, this will also create a product and pool.

func (*UpdateTemplateContent) RunEnvironmentCreate

func (t *UpdateTemplateContent) RunEnvironmentCreate() (*caliri.EnvironmentDTO, error)

func (*UpdateTemplateContent) RunPulp

func (t *UpdateTemplateContent) RunPulp() error

RunPulp creates (when a repository is added), updates (if the template date has changed), or removes (when a repository is removed) pulp distributions when a template is created or updated. Each distribution is under a path that is based on the template uuid. It serves the latest snapshot content up to the date set on the template.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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