build

package
v2.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2020 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDefaultServiceParameter

func IsDefaultServiceParameter(sp *v1.ServiceParameterInfo) bool

func NewEndpointSecretFromEnv

func NewEndpointSecretFromEnv(name string, namespace string) (*v1.Secret, error)

Types

type AddressFilter

type AddressFilter struct {
}

AddressFilter defines a host filter which is responsible for moving IP addresses from a host profile to the host overrides attributes. Since IP addresses are always host specific there is no need to create a unique profile just for this one attribute.

func NewAddressFilter

func NewAddressFilter() *AddressFilter

func (*AddressFilter) Filter

func (in *AddressFilter) Filter(profile *v1.HostProfile, host *v1.Host, deployment *Deployment) error

type BMAddressFilter

type BMAddressFilter struct {
}

BMAddressFilter defines a host filter which is responsible for moving a BM address from a host profile to the host overrides attributes. Since IP addresses are always host specific there is no need to create a unique profile just for this one attribute.

func NewBMAddressFilter

func NewBMAddressFilter() *BMAddressFilter

func (*BMAddressFilter) Filter

func (in *BMAddressFilter) Filter(profile *v1.HostProfile, host *v1.Host, deployment *Deployment) error

type Builder

type Builder interface {
	Build() (*Deployment, error)
	AddSystemFilters(filters []SystemFilter)
	AddProfileFilters(filters []ProfileFilter)
	AddHostFilters(filters []HostFilter)
}

Builder is the deployment builder interface which exists to allow easier mocking for unit test development.

type CACertificateFilter added in v1.0.0

type CACertificateFilter struct {
}

CACertificateFilter defines a system filter that removes trusted CA certificates from the configuration under the assumption that they were added at bootstrap time rather than as a post install step. This is being done to remove the trusted ssl_ca certificates that get installed at boostrap time to allow images from custom docker registries to be loaded. Since those certificates are added at bootstrap time there is no need to also add them to the deployment config since it only adds an extra step for end users. Since we do not delete certificates at reconcile time (for now) there is no need to have these included.

func NewCACertificateFilter added in v1.0.0

func NewCACertificateFilter() *CACertificateFilter

func (*CACertificateFilter) Filter added in v1.0.0

func (in *CACertificateFilter) Filter(system *v1.System, deployment *Deployment) error

type ConsoleNameFilter

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

ConsoleNameFilter defines a profile filter a that attempts to normalize the console attributes on hosts. Console specifications seem to be consistently setting the parity and stop bits so if they are missing we attempt to apply the Linux default values. The flow control value is left off since it does not appear to be used much. Empty values are omitted since the API does not accept them.

func NewConsoleNameFilter

func NewConsoleNameFilter() *ConsoleNameFilter

func (*ConsoleNameFilter) Filter

func (in *ConsoleNameFilter) Filter(profile *v1.HostProfile, deployment *Deployment) error

func (*ConsoleNameFilter) Reset

func (in *ConsoleNameFilter) Reset()

type Controller0Filter

type Controller0Filter struct {
}

Controller0Filter defines a host filter which is responsible for changing the provisioning mode of the controller-0 nodes from static to dynamic since we never statically provisioning controller-0 as it is always pre-populated.

func NewController0Filter

func NewController0Filter() *Controller0Filter

func (*Controller0Filter) Filter

func (in *Controller0Filter) Filter(profile *v1.HostProfile, host *v1.Host, deployment *Deployment) error

type Deployment

type Deployment struct {
	Namespace         v1.Namespace
	Secrets           []*v1.Secret
	IncompleteSecrets []*v1.Secret
	System            starlingxv1.System
	PlatformNetworks  []*starlingxv1.PlatformNetwork
	DataNetworks      []*starlingxv1.DataNetwork
	Profiles          []*starlingxv1.HostProfile
	Hosts             []*starlingxv1.Host
}

Deployment defines the structure used to store all of the details of a system deployment. It includes all of the standard kubernetes objects as well as all of the CRD objects required to represent a full running system.

func (*Deployment) ToYAML

func (d *Deployment) ToYAML() (string, error)

ToYAML is a utility method to publish the system deployment instance as a YAML document. Each distinct resource within the document will be separated by a "---" line.

type DeploymentBuilder

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

DeploymentBuilder is the concrete implementation of the builder interface which is capable of building a full deployment model based on a running system.

func NewDeploymentBuilder

func NewDeploymentBuilder(client *gophercloud.ServiceClient, namespace string, name string, progressWriter io.Writer) *DeploymentBuilder

NewDeploymentBuilder returns an instantiation of a deployment builder structure.

func (*DeploymentBuilder) AddHostFilters

func (db *DeploymentBuilder) AddHostFilters(filters []HostFilter)

AddHostFilters adds a list of profile filters to the set already present on the deployment builder (if any).

func (*DeploymentBuilder) AddProfileFilters

func (db *DeploymentBuilder) AddProfileFilters(filters []ProfileFilter)

