overrides

package
v0.0.0-...-6a1c4ee Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Overview

Package overrides implements the logic related to handling overrides. The manually-provided overrides have precedence over standard Kyma overrides defined in the cluster.

The code in the package uses the user-provided function for logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeMaps

func MergeMaps(a, b map[string]interface{}) map[string]interface{}

Types

type Builder

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

Overrides manages override merges

func (*Builder) AddFile

func (ob *Builder) AddFile(file string) error

AddFile adds overrides defined in a file to the builder

func (*Builder) AddInterceptor

func (ob *Builder) AddInterceptor(overrideKeys []string, interceptor OverrideInterceptor)

AddInterceptor registers an interceptor for particular override keys

func (*Builder) AddOverrides

func (ob *Builder) AddOverrides(chart string, overrides map[string]interface{}) error

AddOverrides adds overrides for a chart to the builder

func (*Builder) Build

func (ob *Builder) Build() (Overrides, error)

Build an overrides object merging all provided sources and applying interceptors WARNING: call this function sparingly, it runs all interceptors, potentially incurring heavy computations.

func (*Builder) Raw

func (ob *Builder) Raw() (Overrides, error)

Raw builds an overrides object contining only the raw values in the sources, without applying interceptors.

type CertificateOverrideInterceptor

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

CertificateOverrideInterceptor handles certificates

func NewCertificateOverrideInterceptor

func NewCertificateOverrideInterceptor(tlsCrtOverrideKey, tlsKeyOverrideKey string, kubeClient kubernetes.Interface) *CertificateOverrideInterceptor

func (*CertificateOverrideInterceptor) Intercept

func (i *CertificateOverrideInterceptor) Intercept(value interface{}, key string) (interface{}, error)

func (*CertificateOverrideInterceptor) String

func (i *CertificateOverrideInterceptor) String(value interface{}, key string) string

func (*CertificateOverrideInterceptor) Undefined

func (i *CertificateOverrideInterceptor) Undefined(overrides map[string]interface{}, key string) error

type DomainNameOverrideInterceptor

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

DomainNameOverrideInterceptor resolves the domain name for the cluster

func NewDomainNameOverrideInterceptor

func NewDomainNameOverrideInterceptor(kubeClient kubernetes.Interface, log logger.Interface) *DomainNameOverrideInterceptor

func (*DomainNameOverrideInterceptor) Intercept

func (i *DomainNameOverrideInterceptor) Intercept(value interface{}, key string) (interface{}, error)

func (*DomainNameOverrideInterceptor) String

func (i *DomainNameOverrideInterceptor) String(value interface{}, key string) string

func (*DomainNameOverrideInterceptor) Undefined

func (i *DomainNameOverrideInterceptor) Undefined(overrides map[string]interface{}, key string) error

type FallbackOverrideInterceptor

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

FallbackOverrideInterceptor sets a default value for an undefined overwrite

func NewFallbackOverrideInterceptor

func NewFallbackOverrideInterceptor(fallback interface{}) *FallbackOverrideInterceptor

func (*FallbackOverrideInterceptor) Fallback

func (i *FallbackOverrideInterceptor) Fallback() interface{}

func (*FallbackOverrideInterceptor) Intercept

func (i *FallbackOverrideInterceptor) Intercept(value interface{}, key string) (interface{}, error)

func (*FallbackOverrideInterceptor) String

func (i *FallbackOverrideInterceptor) String(value interface{}, key string) string

func (*FallbackOverrideInterceptor) Undefined

func (i *FallbackOverrideInterceptor) Undefined(overrides map[string]interface{}, key string) error

type OverrideInterceptor

type OverrideInterceptor interface {
	//String shows the value of the override
	String(value interface{}, key string) string
	//Intercept is executed when the override is retrieved
	Intercept(value interface{}, key string) (interface{}, error)
	//Undefined is executed when the override is not defined
	Undefined(overrides map[string]interface{}, key string) error
}

OverrideInterceptor is controlling access to override values

type Overrides

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

func (Overrides) Find

func (o Overrides) Find(key string) (interface{}, bool)

Find returns a value on the overrides following a path separated by "." and if it exists.

func (Overrides) Map

func (o Overrides) Map() map[string]interface{}

Map returns a copy of the overrides in map form

func (Overrides) String

func (o Overrides) String() string

String all provided overrides

type Provider

type Provider interface {
	//OverridesGetterFunctionFor returns a function returning overrides for a Helm release with the provided name.
	//Before using this function, ensure that the overrides cache is populated by calling the ReadOverridesFromCluster function.
	OverridesGetterFunctionFor(name string) func() map[string]interface{}
}

Provider defines the contract for reading overrides for a given Helm release.

func New

func New(client kubernetes.Interface, overrides map[string]interface{}, log logger.Interface) (Provider, error)

New returns a new Provider.

overridesYaml contains a list of manually-provided overrides. Every value in the list contains data in the YAML format. The structure of the file should follow the Helm's values.yaml convention. There is one difference from the plain Helm's values.yaml file: These are not values for a single release but for the entire Kyma installation. Because of that, you have to put values for a specific Component (e.g: Component name is "foo") under a key equal to the component's name (i.e: "foo"). You can also put overrides under a "global" key. These will merge with the top-level "global" Helm key for every Helm chart.

type RegistryDisableInterceptor

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

func NewRegistryDisableInterceptor

func NewRegistryDisableInterceptor(kubeClient kubernetes.Interface) *RegistryDisableInterceptor

func (*RegistryDisableInterceptor) Intercept

func (i *RegistryDisableInterceptor) Intercept(value interface{}, key string) (interface{}, error)

func (*RegistryDisableInterceptor) String

func (i *RegistryDisableInterceptor) String(value interface{}, key string) string

func (*RegistryDisableInterceptor) Undefined

func (i *RegistryDisableInterceptor) Undefined(overrides map[string]interface{}, key string) error

type RegistryInterceptor

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

func NewRegistryInterceptor

func NewRegistryInterceptor(kubeClient kubernetes.Interface) *RegistryInterceptor

func (*RegistryInterceptor) Intercept

func (i *RegistryInterceptor) Intercept(value interface{}, key string) (interface{}, error)

func (*RegistryInterceptor) String

func (i *RegistryInterceptor) String(value interface{}, key string) string

func (*RegistryInterceptor) Undefined

func (i *RegistryInterceptor) Undefined(overrides map[string]interface{}, key string) error

Jump to

Keyboard shortcuts

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