model

package
v0.1.1-0...-c51dc2f Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2018 License: Apache-2.0, Apache-2.0, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GeneratorTypePassword      = GeneratorType("Password")      // Password
	GeneratorTypeSSH           = GeneratorType("SSH")           // SSH key
	GeneratorTypeCACertificate = GeneratorType("CACertificate") // CA Certificate
	GeneratorTypeCertificate   = GeneratorType("Certificate")   // Certificate
)

These are the available generator types for configuration values

View Source
const (
	ValueTypeCertificate = ValueType("certificate")
	ValueTypeFingerprint = ValueType("fingerprint")
	ValueTypePrivateKey  = ValueType("private_key")
)

These are the available generator types for configuration values

View Source
const (
	// CVTypeUser is for user-specified variables (default)
	CVTypeUser = CVType("user")
	// CVTypeEnv is for script-specified variables
	CVTypeEnv = CVType("environment")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CVType

type CVType string

CVType is the type of the configuration variable; see the constants below

type Configuration

type Configuration struct {
	Variables []*ConfigurationVariable `yaml:"variables"`
}

Configuration contains information about how to configure the resulting images

type ConfigurationVariable

type ConfigurationVariable struct {
	Name          string                          `yaml:"name"`
	PreviousNames []string                        `yaml:"previous_names"`
	Default       interface{}                     `yaml:"default"`
	Description   string                          `yaml:"description"`
	Example       string                          `yaml:"example"`
	Generator     *ConfigurationVariableGenerator `yaml:"generator"`
	Type          CVType                          `yaml:"type"`
	Internal      bool                            `yaml:"internal,omitempty"`
	Secret        bool                            `yaml:"secret,omitempty"`
	Required      bool                            `yaml:"required,omitempty"`
	Immutable     bool                            `yaml:"immutable,omitempty"`
}

ConfigurationVariable is a configuration to be exposed to the IaaS

Notes on the fields Type and Internal.

  1. Type's legal values are `user` and `environment`. `user` is default.

    A `user` CV is rendered into k8s yml config files, etc. to make it available to roles who need it. - An internal CV is rendered to all roles. - A public CV is rendered only to the roles whose templates refer to the CV.

    An `environment` CV comes from a script, not the user. Being internal this way it is not rendered to any configuration files.

  1. Internal's legal values are all YAML boolean values. A public CV is used in templates An internal CV is not, consumed in a script instead.

type ConfigurationVariableGenerator

type ConfigurationVariableGenerator struct {
	ID           string        `json:"id,omitempty" yaml:"id,omitempty"`
	Type         GeneratorType `json:"type" yaml:"type"`
	ValueType    ValueType     `json:"value_type,omitempty" yaml:"value_type,omitempty"`
	SubjectNames []string      `json:"subject_names,omitempty" yaml:"subject_names,omitempty"`
	RoleName     string        `json:"role_name,omitempty" yaml:"role_name,omitempty"`
}

ConfigurationVariableGenerator describes how to automatically generate values for a configuration variable WARNING: Avoid re-ordering the fields; that would trigger secrets re-generation because it changes the serialized generator input strings. For the same reason additional fields should be added with the omitempty attribute.

type GeneratorType

type GeneratorType string

GeneratorType describes the type of generator used for the configuration value

type Manifest

type Manifest struct {
	Configuration *Configuration `yaml:"configuration"`
}

Manifest is the top level of the role manifest file

func GetManifest

func GetManifest(r io.Reader) (Manifest, error)

GetManifest loads a manifest from file or string

type ValueType

type ValueType string

ValueType describes the type of generator used for the configuration value

Jump to

Keyboard shortcuts

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