syncer

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const WorkdirName = ".charts-syncer"

WorkdirName is the default name for a workdir

Variables

This section is empty.

Functions

func DefaultWorkdir

func DefaultWorkdir() string

DefaultWorkdir returns the default workdir path

Types

type Chart

type Chart struct {
	Name         string
	Version      string
	Dependencies []string

	TgzPath string
}

Chart describes a chart, including dependencies

type ChartIndex

type ChartIndex map[string]*Chart

ChartIndex is a map linking a chart reference with its Chart

func (ChartIndex) Add

func (i ChartIndex) Add(id string, chart *Chart) error

Add adds a chart in the index

func (ChartIndex) Get

func (i ChartIndex) Get(id string) *Chart

Get returns an index chart

type Clients

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

Clients holds the source and target chart repo clients

type FakeSyncerOption added in v0.7.0

type FakeSyncerOption func(*FakeSyncerOpts)

FakeSyncerOption is an option value used to create a new fake syncer instance.

func WithFakeSkipCharts added in v0.14.0

func WithFakeSkipCharts(charts []string) FakeSyncerOption

func WithFakeSyncerDestination added in v0.7.0

func WithFakeSyncerDestination(dir string) FakeSyncerOption

WithFakeSyncerDestination configures a destination directory

type FakeSyncerOpts added in v0.7.0

type FakeSyncerOpts struct {
	Destination string
	// contains filtered or unexported fields
}

FakeSyncerOpts allows to configure a Fake syncer.

type Option

type Option func(*Syncer)

Option is an option value used to create a new syncer instance.

func WithAutoDiscovery

func WithAutoDiscovery(enable bool) Option

WithAutoDiscovery configures the syncer to discover all the charts to sync from the source chart repos.

func WithContainerImageRelocation added in v0.11.0

func WithContainerImageRelocation(enable bool) Option

WithContainerImageRelocation configures the syncer to use relok8s to make the chart transformations and push the container images to the target registry

func WithDryRun

func WithDryRun(enable bool) Option

WithDryRun configures the syncer to run in dry-run mode.

func WithFromDate

func WithFromDate(date string) Option

WithFromDate configures the syncer to synchronize the charts from a specific time using YYYY-MM-DD format.

func WithInsecure added in v0.8.0

func WithInsecure(enable bool) Option

WithInsecure configures the syncer to allow insecure SSL connections

func WithLatestVersionOnly added in v0.13.0

func WithLatestVersionOnly(latestVersionOnly bool) Option

WithLatestVersionOnly configures the syncer to sync only the latest version

func WithSkipCharts added in v0.14.0

func WithSkipCharts(charts []string) Option

WithSkipCharts configures the syncer to skip an explicit list of chart names from the source chart repos.

func WithSkipDependencies added in v0.12.0

func WithSkipDependencies(skipDependencies bool) Option

WithSkipDependencies configures the syncer to skip dependencies sync

func WithWorkdir

func WithWorkdir(dir string) Option

WithWorkdir configures the syncer to store artifacts in a specific directory.

type Syncer

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

A Syncer can be used to sync a source and target chart repos.

func New

func New(source *api.Source, target *api.Target, opts ...Option) (*Syncer, error)

New creates a new syncer using Client

func NewFake

func NewFake(t *testing.T, opts ...FakeSyncerOption) *Syncer

NewFake returns a fake Syncer

func (*Syncer) SyncPendingCharts

func (s *Syncer) SyncPendingCharts(names ...string) error

SyncPendingCharts syncs the charts not found in the target

It uses topological sort to sync dependencies first.

func (*Syncer) SyncWithChartsSyncer added in v0.11.0

func (s *Syncer) SyncWithChartsSyncer(ch *Chart, id, workdir, outdir string, hasDeps bool) (string, error)

func (*Syncer) SyncWithRelok8s added in v0.11.0

func (s *Syncer) SyncWithRelok8s(chart *Chart, outdir string) (string, error)

SyncWithRelok8s will take a local packaged chart, a container registry and a container repository and will rewrite the chart updating the images in values.yaml. The local chart must include an image hints file so relok8s library knows how to update the images

Jump to

Keyboard shortcuts

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