model

package
v7.0.1-0...-b8e8e6a Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: Apache-2.0 Imports: 20 Imported by: 5

Documentation

Index

Constants

View Source
const (
	RoleTypeBoshTask           = RoleType("bosh-task")           // A role that is a BOSH task
	RoleTypeBosh               = RoleType("bosh")                // A role that is a BOSH job
	RoleTypeColocatedContainer = RoleType("colocated-container") // A role that is supposed to be used by other roles to specify a colocated container
)

These are the types of roles available

View Source
const (
	RoleTagStopOnFailure     = RoleTag("stop-on-failure")
	RoleTagSequentialStartup = RoleTag("sequential-startup")
	RoleTagActivePassive     = RoleTag("active-passive")
	RoleTagIstioManaged      = RoleTag("istio-managed")
)

The list of acceptable tags

View Source
const (
	// PodSecurityPolicyNonPrivileged is a backwards compatibility marker to
	// indicate an instance group does not require a privileged PSP
	PodSecurityPolicyNonPrivileged = "nonprivileged"
	// PodSecurityPolicyPrivileged marks an instance group as requiring a
	// privileged PSP
	PodSecurityPolicyPrivileged = "privileged"
)
View Source
const (
	VolumeTypePersistent = VolumeType("persistent") // A volume that is only used for this instance of the role
	VolumeTypeShared     = VolumeType("shared")     // A volume that acts as shared storage between multiple roles / instances
	VolumeTypeHost       = VolumeType("host")       // A volume that is a mount of a host directory
	VolumeTypeNone       = VolumeType("none")       // A volume that isn't mounted to anything
	VolumeTypeEmptyDir   = VolumeType("emptyDir")   // A volume that is shared between containers
)

These are the volume type available

View Source
const (
	FlightStagePreFlight  = FlightStage("pre-flight")  // A role that runs before the main jobs start
	FlightStageFlight     = FlightStage("flight")      // A role that is a main job
	FlightStagePostFlight = FlightStage("post-flight") // A role that runs after the main jobs are up
	FlightStageManual     = FlightStage("manual")      // A role that only runs via user intervention
)

These are the flight stages available

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

func AggregateSignatures

func AggregateSignatures(signatures []string) string

AggregateSignatures returns the SHA1 for a slice of strings

func FlattenOpinions

func FlattenOpinions(opinions map[string]interface{}, total bool) map[string]string

FlattenOpinions converts the incoming nested map of opinions into a flat map of properties to values (strings). When 'total' is set (to true) array values are recursed into and flattened as well.

func ParseTemplate

func ParseTemplate(template string) ([]string, error)

ParseTemplate parses a mustache template and returns the template variables

Types

type AuthAccount

type AuthAccount struct {
	Roles        []string `yaml:"roles"`
	ClusterRoles []string `yaml:"cluster-roles"`

	UsedBy map[string]struct{} `yaml:"-"` // Instance groups which use this account
}

An AuthAccount is a service account for RBAC authorization The NumGroups field records the number of instance groups referencing the account in question.

type AuthRole

type AuthRole []AuthRule

An AuthRole is a role for RBAC authorization

type AuthRule

type AuthRule struct {
	APIGroups     []string `yaml:"apiGroups"`
	Resources     []string `yaml:"resources"`
	ResourceNames []string `yaml:"resourceNames"`
	Verbs         []string `yaml:"verbs"`
}

An AuthRule is a single rule for a RBAC authorization role

func (*AuthRule) IsPodSecurityPolicyRule

func (rule *AuthRule) IsPodSecurityPolicyRule() bool

IsPodSecurityPolicyRule checks if the rule is a pod security policy rule

type CVMap

type CVMap map[string]*VariableDefinition

CVMap is a map from variable name to ConfigurationVariable, for various places which require quick access/search/existence check.

func MakeMapOfVariables

func MakeMapOfVariables(roleManifest *RoleManifest) CVMap

MakeMapOfVariables converts the sequence of configuration variables into a map we can manipulate more directly by name.

type CVOptions

