config

package
v0.0.0-...-ae3c849 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseManifests

func ParseManifests(a *App) (map[string]map[string]map[string][]string, error)

ParseManifests parses the configuration's manifests into overall picture of the repository's applications. TODO: this should probably accept a fs.FileSystem to allow reusing the Git clone. TODO: This should also not be a map[string]map[string]map[string][]string :-)

Types

type App

type App struct {
	Name         string         `json:"name"`
	RepoURL      string         `json:"repo_url"`
	Path         string         `json:"path"`
	Environments []*Environment `json:"environments"`
}

App represents a high-level application that is deployed across multiple environments, and configured through Kustomize.

func (*App) EachEnvironment

func (a *App) EachEnvironment(f func(e *Environment) error) error

EachEnvironment iterates over each environment within the app, and calls it with an environment, the environment will have it's parent app linked correctly.

func (*App) Environment

func (a *App) Environment(name string) *Environment

Environment gets a named environment.

type Config

type Config struct {
	Apps []*App `json:"apps,omitempty"`
}

Config represents the managed apps.

func Parse

func Parse(in io.Reader) (*Config, error)

Parse decodes YAML describing an environment manifest.

func ParseFile

func ParseFile(filename string) (*Config, error)

ParseFile is a wrapper around Parse that accepts a filename, it opens and parses the file, and closes it.

func (*Config) App

func (c *Config) App(name string) *App

App returns the named app, or nil if not found.

type Environment

type Environment struct {
	Name    string `json:"name"`
	RelPath string `json:"rel_path"` // This is relative to the Path for the parent App.
	App     *App   `json:"-"`
}

Environment is a k8s namespace/cluster that an application is deployed.

func (*Environment) Path

func (e *Environment) Path() string

Path returns the app-relative path for the kustomize.yaml for this environment.

For example, app in /test/base and environment in "../dev" would get "/test/dev".

Jump to

Keyboard shortcuts

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