manifest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2019 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VarInterpolationContainerName is the name of the container that performs
	// variable interpolation for a manifest
	VarInterpolationContainerName = "interpolation"
)

Variables

View Source
var (
	// DockerOrganization is the organization which provides the operator image
	DockerOrganization = ""
	// DockerRepository is the repository which provides the operator image
	DockerRepository = ""
	// DockerTag is the tag of the operator image
	DockerTag = ""
	// LabelDeploymentName is the name of a label for the deployment name
	LabelDeploymentName = fmt.Sprintf("%s/deployment-name", apis.GroupName)
	// LabelInstanceGroupName is the name of a label for an instance group name
	LabelInstanceGroupName = fmt.Sprintf("%s/instance-group-name", apis.GroupName)
)

Functions

func GetOperatorDockerImage

func GetOperatorDockerImage() string

GetOperatorDockerImage returns the image name of the operator docker image

Types

type AddOn

type AddOn struct {
	Name    string               `yaml:"name"`
	Jobs    []AddOnJob           `yaml:"jobs"`
	Include *AddOnPlacementRules `yaml:"include,omitempty"`
	Exclude *AddOnPlacementRules `yaml:"exclude,omitempty"`
}

AddOn from BOSH deployment manifest

type AddOnJob

type AddOnJob struct {
	Name       string                 `yaml:"name"`
	Release    string                 `yaml:"release"`
	Properties map[string]interface{} `yaml:"properties,omitempty"`
}

AddOnJob from BOSH deployment manifest

type AddOnPlacementJob

type AddOnPlacementJob struct {
	Name    string `yaml:"name"`
	Release string `yaml:"release"`
}

AddOnPlacementJob from BOSH deployment manifest

type AddOnPlacementRules

type AddOnPlacementRules struct {
	Stemcell      []*AddOnStemcell     `yaml:"stemcell,omitempty"`
	Deployments   []string             `yaml:"deployments,omitempty"`
	Jobs          []*AddOnPlacementJob `yaml:"release,omitempty"`
	InstanceGroup []string             `yaml:"instance_groups,omitempty"`
	Networks      []string             `yaml:"networks,omitempty"`
	Teams         []string             `yaml:"teams,omitempty"`
}

AddOnPlacementRules from BOSH deployment manifest

type AddOnStemcell

type AddOnStemcell struct {
	OS string `yaml:"os"`
}

AddOnStemcell from BOSH deployment manifest

type Agent

type Agent struct {
	Settings string `yaml:"settings,omitempty"`
	Tmpfs    *bool  `yaml:"tmpfs,omitempty"`
}

Agent from BOSH deployment manifest

type AgentEnv

type AgentEnv struct {
	PersistentDiskFS           string              `yaml:"persistent_disk_fs,omitempty"`
	PersistentDiskMountOptions []string            `yaml:"persistent_disk_mount_options,omitempty"`
	AgentEnvBoshConfig         *AgentEnvBoshConfig `yaml:"bosh,omitempty"`
}

AgentEnv from BOSH deployment manifest

type AgentEnvBoshConfig

type AgentEnvBoshConfig struct {
	Password              string  `yaml:"password,omitempty"`
	KeepRootPassword      string  `yaml:"keep_root_password,omitempty"`
	RemoveDevTools        *bool   `yaml:"remove_dev_tools,omitempty"`
	RemoveStaticLibraries *bool   `yaml:"remove_static_libraries,omitempty"`
	SwapSize              *int    `yaml:"swap_size,omitempty"`
	IPv6                  IPv6    `yaml:"ipv6,omitempty"`
	JobDir                *JobDir `yaml:"job_dir,omitempty"`
	Agent                 *Agent  `yaml:"agent,omitempty"`
}

AgentEnvBoshConfig from BOSH deployment manifest

type AuthType

type AuthType string

AuthType from BOSH deployment manifest

const (
	ClientAuth AuthType = "client_auth"
	ServerAuth AuthType = "server_auth"
)

AuthType values from BOSH deployment manifest