type CVOptions struct {
	PreviousNames []string    `yaml:"previous_names"`
	Default       interface{} `yaml:"default"`
	Description   string      `yaml:"description"`
	Example       string      `yaml:"example"`
	Type          CVType      `yaml:"type"`
	Internal      bool        `yaml:"internal,omitempty"`
	Secret        bool        `yaml:"secret,omitempty"`
	Required      bool        `yaml:"required,omitempty"`
	Immutable     bool        `yaml:"immutable,omitempty"`
	ImageName     bool        `yaml:"imagename,omitempty"`
	IsCA          bool        `yaml:"is_ca,omitempty"`
	RoleName      string      `yaml:"role_name,omitempty"`
	AltNames      []string    `yaml:"alternative_names,omitempty"`
}

CVOptions 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 CVType

type CVType string

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

type Configuration

type Configuration struct {
	Authorization ConfigurationAuthorization       `yaml:"auth,omitempty"`
	RawTemplates  yaml.MapSlice                    `yaml:"templates"`
	Templates     map[string]ConfigurationTemplate `yaml:"-"`
}

Configuration contains information about how to configure the resulting images

type ConfigurationAuthorization

type ConfigurationAuthorization struct {
	RoleUsedBy          map[string]map[string]struct{} `yaml:"-"`
	Roles               map[string]AuthRole            `yaml:"roles,omitempty"`
	ClusterRoles        map[string]AuthRole            `yaml:"cluster-roles,omitempty"`
	ClusterRoleUsedBy   map[string]map[string]struct{} `yaml:"-"`
	PodSecurityPolicies map[string]*PodSecurityPolicy  `yaml:"pod-security-policies,omitempty"`
	Accounts            map[string]AuthAccount         `yaml:"accounts,omitempty"`
}

ConfigurationAuthorization defines Configuration.Authorization

type ConfigurationTemplate

type ConfigurationTemplate struct {
	Value    string
	IsGlobal bool
}

ConfigurationTemplate contains one entry in a configuration template; this is the parsed value, as opposed to the raw value from YAML deserialization.

func (ConfigurationTemplate) MarshalYAML

func (t ConfigurationTemplate) MarshalYAML() (interface{}, error)

MarshalYAML implements the yaml.Marshaler interface

type FlightStage

type FlightStage string

FlightStage describes when a role should be executed

type HealthCheck

type HealthCheck struct {
	Liveness  *HealthProbe `yaml:"liveness,omitempty"`  // Details of liveness probe configuration
	Readiness *HealthProbe `yaml:"readiness,omitempty"` // Ditto for readiness probe
}

HealthCheck describes a non-standard health check endpoint

type HealthProbe

type HealthProbe struct {
	URL              string            `yaml:"url"`                         // URL for a HTTP GET to return 200~399. Cannot be used with other checks.
	Headers          map[string]string `yaml:"headers"`                     // Custom headers; only used for URL.
	Command          []string          `yaml:"command,omitempty"`           // Individual commands to run inside the container; each is interpreted as a shell command. Cannot be used with other checks.
	Port             int               `yaml:"port"`                        // Port for a TCP probe. Cannot be used with other checks.
	InitialDelay     int               `yaml:"initial_delay,omitempty"`     // Initial Delay in seconds, default 3, minimum 1
	Period           int               `yaml:"period,omitempty"`            // Period in seconds, default 10, minimum 1
	Timeout          int               `yaml:"timeout,omitempty"`           // Timeout in seconds, default 3, minimum 1
	SuccessThreshold int               `yaml:"success_threshold,omitempty"` // Success threshold in seconds, default 1, minimum 1
	FailureThreshold int               `yaml:"failure_threshold,omitempty"` // Failure threshold in seconds, default 3, minimum 1
}

HealthProbe holds the configuration for liveness and readiness probes based on the HealthCheck containing them.

type InstanceGroup

type InstanceGroup struct {
	Name              string         `yaml:"name"`
	DefaultFeature    string         `yaml:"default_feature"`
	IfFeature         string         `yaml:"if_feature"`
	UnlessFeature     string         `yaml:"unless_feature"`
	Description       string         `yaml:"description"`
	EnvironScripts    []string       `yaml:"environment_scripts"`
	Scripts           []string       `yaml:"scripts"`
	PostConfigScripts []string       `yaml:"post_config_scripts"`
	Type              RoleType       `yaml:"type,omitempty"`
	JobReferences     JobReferences  `yaml:"jobs"`
	Configuration     *Configuration `yaml:"configuration"`
	Tags              []RoleTag      `yaml:"tags"`
	Run               *RoleRun       `yaml:"-"`
	// contains filtered or unexported fields
}

