Documentation ¶
Overview ¶
Package relocator implements the functionality to rewrite image URLs in Charts
Index ¶
- func Recursive(c *RelocateConfig)
- func RelocateAnnotations(chartDir string, prefix string, opts ...chartutils.Option) (string, error)
- func RelocateChartDir(chartPath string, prefix string, opts ...RelocateOption) error
- func RelocateLockFile(file string, prefix string) error
- func WithAnnotationsKey(str string) func(rc *RelocateConfig)
- func WithLog(l log.Logger) func(rc *RelocateConfig)
- func WithRelocateLockFile(relocateLock bool) func(rc *RelocateConfig)
- func WithSkipImageRelocation(skipImageRelocation bool) func(rc *RelocateConfig)
- func WithValuesFiles(files ...string) func(rc *RelocateConfig)
- type RelocateConfig
- type RelocateOption
- type RelocationResult
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 ¶
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 ¶
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 WithSkipImageRelocation ¶ added in v0.4.2
func WithSkipImageRelocation(skipImageRelocation bool) func(rc *RelocateConfig)
WithSkipImageRelocation configures the SkipImageRelocation 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 SkipImageRelocation 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