type BOSHContainerization

type BOSHContainerization struct {
	Consumes  map[string]JobLink `yaml:"consumes"`
	Instances []JobInstance      `yaml:"instances"`
	Release   string             `yaml:"release"`
	BPM       bpm.Config         `yaml:"bpm"`
}

BOSHContainerization represents the special 'bosh_containerization' property key

type DeploymentSecretType

type DeploymentSecretType int

DeploymentSecretType lists all the types of secrets used in the lifecycle of a BOSHDeployment

const (
	// DeploymentSecretTypeManifestWithOps is a manifest that has ops files applied
	DeploymentSecretTypeManifestWithOps DeploymentSecretType = iota
	// DeploymentSecretTypeManifestAndVars is a manifest whose variables have been interpolated
	DeploymentSecretTypeManifestAndVars
	// DeploymentSecretTypeGeneratedVariable is a BOSH variable generated using an ExtendedSecret
	DeploymentSecretTypeGeneratedVariable
	// DeploymentSecretTypeInstanceGroupResolvedProperties is a YAML file containing all properties needed to render an Instance Group
	DeploymentSecretTypeInstanceGroupResolvedProperties
)

func (DeploymentSecretType) String

func (s DeploymentSecretType) String() string

type Feature

type Feature struct {
	ConvergeVariables    bool  `yaml:"converge_variables"`
	RandomizeAzPlacement *bool `yaml:"randomize_az_placement,omitempty"`
	UseDNSAddresses      *bool `yaml:"use_dns_addresses,omitempty"`
	UseTmpfsJobConfig    *bool `yaml:"use_tmpfs_job_config,omitempty"`
}

Feature from BOSH deployment manifest

type IPv6

type IPv6 struct {
	Enable bool `yaml:"enable"`
}

IPv6 from BOSH deployment manifest

type InstanceGroup

type InstanceGroup struct {
	Name               string                 `yaml:"name"`
	Instances          int                    `yaml:"instances"`
	Azs                []string               `yaml:"azs"`
	Jobs               []Job                  `yaml:"jobs"`
	VMType             string                 `yaml:"vm_type,omitempty"`
	VMExtensions       []string               `yaml:"vm_extensions,omitempty"`
	VMResources        *VMResource            `yaml:"vm_resources"`
	Stemcell           string                 `yaml:"stemcell"`
	PersistentDisk     *int                   `yaml:"persistent_disk,omitempty"`
	PersistentDiskType string                 `yaml:"persistent_disk_type,omitempty"`
	Networks           []*Network             `yaml:"networks,omitempty"`
	Update             *Update                `yaml:"update,omitempty"`
	MigratedFrom       *MigratedFrom          `yaml:"migrated_from,omitempty"`
	LifeCycle          string                 `yaml:"lifecycle,omitempty"`
	Properties         map[string]interface{} `yaml:"properties,omitempty"`
	Env                *AgentEnv              `yaml:"env,omitempty"`
}

InstanceGroup from BOSH deployment manifest

type Interpolator

type Interpolator interface {
	BuildOps(opsBytes []byte) error
	Interpolate(manifestBytes []byte) ([]byte, error)
}

Interpolator renders BOSH manifests by operations files go:generate counterfeiter -o fakes/fake_interpolator.go . Interpolator

type InterpolatorImpl

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

InterpolatorImpl applies desired changes from BOSH operations files to to BOSH manifest

func NewInterpolator

func NewInterpolator() *InterpolatorImpl

NewInterpolator constructs an interpolator

func (*InterpolatorImpl) BuildOps

func (i *InterpolatorImpl) BuildOps(opsBytes []byte) error

BuildOps unmarshals ops definitions, processes them and holds them in memory

func (*InterpolatorImpl) Interpolate

func (i *InterpolatorImpl) Interpolate(manifestBytes []byte) ([]byte, error)

Interpolate returns manifest which is rendered by operations files

type Job

