relocator

package
v0.4.1 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: 14 Imported by: 0

Documentation

Overview

Package relocator implements the functionality to rewrite image URLs in Charts

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Recursive

func Recursive(c *RelocateConfig)

Recursive asks relocation functions to apply to the chart dependencies recursively

func RelocateAnnotations

func RelocateAnnotations(chartDir string, prefix string, opts ...chartutils.Option) (string, error)

RelocateAnnotations rewrites the image urls in the chart annotations using the provided prefix

func RelocateChartDir

func RelocateChartDir(chartPath string, prefix string, opts ...RelocateOption) error

RelocateChartDir relocates the chart (Chart.yaml annotations, Images.lock and values.yaml) specified by chartPath using the provided prefix

func RelocateLockFile

func RelocateLockFile(file string, prefix string) error

RelocateLockFile relocates images urls in the provided Images.lock using prefix

func WithAnnotationsKey

func WithAnnotationsKey(str string) func(rc *RelocateConfig)

WithAnnotationsKey customizes the annotations key used in Chart.yaml

func WithLog

func WithLog(l log.Logger) func(rc *RelocateConfig)

WithLog customizes the log used by the tool

func WithRelocateLockFile

func WithRelocateLockFile(relocateLock bool) func(rc *RelocateConfig)

WithRelocateLockFile configures the RelocateLockFile configuration

func WithValuesFiles added in v0.4.0

func WithValuesFiles(files ...string) func(rc *RelocateConfig)

WithValuesFiles configures the values files to use for relocation

Types

type RelocateConfig

type RelocateConfig struct {
	ImageLockConfig  imagelock.Config
	Log              log.Logger
	RelocateLockFile bool
	Recursive        bool
	ValuesFiles      []string
}

RelocateConfig defines the configuration used in the relocator functions

func NewRelocateConfig

func NewRelocateConfig(opts ...RelocateOption) *RelocateConfig

NewRelocateConfig returns a new RelocateConfig with default settings

type RelocateOption

type RelocateOption func(*RelocateConfig)

RelocateOption defines a RelocateConfig option

type RelocationResult

type RelocationResult struct {
	// Name is the name of the values file
	Name string
	// Data is the relocated data
	Data []byte
	// Count is the number of relocated images
	Count int
}

RelocationResult describes the result of performing a relocation

func RelocateCarvelImagesLock

func RelocateCarvelImagesLock(lock *lockconfig.ImagesLock, prefix string) (*RelocationResult, error)

RelocateCarvelImagesLock rewrites the images urls in the provided lock using prefix

func RelocateLock

func RelocateLock(lock *imagelock.ImagesLock, prefix string) (*RelocationResult, error)

RelocateLock rewrites the images urls in the provided lock using prefix

Jump to

Keyboard shortcuts

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