helm

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTracker

func NewTracker(
	svc *tracker.Services,
	r *hub.Repository,
	opts ...func(t tracker.Tracker),
) tracker.Tracker

NewTracker creates a new Tracker instance.

func WithIndexLoader

func WithIndexLoader(il hub.HelmIndexLoader) func(t tracker.Tracker)

WithIndexLoader allows providing a specific Helm repository index loader for a Tracker instance.

func WithNumWorkers

func WithNumWorkers(n int) func(t tracker.Tracker)

WithNumWorkers allows providing a specific number of workers for a Tracker instance.

func WithOCITagsGetter added in v0.10.0

func WithOCITagsGetter(tg tracker.OCITagsGetter) func(t tracker.Tracker)

WithOCITagsGetter allows providing a specific OCI tags getter for a Tracker instance.

Types

type Job

type Job struct {
	Kind         JobKind
	ChartVersion *helmrepo.ChartVersion
}

Job represents a job for registering or unregistering a Helm package version available in the provided Helm repository. Jobs are created by the dispatcher and will eventually be handled by a worker.

type JobKind

type JobKind int

JobKind represents the kind of a job, which can be register or unregister.

const (
	// Register represents a job to Register a Helm package version.
	Register JobKind = iota

	// Unregister represents a job to Unregister a Helm package version.
	Unregister
)

type OCITagsGetter added in v0.10.0

type OCITagsGetter struct{}

OCITagsGetter provides a mechanism to get all the tags available for a given repository in a OCI registry.

func (*OCITagsGetter) Tags added in v0.10.0

func (tg *OCITagsGetter) Tags(ctx context.Context, r *hub.Repository) ([]string, error)

Tags returns a list with the tags available for the provided repository.

type OCITagsGetterMock added in v0.10.0

type OCITagsGetterMock struct {
	mock.Mock
}

OCITagsGetterMock is a mock implementation of the OCITagsGetter interface.

func (*OCITagsGetterMock) Tags added in v0.10.0

func (m *OCITagsGetterMock) Tags(ctx context.Context, r *hub.Repository) ([]string, error)

Tags implements the OCITagsGetter interface.

type Tracker

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

Tracker is in charge of tracking the packages available in a Helm repository, registering and unregistering them as needed.

func (*Tracker) Track

func (t *Tracker) Track() error

Track registers or unregisters the Helm packages available in the repository provided as needed. It is in charge of generating jobs to register or unregister Helm packages and dispatching them among the available workers.

type Worker

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

Worker is in charge of handling Helm packages register and unregister jobs generated by the tracker.

func NewWorker

func NewWorker(
	svc *tracker.Services,
	r *hub.Repository,
) *Worker

NewWorker creates a new worker instance.

func (*Worker) Run

func (w *Worker) Run(wg *sync.WaitGroup, queue chan *Job)

Run instructs the worker to start handling jobs. It will keep running until the jobs queue is empty or the context is done.

Jump to

Keyboard shortcuts

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