type Job struct {
	Name       string                 `yaml:"name"`
	Release    string                 `yaml:"release"`
	Consumes   map[string]interface{} `yaml:"consumes,omitempty"`
	Provides   map[string]interface{} `yaml:"provides,omitempty"`
	Properties JobProperties          `yaml:"properties,omitempty"`
}

Job from BOSH deployment manifest

type JobDir

type JobDir struct {
	Tmpfs     *bool  `yaml:"tmpfs,omitempty"`
	TmpfsSize string `yaml:"tmpfs_size,omitempty"`
}

JobDir from BOSH deployment manifest

type JobInstance

type JobInstance struct {
	Address     string                 `yaml:"address"`
	AZ          string                 `yaml:"az"`
	ID          string                 `yaml:"id"`
	Index       int                    `yaml:"index"`
	Instance    int                    `yaml:"instance"`
	Name        string                 `yaml:"name"`
	BPM         bpm.Config             `yaml:"bpm"`
	Fingerprint interface{}            `yaml:"fingerprint"`
	Network     map[string]interface{} `yaml:"networks"`
	IP          string                 `yaml:"ip"`
}

JobInstance for data gathering

type JobLink struct {
	Instances  []JobInstance          `yaml:"instances"`
	Properties map[string]interface{} `yaml:"properties"`
}

JobLink describes links inside a job properties bosh_containerization.

type JobProperties

type JobProperties struct {
	BOSHContainerization `yaml:"bosh_containerization"`
	Properties           map[string]interface{} `yaml:",inline"`
}

JobProperties represents the properties map of a Job

func (*JobProperties) ToMap

func (p *JobProperties) ToMap() map[string]interface{}

ToMap returns a complete map with all properties, including the bosh_containerization key

type JobSpec

type JobSpec struct {
	Name        string
	Description string
	Packages    []string
	Templates   map[string]string
	Properties  map[string]struct {
		Description string
		Default     interface{}
		Example     interface{}
	}
	Consumes []struct {
		Name     string
		Type     string
		Optional bool
	}
	Provides []struct {
		Name       string
		Type       string
		Properties []string
	}
}

JobSpec describes the contents of "job.MF" files

type KubeConfig

type KubeConfig struct {
	Variables                []esv1.ExtendedSecret
	InstanceGroups           []essv1.ExtendedStatefulSet
	Errands                  []ejv1.ExtendedJob
	Namespace                string
	VariableInterpolationJob *ejv1.ExtendedJob
	DataGatheringJob         *ejv1.ExtendedJob
}

KubeConfig represents a Manifest in kube resources

type Link struct {
	Name       string        `yaml:"name"`
	Instances  []JobInstance `yaml:"instances"`
	Properties interface{}   `yaml:"properties"`
}

Link with name for rendering

type Manifest

type Manifest struct {
	Name           string                   `yaml:"name"`
	DirectorUUID   string                   `yaml:"director_uuid"`
	InstanceGroups []*InstanceGroup         `yaml:"instance_groups,omitempty"`
	Features       *Feature                 `yaml:"features,omitempty"`
	Tags           map[string]string        `yaml:"tags,omitempty"`
	Releases       []*Release               `yaml:"releases,omitempty"`
	Stemcells      []*Stemcell              `yaml:"stemcells,omitempty"`
	AddOns         []*AddOn                 `yaml:"addons,omitempty"`
	Properties     []map[string]interface{} `yaml:"properties,omitempty"`
	Variables      []Variable               `yaml:"variables,omitempty"`
	Update         *Update                  `yaml:"update,omitempty"`
}

Manifest is a BOSH deployment manifest

func (*Manifest) ApplyBPMInfo

func (m *Manifest) ApplyBPMInfo(kubeConfig *KubeConfig, allResolvedProperties map[string]Manifest) error

ApplyBPMInfo uses BOSH Process Manager information to update container information like entrypoint, env vars, etc.

func (*Manifest) CalculateEJobOutputSecretPrefixAndName

func (m *Manifest) CalculateEJobOutputSecretPrefixAndName(secretType DeploymentSecretType, containerName string) (string, string)