InstanceGroup represents a collection of jobs that are colocated on a container

func (*InstanceGroup) CalculateRoleConfigurationTemplates

func (g *InstanceGroup) CalculateRoleConfigurationTemplates()

CalculateRoleConfigurationTemplates applies configuration variables to all templates

func (*InstanceGroup) CalculateRoleRun

func (g *InstanceGroup) CalculateRoleRun() validation.ErrorList

CalculateRoleRun collects properties from the jobs run properties and puts them on the instance group It also validates where necessary and is run *before* validateRoleRun

func (*InstanceGroup) CollectPropertyDefaults

func (g *InstanceGroup) CollectPropertyDefaults() PropertyDefaults

CollectPropertyDefaults looks through all used jobs and returns all properties defined in them, along with their default values and whether a hash may be used for that property.

func (*InstanceGroup) ColocatedContainers

func (g *InstanceGroup) ColocatedContainers() []string

ColocatedContainers returns colocated_container entries from all jobs

func (*InstanceGroup) GetColocatedRoles

func (g *InstanceGroup) GetColocatedRoles() InstanceGroups

GetColocatedRoles lists all colocation roles references by this instance group

func (*InstanceGroup) GetLongDescription

func (g *InstanceGroup) GetLongDescription() string

GetLongDescription returns the description of the instance group plus a list of all included jobs

func (*InstanceGroup) GetRoleDevVersion

func (g *InstanceGroup) GetRoleDevVersion(opinions *Opinions, tagExtra, fissileVersion string, grapher util.ModelGrapher) (string, error)

GetRoleDevVersion determines the version hash for the role, using the basic role dev version, and the aggregated spec and opinion information. In this manner opinion changes cause a rebuild of the associated role images.

func (*InstanceGroup) GetScriptPaths

func (g *InstanceGroup) GetScriptPaths() map[string]string

GetScriptPaths returns the paths to the startup / post configgin scripts for a instance group

func (*InstanceGroup) GetScriptSignatures

func (g *InstanceGroup) GetScriptSignatures() (string, error)

GetScriptSignatures returns the SHA1 of all of the script file names and contents

func (*InstanceGroup) GetTemplateSignatures

func (g *InstanceGroup) GetTemplateSignatures() (string, error)

GetTemplateSignatures returns the SHA1 of all of the templates and contents

func (*InstanceGroup) GetVariablesForRole

func (g *InstanceGroup) GetVariablesForRole() (Variables, error)

GetVariablesForRole returns all the environment variables required for calculating all the templates for the role

func (*InstanceGroup) HasTag

func (g *InstanceGroup) HasTag(tag RoleTag) bool

HasTag returns true if the role has a specific tag

func (*InstanceGroup) IsColocated

func (g *InstanceGroup) IsColocated() bool

IsColocated tests if the role is of type ColocatedContainer, or not. It returns true if this role is of that type, or false otherwise.

func (*InstanceGroup) LookupJob

func (g *InstanceGroup) LookupJob(name string) *JobReference

LookupJob will find the given job in this role, or nil if not found

func (*InstanceGroup) Manifest

func (g *InstanceGroup) Manifest() *RoleManifest

Manifest returns a reference to the instance groups role manifest

func (*InstanceGroup) SetRoleManifest

func (g *InstanceGroup) SetRoleManifest(m *RoleManifest)

SetRoleManifest adds a reference to the instance groups role manifest

type InstanceGroups

type InstanceGroups []*InstanceGroup

InstanceGroups is an array of Role*

func (InstanceGroups) Len

func (igs InstanceGroups) Len() int

Len is the number of instance groups in the slice

func (InstanceGroups) Less

func (igs InstanceGroups) Less(i, j int) bool

Less reports whether role at index i sort before role at index j

func (InstanceGroups) Swap

func (igs InstanceGroups) Swap(i, j int)

Swap exchanges roles at index i and index j

type Job

type Job struct {
	Name               string
	Description        string
	Templates          []*JobTemplate
	Packages           Packages
	Path               string
	Fingerprint        string
	SHA1               string
	Properties         []*JobProperty
	Version            string
	Release            *Release
	AvailableProviders map[string]JobProvidesInfo
	DesiredConsumers   []JobConsumesInfo
	// contains filtered or unexported fields
}

Job represents a BOSH job

func (*Job) Extract

func (j *Job) Extract(destination string) (string, error)

