generator

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Fs               Filesystem
	DecryptTraverser DecryptTraverser

	Installation string
	Verbose      bool
}

type DecryptTraverser

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

type Filesystem

type Filesystem interface {
	ReadFile(string) ([]byte, error)
	ReadDir(string) ([]fs.DirEntry, 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, app string, meta metav1.ObjectMeta) (*corev1.ConfigMap, *corev1.Secret, error)

GenerateConfig generates ConfigMap and Secret for a given App. The generated CM and Secret metadata are configured with the provided value.

func (*Generator) GenerateRawConfig added in v1.0.0

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

func (*Generator) GenerateRawConfigUnsorted added in v1.0.0

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

GenerateRawConfigUnsorted 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. Merge config and secret values before templating app secret
  7. Get global secret template for the app (if available) and render it with installation secret template data (result of 5.)
  8. Get installation-specific secret template patch (if available) and decrypt it
  9. Patch secret template (result of 6.) with decrypted patch values (result of 7.)

type InvalidConfigError added in v1.0.0

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

func (*InvalidConfigError) Error added in v1.0.0

func (e *InvalidConfigError) Error() string

func (*InvalidConfigError) Is added in v1.0.0

func (e *InvalidConfigError) Is(target error) bool

type NotFoundError added in v1.0.0

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

func (*NotFoundError) Error added in v1.0.0

func (e *NotFoundError) Error() string

func (*NotFoundError) Is added in v1.0.0

func (e *NotFoundError) Is(target error) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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