AddProfileFilters adds a list of profile filters to the set already present on the deployment builder (if any).

func (*DeploymentBuilder) AddSystemFilters added in v1.0.0

func (db *DeploymentBuilder) AddSystemFilters(filters []SystemFilter)

AddSystemFilters adds a list of system filters to the set already present on the deployment builder (if any).

func (*DeploymentBuilder) Build

func (db *DeploymentBuilder) Build() (*Deployment, error)

Build is the main method which produces a deployment object based on a running system.

type HostFilter

type HostFilter interface {
	Filter(profile *v1.HostProfile, host *v1.Host, deployment *Deployment) error
}

HostFilter defines an interface from which concrete host filters can be defined. The purpose of a host filter is to look at a given profile and remove any fields that are relevant to a single host versus being relevant to multiple hosts. Those fields should be moved to the host overrides attributes.

type InterfaceDefaultsFilter

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

InterfaceDefaultsFilter defines a profile filter that removes default values from interfaces in an effort to minimize the number of fields defined on interfaces.

func NewInterfaceDefaultsFilter

func NewInterfaceDefaultsFilter() *InterfaceDefaultsFilter

func (*InterfaceDefaultsFilter) CheckInterface

func (in *InterfaceDefaultsFilter) CheckInterface(info *v1.CommonInterfaceInfo)

func (*InterfaceDefaultsFilter) Filter

func (in *InterfaceDefaultsFilter) Filter(profile *v1.HostProfile, deployment *Deployment) error

func (*InterfaceDefaultsFilter) Reset

func (in *InterfaceDefaultsFilter) Reset()

type InterfaceMTUFilter

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

InterfaceMTUFilter defines a profile filter which attempts to find discrepancies with MTU values across different nodes. This is a two-pass filter meaning it must be run on all profiles twice so that the highwater mark can be applied to all profiles.

func NewInterfaceMTUFilter

func NewInterfaceMTUFilter() *InterfaceMTUFilter

func (*InterfaceMTUFilter) CheckMTU

func (in *InterfaceMTUFilter) CheckMTU(info *v1.CommonInterfaceInfo)

func (*InterfaceMTUFilter) CheckMemberMTU

func (in *InterfaceMTUFilter) CheckMemberMTU(info *v1.BondInfo, ethernet v1.EthernetList)

func (*InterfaceMTUFilter) Filter

func (in *InterfaceMTUFilter) Filter(profile *v1.HostProfile, deployment *Deployment) error

func (*InterfaceMTUFilter) Reset

func (in *InterfaceMTUFilter) Reset()

type InterfaceNamingFilter

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

InterfaceNamingFilter defines a profile filter that normalizes interface names across host profiles so that there is a better chance of reducing the number of profiles that exist in the system definition.

func NewInterfaceNamingFilter

func NewInterfaceNamingFilter() *InterfaceNamingFilter

func (*InterfaceNamingFilter) CheckInterface

func (in *InterfaceNamingFilter) CheckInterface(info *v1.CommonInterfaceInfo)

func (*InterfaceNamingFilter) Filter

func (in *InterfaceNamingFilter) Filter(profile *v1.HostProfile, deployment *Deployment) error

func (*InterfaceNamingFilter) Reset

func (in *InterfaceNamingFilter) Reset()

type InterfaceUnusedFilter

type InterfaceUnusedFilter struct {
}

InterfaceUnusedFilter defines a profile filter which looks at the list of interfaces present on a profile and removes any unused ethernet interfaces. For instance, an ethernet interface is considered unused if it has no 'class' set and it not used as a dependency to some other interface.

func NewInterfaceUnusedFilter

func NewInterfaceUnusedFilter() *InterfaceUnusedFilter

func (*InterfaceUnusedFilter) Filter

func (in *InterfaceUnusedFilter) Filter(profile *v1.HostProfile, deployment *Deployment) error

func (*InterfaceUnusedFilter) Reset

func (in *InterfaceUnusedFilter) Reset()

type LocationFilter added in v1.0.0

type LocationFilter struct {
}

LocationFilter defines a host filter which is responsible for moving the location attribute (if set) from a host profile to the host overrides attributes. Since locations are usually specified to identify specific hosts rather than the larger data center then it usually belongs at the host level.

func NewLocationFilter added in v1.0.0

func NewLocationFilter() *LocationFilter

func (*LocationFilter) Filter added in v1.0.0

func (in *LocationFilter) Filter(profile *v1.HostProfile, host *v1.Host, deployment *Deployment) error

type LoopbackInterfaceFilter

type LoopbackInterfaceFilter struct {
}

LoopbackInterfaceFilter defines a host filter which is responsible for moving any loopback interface specification from the profile to the host overrides. The loopback interface is only expected on controller-0 nodes therefore rather than create a unique profile because of this one interface we prefer to move it to the host specific overrides and leave the profile as generic.