Extract will extract the contents of the job archive to destination It creates a directory with the name of the job Returns the full path of the extracted archive

func (*Job) GetPropertiesForJob

func (j *Job) GetPropertiesForJob(opinions *Opinions) (map[string]interface{}, error)

GetPropertiesForJob returns the parameters for the given job, using its specs and opinions

func (*Job) Marshal

func (j *Job) Marshal() (interface{}, error)

Marshal implements the util.Marshaler interface

func (*Job) MergeSpec

func (j *Job) MergeSpec(otherJob *Job)

MergeSpec is used to merge temporary spec patches into each job. otherJob should only be the fissile-compat/patch-properties job. The code assumes package and property objects are immutable, as they're now being shared across jobs. Also, when specified packages or properties are specified in the "other" job, that one takes precedence.

func (*Job) ValidateSHA1

func (j *Job) ValidateSHA1() error

ValidateSHA1 validates that the SHA1 of the actual job archive is the same as the one from the release manifest

type JobBoshContainerization

type JobBoshContainerization struct {
	Ports               []JobExposedPort `yaml:"ports"`
	Run                 *RoleRun         `yaml:"run"`
	ColocatedContainers []string         `yaml:"colocated_containers,omitempty"`
	ServiceName         string           `yaml:"service_name,omitempty"`
}

JobBoshContainerization describes settings specific to containerization

type JobConsumesInfo

type JobConsumesInfo struct {
	JobLinkInfo
	Alias    string `yaml:"from"`
	Ignore   bool   `yaml:"ignore"`
	Optional bool
}

JobConsumesInfo describes the BOSH links a job consumes

type JobContainerProperties

type JobContainerProperties struct {
	BoshContainerization JobBoshContainerization `yaml:"bosh_containerization"`
}

JobContainerProperties describes job configuration

type JobExposedPort

type JobExposedPort struct {
	Name                string `yaml:"name"`
	Protocol            string `yaml:"protocol"`
	External            string `yaml:"external"`
	Internal            string `yaml:"internal"`
	Public              bool   `yaml:"public"`
	Count               int    `yaml:"count"`
	Max                 int    `yaml:"max"`
	PortIsConfigurable  bool   `yaml:"port-configurable"`
	CountIsConfigurable bool   `yaml:"count-configurable"`
	InternalPort        int
	ExternalPort        int
}

JobExposedPort describes a port to be available to other jobs, or the outside world

type JobLinkInfo

type JobLinkInfo struct {
	Name        string `json:"-" yaml:"-"`
	Type        string `json:"-" yaml:"-"`
	RoleName    string `json:"role" yaml:"-"`
	JobName     string `json:"job" yaml:"-"`
	ServiceName string `json:"service_name" yaml:"-"`
}

JobLinkInfo describes a BOSH link provider or consumer

type JobProperty

type JobProperty struct {
	Name        string
	Description string
	Default     interface{}
	Job         *Job
}

JobProperty is a generic key-value property referenced by a job

func (*JobProperty) MarshalJSON

func (p *JobProperty) MarshalJSON() ([]byte, error)

MarshalJSON implements the encoding/json.Marshaler interface

func (*JobProperty) MarshalYAML

func (p *JobProperty) MarshalYAML() (interface{}, error)

MarshalYAML implements the yaml.Marshaler interface

type JobProvidesInfo

type JobProvidesInfo struct {
	JobLinkInfo
	Alias      string `yaml:"as"`
	Shared     bool   `yaml:"shared"`
	Properties []string
}

JobProvidesInfo describes a BOSH link provider

type JobReference

type JobReference struct {
	*Job                `yaml:"-"`                 // The resolved job
	Name                string                     `yaml:"name"`    // The name of the job
	ReleaseName         string                     `yaml:"release"` // The release the job comes from
	ExportedProvides    map[string]JobProvidesInfo `yaml:"provides"`
	ResolvedConsumes    map[string]JobConsumesInfo `yaml:"consumes"`    // Instance groups that this job links to & requires
	ResolvedConsumedBy  map[string][]JobLinkInfo   `yaml:"consumed_by"` // Instance groups that consume a link
	ContainerProperties JobContainerProperties     `yaml:"properties"`
}

JobReference from the deployment manifest, references a job spec from a release by ReleaseName

func (*JobReference) WriteConfigs