CalculateEJobOutputSecretPrefixAndName generates a Secret prefix for the output of an Extended Job given a name, and calculates the final Secret name, given a container name

func (*Manifest) CalculateSecretName

func (m *Manifest) CalculateSecretName(secretType DeploymentSecretType, name string) string

CalculateSecretName generates a Secret name for a given name

func (*Manifest) ConvertToKube

func (m *Manifest) ConvertToKube(namespace string) (KubeConfig, error)

ConvertToKube converts a Manifest into kube resources

func (*Manifest) GetReleaseImage

func (m *Manifest) GetReleaseImage(instanceGroupName, jobName string) (string, error)

GetReleaseImage returns the release image location for a given instance group/job

func (*Manifest) SHA1

func (m *Manifest) SHA1() (string, error)

SHA1 calculates the SHA1 of the manifest

type MigratedFrom

type MigratedFrom struct {
	Name string `yaml:"name"`
	Az   string `yaml:"az,omitempty"`
}

MigratedFrom from BOSH deployment manifest

type Network

type Network struct {
	Name      string   `yaml:"name"`
	StaticIps []string `yaml:"static_ips,omitempty"`
	Default   []string `yaml:"default,omitempty"`
}

Network from BOSH deployment manifest

type Release

type Release struct {
	Name     string           `yaml:"name"`
	Version  string           `yaml:"version"`
	URL      string           `yaml:"url,omitempty"`
	SHA1     string           `yaml:"sha1,omitempty"`
	Stemcell *ReleaseStemcell `yaml:"stemcell,omitempty"`
}

Release from BOSH deployment manifest

type ReleaseStemcell

type ReleaseStemcell struct {
	OS      string `yaml:"os"`
	Version string `yaml:"version"`
}

ReleaseStemcell from BOSH deployment manifest

type Resolver

type Resolver interface {
	ResolveManifest(bdc.BOSHDeploymentSpec, string) (*Manifest, error)
}

Resolver resolves references from CRD to a BOSH manifest

type ResolverImpl

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

ResolverImpl implements Resolver interface

func NewResolver

func NewResolver(client client.Client, interpolator Interpolator) *ResolverImpl

NewResolver constructs a resolver

func (*ResolverImpl) ResolveManifest

func (r *ResolverImpl) ResolveManifest(spec bdc.BOSHDeploymentSpec, namespace string) (*Manifest, error)

ResolveManifest returns manifest referenced by our CRD

type Stemcell

type Stemcell struct {
	Alias   string `yaml:"alias"`
	OS      string `yaml:"os,omitempty"`
	Version string `yaml:"version"`
	Name    string `yaml:"name,omitempty"`
}

Stemcell from BOSH deployment manifest

type Update

type Update struct {
	Canaries        int     `yaml:"canaries"`
	MaxInFlight     string  `yaml:"max_in_flight"`
	CanaryWatchTime string  `yaml:"canary_watch_time"`
	UpdateWatchTime string  `yaml:"update_watch_time"`
	Serial          bool    `yaml:"serial,omitempty"`
	VMStrategy      *string `yaml:"vm_strategy,omitempty"`
}

Update from BOSH deployment manifest

type VMResource

type VMResource struct {
	CPU               int `yaml:"cpu"`
	RAM               int `yaml:"ram"`
	EphemeralDiskSize int `yaml:"ephemeral_disk_size"`
}

VMResource from BOSH deployment manifest

type Variable

type Variable struct {
	Name    string           `yaml:"name"`
	Type    string           `yaml:"type"`
	Options *VariableOptions `yaml:"options,omitempty"`
}

Variable from BOSH deployment manifest

type VariableOptions

type VariableOptions struct {
	CommonName       string     `yaml:"common_name"`
	AlternativeNames []string   `yaml:"alternative_names,omitempty"`
	IsCA             bool       `yaml:"is_ca"`
	CA               string     `yaml:"ca,omitempty"`
	ExtendedKeyUsage []AuthType `yaml:"extended_key_usage,omitempty"`
}

VariableOptions from BOSH deployment manifest

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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