func NewLoopbackInterfaceFilter

func NewLoopbackInterfaceFilter() *LoopbackInterfaceFilter

func (*LoopbackInterfaceFilter) Filter

func (in *LoopbackInterfaceFilter) Filter(profile *v1.HostProfile, host *v1.Host, deployment *Deployment) error

type MemoryClearAllFilter

type MemoryClearAllFilter struct {
}

MemoryClearAllFilter defines a special memory filter that removes all memory configurations. This is useful to avoid slight memory discrepancies between when we know that the system defaults have never been updated.

func NewMemoryClearAllFilter

func NewMemoryClearAllFilter() *MemoryClearAllFilter

func (*MemoryClearAllFilter) Filter

func (in *MemoryClearAllFilter) Filter(profile *v1.HostProfile, deployment *Deployment) error

func (*MemoryClearAllFilter) Reset

func (in *MemoryClearAllFilter) Reset()

type MemoryDefaultsFilter

type MemoryDefaultsFilter struct {
}

MemoryDefaultsFilter defines a profile filter which looks at the list of memory functions present and removes any that appear to be system defaults.

func NewMemoryDefaultsFilter

func NewMemoryDefaultsFilter() *MemoryDefaultsFilter

func (*MemoryDefaultsFilter) Filter

func (in *MemoryDefaultsFilter) Filter(profile *v1.HostProfile, deployment *Deployment) error

func (*MemoryDefaultsFilter) Reset

func (in *MemoryDefaultsFilter) Reset()

type ProcessorClearAllFilter

type ProcessorClearAllFilter struct {
}

ProcessorClearAllFilter defines a special Processor filter that removes all Processor configurations. This is useful to avoid cases where it is difficult to determine if the current processor configuration is a system default or not.

func NewProcessorClearAllFilter

func NewProcessorClearAllFilter() *ProcessorClearAllFilter

func (*ProcessorClearAllFilter) Filter

func (in *ProcessorClearAllFilter) Filter(profile *v1.HostProfile, deployment *Deployment) error

func (*ProcessorClearAllFilter) Reset

func (in *ProcessorClearAllFilter) Reset()

type ProcessorDefaultsFilter

type ProcessorDefaultsFilter struct {
}

ProcessorDefaultsFilter defines a profile filter which look at the list of processor functions present and removes any that appear to be system defaults.

func NewProcessorDefaultsFilter

func NewProcessorDefaultsFilter() *ProcessorDefaultsFilter

func (*ProcessorDefaultsFilter) Filter

func (in *ProcessorDefaultsFilter) Filter(profile *v1.HostProfile, deployment *Deployment) error

func (*ProcessorDefaultsFilter) Reset

func (in *ProcessorDefaultsFilter) Reset()

type ProfileFilter

type ProfileFilter interface {
	Filter(profile *v1.HostProfile, deployment *Deployment) error
	Reset()
}

ProfileFilter defines an interface from which concrete profile filters can be defined. The purpose of a profile filter is to look at a given profile and remove any fields that are not necessary or relevant to the deployment being generated.

type ServiceParameterFilter

type ServiceParameterFilter struct {
}

func NewServiceParametersSystemFilter

func NewServiceParametersSystemFilter() *ServiceParameterFilter

func (*ServiceParameterFilter) Filter

func (in *ServiceParameterFilter) Filter(system *v1.System, deployment *Deployment) error

type StorageMonitorFilter

type StorageMonitorFilter struct {
}

StorageMonitorFilter defines a host filter which is responsible for moving storage monitors from a host profile to the host overrides attribute. since it is only expected to be present on a single node and we do not want to prevent sharing the same profile across multiple nodes.

func NewStorageMonitorFilter

func NewStorageMonitorFilter() *StorageMonitorFilter

func (*StorageMonitorFilter) Filter

func (in *StorageMonitorFilter) Filter(profile *v1.HostProfile, host *v1.Host, deployment *Deployment) error

type SystemFilter added in v1.0.0

type SystemFilter interface {
	Filter(system *v1.System, deployment *Deployment) error
}

SystemFilter defines an interface from which concrete system filters can be defined. The purpose of a system filter is to remove attributes that may not be needed for a runtime configuration or to align values to end user requirements.

type VolumeGroupFilter

type VolumeGroupFilter struct {
	Blacklist []string
}

VolumeGroupFilter defines a profile filter which looks at the list of volume groups present and removes any that are included in the specified blacklist.

func NewVolumeGroupFilter

func NewVolumeGroupFilter(blacklist []string) *VolumeGroupFilter

func NewVolumeGroupSystemFilter

func NewVolumeGroupSystemFilter() *VolumeGroupFilter

func (*VolumeGroupFilter) Filter

func (in *VolumeGroupFilter) Filter(profile *v1.HostProfile, deployment *Deployment) error

func (*VolumeGroupFilter) Reset

func (in *VolumeGroupFilter) Reset()

Jump to

Keyboard shortcuts

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