func (j *JobReference) WriteConfigs(instanceGroup *InstanceGroup, lightOpinionsPath, darkOpinionsPath string) ([]byte, error)

WriteConfigs merges the job's spec with the opinions and returns the result as JSON.

type JobReferences

type JobReferences []*JobReference

JobReferences is a collection of pointers to job references

func (JobReferences) WithRunProperty

func (jobs JobReferences) WithRunProperty() JobReferences

WithRunProperty returns all jobs with a BOSH containerization run property could cache this on InstanceGroup if it turns out to be expensive

type JobTemplate

type JobTemplate struct {
	SourcePath      string
	DestinationPath string
	Job             *Job
	Content         string
}

JobTemplate represents a BOSH job template

func (*JobTemplate) Marshal

func (t *JobTemplate) Marshal() (interface{}, error)

Marshal implements the util.Marshaler interface

type Jobs

type Jobs []*Job

Jobs is an array of Job*

func (Jobs) Len

func (slice Jobs) Len() int

Len implements the Len function to satisfy sort.Interface

func (Jobs) Less

func (slice Jobs) Less(i, j int) bool

Less implements the Less function to satisfy sort.Interface

func (Jobs) Swap

func (slice Jobs) Swap(i, j int)

Swap implements the Swap function to satisfy sort.Interface

type LoadRoleManifestOptions

type LoadRoleManifestOptions struct {
	ReleaseOptions
	Grapher           util.ModelGrapher
	ValidationOptions RoleManifestValidationOptions
}

LoadRoleManifestOptions provides the input to LoadRoleManifest()

type Opinions

type Opinions struct {
	Light map[string]interface{}
	Dark  map[string]interface{}
}

Opinions holds the light and dark opinions given to fissile

func NewEmptyOpinions

func NewEmptyOpinions() *Opinions

NewEmptyOpinions returns an empty opinions object, used for testing and generating the version of the package layer, that doesn't change if opinions change

func NewOpinions

func NewOpinions(lightFile, darkFile string) (*Opinions, error)

NewOpinions returns the json opinions for the light and dark opinion files

func (*Opinions) GetOpinionForKey

func (o *Opinions) GetOpinionForKey(opinions map[string]interface{}, keyPieces []string) (result interface{})

GetOpinionForKey pulls an opinion out of the holding container.

type Package

type Package struct {
	Name         string
	Version      string
	Fingerprint  string
	SHA1         string
	Release      *Release
	Path         string
	Dependencies Packages
	// contains filtered or unexported fields
}

Package represents a BOSH package

func (*Package) Extract

func (p *Package) Extract(destination string) (string, error)

Extract will extract the contents of the package archive to destination It creates a directory with the name of the package Returns the full path of the extracted archive

func (*Package) GetPackageCompiledDir

func (p *Package) GetPackageCompiledDir(workDir string) string

GetPackageCompiledDir returns the path to the build result directory of the package, underneath the main cache directory

func (*Package) GetPackageCompiledTempDir

func (p *Package) GetPackageCompiledTempDir(workDir string) string

GetPackageCompiledTempDir returns the path to the build temp directory for the package, underneath the main cache directory

func (*Package) GetTargetPackageSourcesDir

func (p *Package) GetTargetPackageSourcesDir(workDir string) string

GetTargetPackageSourcesDir returns the path to the sources of the package, underneath the main cache directory

func (*Package) Marshal

func (p *Package) Marshal() (interface{}, error)

Marshal implements the util.Marshaler interface

func (*Package) ValidateSHA1

func (p *Package) ValidateSHA1() error

ValidateSHA1 validates that the SHA1 of the actual package archive is the same as the one from the release manifest

type Packages

type Packages []*Package

Packages is an array of *Package

func (Packages) Len

func (slice Packages) Len() int

Len implements the Len function to satisfy sort.Interface

func (Packages) Less

func (slice Packages) Less(i, j int) bool

Less implements the Less function to satisfy sort.Interface

func (Packages) Swap

func (slice Packages) Swap(i, j int)

Swap implements the Swap function to satisfy sort.Interface

type PodSecurityPolicy

type PodSecurityPolicy struct {
	Definition interface{}
}

PodSecurityPolicy defines a pod security policy

func (*PodSecurityPolicy) UnmarshalYAML

func (policy *PodSecurityPolicy) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.v2/Unmarshaler interface. We don't want to describe the whole PodSecurityPolicySpec, so just hold all of it in an interface{} instead

