pkg

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadConfiguration added in v0.1.0

func ReadConfiguration(repos []string, branches []string, hierarchy Config) []map[string]KustomizeResources

func Server added in v0.1.0

func Server(cmd *cobra.Command)

Types

type APIServer added in v0.1.0

type APIServer struct {
	Repos     []string
	Branches  []string
	Hierarchy Config
}

func (*APIServer) Handler added in v0.1.0

func (input *APIServer) Handler(w http.ResponseWriter, req *http.Request)

type Config

type Config struct {
	Hierarchy []Item
}

func GetHierarchy added in v0.1.0

func GetHierarchy(configFile, applicationName string) (Config, error)

func (Config) GeneratePropertiesFile added in v0.1.0

func (config Config) GeneratePropertiesFile(resources []Resource) string

func (Config) GetProperties added in v0.1.0

func (config Config) GetProperties(resources []Resource) map[string]Property

func (Config) GetPropertiesMap added in v0.1.0

func (config Config) GetPropertiesMap(resources []Resource) map[string]string

func (Config) WalkHierarchy added in v0.1.0

func (config Config) WalkHierarchy(resources []Resource) []Resource

type Input

type Input struct {
	// list of environments where config can be applied
	Environments []string
	// list of services of items being templated.
	Applications []string
	// Resources that are generated by Kustomize
	Resources []Resource
	// The hierarchy in which configs are imported
	Config Config
}

type Item

type Item struct {
	Kind      string
	Name      string
	Namespace string
	Type      ResourceType
	Key       string
	Index     int
}

func (Item) FindIn added in v0.1.0

func (item Item) FindIn(resources []Resource) *Resource

func (Item) String added in v0.1.0

func (item Item) String() string

type KustomizeResources added in v0.1.0

type KustomizeResources struct {
	Resources   []string `yaml:"resources"`
	Bases       []string `yaml:"bases"`
	Environment string
	FilePath    string
	FileDir     string
	Branch      string
	SubResource bool
	ImportedBy  []string
	Global      bool
	Objects     []Resource
	Properties  map[string]string
}

type Properties added in v0.1.0

type Properties []Property

func (Properties) Len added in v0.1.0

func (p Properties) Len() int

func (Properties) Less added in v0.1.0

func (p Properties) Less(i, j int) bool

func (Properties) Swap added in v0.1.0

func (p Properties) Swap(i, j int)

type Property added in v0.1.0

type Property struct {
	Key, Value string
	Comment    string
	Resource   Resource
}

func (Property) String added in v0.1.0

func (p Property) String() string

type Resource

type Resource struct {
	// path is the relative path to the file containing the resource definition
	Path string
	// A configmap, secret or sealed secret
	Item *unstructured.Unstructured
	// A type of resource that resource holds either native or properties from file
	Hierarchy Item
}

func GetResources added in v0.1.0

func GetResources(buf []byte) ([]Resource, error)

func ReadResources added in v0.1.0

func ReadResources(input string) ([]Resource, error)

func (Resource) GeneratePropertesMapFromProperties added in v0.1.0

func (r Resource) GeneratePropertesMapFromProperties() map[string]string

func (Resource) GeneratePropertiesMapFromNative added in v0.1.0

func (r Resource) GeneratePropertiesMapFromNative() map[string]string

func (Resource) GetProperties added in v0.1.0

func (r Resource) GetProperties() []Property

func (Resource) GetPropertiesMap added in v0.1.0

func (r Resource) GetPropertiesMap() map[string]string

func (Resource) String added in v0.1.0

func (r Resource) String() string

type ResourceType added in v0.1.0

type ResourceType string
const (
	ResourceTypeNative     ResourceType = "native"
	ResourceTypeProperties ResourceType = "properties"
)

Jump to

Keyboard shortcuts

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