generator

package
v0.2.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateResourceName

func GenerateResourceName(elements ...string) string

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound asserts notFoundError.

Types

type Config

type Config struct {
	Fs               Filesystem
	DecryptTraverser DecryptTraverser
	ProjectVersion   string
}

type DecryptTraverser

type DecryptTraverser interface {
	Traverse(context.Context, []byte) ([]byte, error)
}

type Filesystem

type Filesystem interface {
	ReadFile(string) ([]byte, error)
	ReadDir(string) ([]os.FileInfo, error)
}

type Generator

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

func New

func New(config *Config) (*Generator, error)

func (Generator) GenerateConfig

func (g Generator) GenerateConfig(ctx context.Context, installation, app, namespace, ref string) (configmap *corev1.ConfigMap, secret *corev1.Secret, err error)

func (Generator) GenerateRawConfig

func (g Generator) GenerateRawConfig(ctx context.Context, installation, app string) (configmap string, secret string, err error)

GenerateConfig creates final configmap values and secret values for helm to use by performing the following operations:

  1. Get configmap template data and patch it with installation-specific overrides (if available)
  2. Get global configmap template for the app and render it with template data (result of 1.)
  3. Get installation-specific configmap patch for the app template (if available)
  4. Patch global template (result of 2.) with installation-specific (result of 3.) app overrides
  5. Get installation-specific secret template data and decrypt it
  6. Get global secret template for the app (if available) and render it with installation secret template data (result of 5.)
  7. Get installation-specific secret template patch (if available) and decrypt it
  8. Patch secret template (result of 6.) with decrypted patch values (result of 7.)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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