type PropertyDefaults

type PropertyDefaults map[string]*PropertyInfo

PropertyDefaults is a map from property names to information about it needed for validation.

type PropertyInfo

type PropertyInfo struct {
	MaybeHash bool
	Defaults  map[string][]*Job
}

PropertyInfo is a structure listing the (stringified) defaults and the associated jobs for a property, plus other aggregated information (whether it is a hash, or not).

func NewPropertyInfo

func NewPropertyInfo() *PropertyInfo

NewPropertyInfo creates a new PropertyInfo structure instance

type Release

type Release struct {
	Jobs               Jobs
	Packages           Packages
	License            ReleaseLicense
	Name               string
	UncommittedChanges bool
	CommitHash         string
	Version            string
	Path               string
	DevBOSHCacheDir    string
	FinalRelease       bool
	// contains filtered or unexported fields
}

Release represents a BOSH release

func NewDevRelease

func NewDevRelease(path, releaseName, version, boshCacheDir string) (*Release, error)

NewDevRelease will create an instance of a BOSH development release

func NewFinalRelease

func NewFinalRelease(path string) (release *Release, err error)

NewFinalRelease will create an instance of a BOSH final release

func (*Release) GetUniqueConfigs

func (r *Release) GetUniqueConfigs() map[string]*ReleaseConfig

GetUniqueConfigs returns all unique configs available in a release

func (*Release) LookupJob

func (r *Release) LookupJob(jobName string) (*Job, error)

LookupJob will find a job within a BOSH release

func (*Release) LookupPackage

func (r *Release) LookupPackage(packageName string) (*Package, error)

LookupPackage will find a package within a BOSH release

func (*Release) ManifestFilePath

func (r *Release) ManifestFilePath() string

ManifestFilePath returns the path to the releases manifest

func (*Release) Marshal

func (r *Release) Marshal() (interface{}, error)

Marshal implements the util.Marshaler interface

func (*Release) ReleaseType

func (r *Release) ReleaseType() string

ReleaseType returns a string identifying the type of the release: Dev or Final.

type ReleaseConfig

type ReleaseConfig struct {
	Name        string
	Description string
	Jobs        Jobs
	UsageCount  int
}

ReleaseConfig is a global deployment configuration key

type ReleaseLicense

type ReleaseLicense struct {
	// Files is a mapping of license file names to contents
	Files map[string][]byte
	// Release this license belongs to
	Release *Release
}

ReleaseLicense represents the license of a BOSH release

type ReleaseOptions

type ReleaseOptions struct {
	ReleasePaths     []string
	ReleaseNames     []string
	ReleaseVersions  []string
	BOSHCacheDir     string
	FinalReleasesDir string
}

ReleaseOptions for releases

type ReleaseRef

type ReleaseRef struct {
	Name    string `yaml:"name"`
	URL     string `yaml:"url"`
	SHA1    string `yaml:"sha1"`
	Version string `yaml:"version"`
}

ReleaseRef represents a reference to a BOSH release from a manifest

type ReleaseResolver

type ReleaseResolver interface {
	Load(ReleaseOptions, []*ReleaseRef) (Releases, error)
	CanValidate() bool
	MapReleases(Releases) error
	FindRelease(string) (*Release, bool)
}

ReleaseResolver loads job specs from releases and acts as a registry for release structs containing those job specs

type Releases

type Releases []*Release

Releases represent a list of releases

type RoleManifest

type RoleManifest struct {
	InstanceGroups InstanceGroups `yaml:"instance_groups"`
	Configuration  *Configuration `yaml:"configuration"`
	Variables      Variables
	Releases       []*ReleaseRef `yaml:"releases"`

	LoadedReleases   Releases
	Features         map[string]bool
	ManifestFilePath string
	ManifestContent  []byte `yaml:"-"`
}

RoleManifest represents a collection of roles

func NewRoleManifest

func NewRoleManifest() *RoleManifest

NewRoleManifest returns a new role manifest struct

func (*RoleManifest) AddFeature

func (m *RoleManifest) AddFeature(name string, enabledByDefault bool)

AddFeature will add a feature name to the manifest. A feature needs to be enabled only once to be enabled globally.

func (*RoleManifest) LoadManifestFromFile

func (m *RoleManifest) LoadManifestFromFile(manifestFilePath string) (err error)

LoadManifestFromFile loads the manifest content from a file

func (*RoleManifest) LookupInstanceGroup

func (m *RoleManifest) LookupInstanceGroup(name string) *InstanceGroup

LookupInstanceGroup will find the given instance group in the role manifest

func (*RoleManifest) SelectInstanceGroups

func (m *RoleManifest) SelectInstanceGroups(roleNames []string) (InstanceGroups, error)

SelectInstanceGroups will find only the given instance groups in the role manifest

type RoleManifestValidationOptions

type RoleManifestValidationOptions struct {
	AllowMissingScripts bool
}

RoleManifestValidationOptions allows tests to skip some parts of validation

type RoleRun

type RoleRun struct {
	Scaling            *RoleRunScaling  `yaml:"scaling"`
	Capabilities       []string         `yaml:"capabilities"`
	Privileged         bool             `yaml:"privileged"`
	PersistentVolumes  []*RoleRunVolume `yaml:"persistent-volumes"` // Backwards compat only
	SharedVolumes      []*RoleRunVolume `yaml:"shared-volumes"`     // Backwards compat only
	Volumes            []*RoleRunVolume `yaml:"volumes"`
	MemRequest         *int64           `yaml:"memory"`
	Memory             *RoleRunMemory   `yaml:"mem"`
	VirtualCPUs        *float64         `yaml:"virtual-cpus"`
	CPU                *RoleRunCPU      `yaml:"cpu"`
	FlightStage        FlightStage      `yaml:"flight-stage"`
	HealthCheck        *HealthCheck     `yaml:"healthcheck,omitempty"`
	ActivePassiveProbe string           `yaml:"active-passive-probe,omitempty"`
	ServiceAccount     string           `yaml:"service-account,omitempty"`
	Affinity           *RoleRunAffinity `yaml:"affinity,omitempty"`
}

RoleRun describes how a role should behave at runtime

type RoleRunAffinity

type RoleRunAffinity struct {
	PodAntiAffinity interface{} `yaml:"podAntiAffinity,omitempty"`
	PodAffinity     interface{} `yaml:"podAffinity,omitempty"`
	NodeAffinity    interface{} `yaml:"nodeAffinity,omitempty"`
}

RoleRunAffinity describes how a role should behave with regard to node / pod selection

type RoleRunCPU

type RoleRunCPU struct {
	Request *float64 `yaml:"request"`
	Limit   *float64 `yaml:"limit"`
}

RoleRunCPU describes how a role should behave with regard to cpu usage.

type RoleRunMemory

type RoleRunMemory struct {
	Request *int64 `yaml:"request"`
	Limit   *int64 `yaml:"limit"`
}

RoleRunMemory describes how a role should behave with regard to memory usage.

type RoleRunScaling

type RoleRunScaling struct {
	Min       int  `yaml:"min"`
	Max       int  `yaml:"max"`
	HA        int  `yaml:"ha,omitempty"`
	MustBeOdd bool `yaml:"must_be_odd,omitempty"`
}

RoleRunScaling describes how a role should scale out at runtime

type RoleRunVolume

type RoleRunVolume struct {
	Type        VolumeType        `yaml:"type"`
	Path        string            `yaml:"path"`
	Tag         string            `yaml:"tag"`
	Size        int               `yaml:"size"`
	Annotations map[string]string `yaml:"annotations"`
}

RoleRunVolume describes a volume to be attached at runtime

type RoleTag

type RoleTag string

RoleTag are the acceptable tags

type RoleType

type RoleType string

RoleType is the type of the role; see the constants below

type VariableDefinition

type VariableDefinition struct {
	Name      string
	Type      string
	CVOptions CVOptions
}

VariableDefinition from the BOSH deployment manifest Type is used to decide on a generator

func (*VariableDefinition) Value

func (config *VariableDefinition) Value() (bool, string)

Value fetches the value of config variable

type Variables

type Variables []*VariableDefinition

Variables from the BOSH manifests variables section

func (Variables) Len

func (confVars Variables) Len() int

Len is the number of ConfigurationVariables in the slice

func (Variables) Less

func (confVars Variables) Less(i, j int) bool

Less reports whether config variable at index i sort before the one at index j

func (Variables) Swap

func (confVars Variables) Swap(i, j int)

Swap exchanges configuration variables at index i and index j

type VolumeType

type VolumeType string

VolumeType is the type of volume to create

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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