siteConfig

package
v0.0.0-...-176e5c8 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const FileExt = ".yaml"
View Source
const Master = "master"
View Source
const McName = "predefined-extra-manifests"
View Source
const SNO = "sno"
View Source
const Standard = "standard"
View Source
const UnsetStringValue = "__unset_value__"
View Source
const ZtpAnnotation = "ran.openshift.io/ztp-gitops-generated"
View Source
const ZtpAnnotationDefaultValue = "{}"
View Source
const ZtpDeprecationWarningAnnotationPostfix = "field-deprecation"
View Source
const ZtpWarningAnnotation = "ran.openshift.io/ztp-warning"

Variables

View Source
var Separator = []byte("---\n")

Functions

func GetExtraManifestResourceDir

func GetExtraManifestResourceDir(manifestsPath string) (string, error)

func GetExtraManifestResourceFiles

func GetExtraManifestResourceFiles(manifestsPath string) ([]os.FileInfo, error)

func GetFiles

func GetFiles(path string) ([]os.FileInfo, error)

func MergeManifests

func MergeManifests(individualMachineConfigs map[string]interface{}, doNotMerge map[string]bool) (map[string]interface{}, error)

merge the spec fields of all MC manifests except the ones that are in the doNotMerge list

func NewAnnotationWarning

func NewAnnotationWarning(annoKey string) *annotationWarning

func PrintSiteConfigError

func PrintSiteConfigError(fileData []byte, errorMsg string)

PrintSiteConfigError function prints the SiteConfig with associated error to std output.

func ReadExtraManifestResourceFile

func ReadExtraManifestResourceFile(filePath string) ([]byte, error)

func ReadFile

func ReadFile(filePath string) ([]byte, error)

func WriteFile

func WriteFile(filePath string, outDir string, content []byte) error

Types

type AnnotationMessage

type AnnotationMessage struct {
	CRName string

	ShouldBeApplied func(Clusters) bool
	// contains filtered or unexported fields
}

type BiosConfigRef

type BiosConfigRef struct {
	FilePath string `yaml:"filePath"`
}

BiosConfigRef

type BmcCredentialsName

type BmcCredentialsName struct {
	Name string `yaml:"name"`
}

BmcCredentialsName

type CPUPartitioningMode

type CPUPartitioningMode string

CPUPartitioningMode is used to drive how a cluster nodes CPUs are Partitioned.

const (
	// The only supported configurations are an all or nothing configuration.
	CPUPartitioningNone     CPUPartitioningMode = "None"
	CPUPartitioningAllNodes CPUPartitioningMode = "AllNodes"
)

func (*CPUPartitioningMode) UnmarshalYAML

func (cm *CPUPartitioningMode) UnmarshalYAML(unmarshal func(interface{}) error) error

type ClusterNetwork

type ClusterNetwork struct {
	Cidr       string `yaml:"cidr"`
	HostPrefix int    `yaml:"hostPrefix"`
}

ClusterNetwork

type Clusters

type Clusters struct {
	ApiVIP                 string              `yaml:"apiVIP"`
	IngressVIP             string              `yaml:"ingressVIP"`
	ApiVIPs                []string            `yaml:"apiVIPs"`
	IngressVIPs            []string            `yaml:"ingressVIPs"`
	ClusterName            string              `yaml:"clusterName"`
	HoldInstallation       bool                `yaml:"holdInstallation"`
	AdditionalNTPSources   []string            `yaml:"additionalNTPSources"`
	Nodes                  []Nodes             `yaml:"nodes"`
	MachineNetwork         []MachineNetwork    `yaml:"machineNetwork"`
	ServiceNetwork         []string            `yaml:"serviceNetwork"`
	ClusterLabels          map[string]string   `yaml:"clusterLabels"`
	NetworkType            string              `yaml:"networkType"`
	InstallConfigOverrides string              `yaml:"installConfigOverrides,omitempty"`
	ClusterNetwork         []ClusterNetwork    `yaml:"clusterNetwork"`
	IgnitionConfigOverride string              `yaml:"ignitionConfigOverride"`
	DiskEncryption         DiskEncryption      `yaml:"diskEncryption"`
	Proxy                  Proxy               `yaml:"proxy,omitempty"`
	ExtraManifestPath      string              `yaml:"extraManifestPath"`
	ClusterImageSetNameRef string              `yaml:"clusterImageSetNameRef,omitempty"`
	BiosConfigRef          BiosConfigRef       `yaml:"biosConfigRef"`
	ExtraManifests         ExtraManifests      `yaml:"extraManifests"`
	CPUPartitioning        CPUPartitioningMode `yaml:"cpuPartitioningMode"`
	SiteConfigMap          SiteConfigMap       `yaml:"siteConfigMap"`

	ExtraManifestOnly      bool
	NumMasters             uint8
	NumWorkers             uint8
	ClusterType            string
	CrTemplates            map[string]string `yaml:"crTemplates"`
	CrAnnotations          CrAnnotations     `yaml:"crAnnotations"`
	CrSuppression          []string          `yaml:"crSuppression"`
	ManifestsConfigMapRefs []ManifestsConfigMapReference
	// optional: merge MachineConfigs into a single CR
	MergeDefaultMachineConfigs bool `yaml:"mergeDefaultMachineConfigs"`
}

Clusters

func (*Clusters) BiosFileSearch

func (cluster *Clusters) BiosFileSearch(site *Spec) string

Lookup bios config file path for this cluster, with fallback to site

func (*Clusters) CrAnnotationSearch

func (cluster *Clusters) CrAnnotationSearch(kind string, action string, site *Spec) (map[string]string, bool)

Lookup a specific CR annotation for this cluster, with fallback to site

func (*Clusters) CrTemplateSearch

func (cluster *Clusters) CrTemplateSearch(kind string, site *Spec) (string, bool)

Lookup a specific CR template for this cluster, with fallback to site

func (*Clusters) SiteConfigMapDataIsEmpty

func (cluster *Clusters) SiteConfigMapDataIsEmpty() bool

Return true if the SiteConfigMap content is empty.

func (*Clusters) SiteConfigMapIsUndefined

func (cluster *Clusters) SiteConfigMapIsUndefined() bool

Return true if the SiteConfigMap is not defined.

func (*Clusters) UnmarshalYAML

func (rv *Clusters) UnmarshalYAML(unmarshal func(interface{}) error) error

Provide custom YAML unmarshal for Clusters which provides default values

type CrAnnotations

type CrAnnotations struct {
	Add map[string]map[string]string `yaml:"add"`
}

type DirContainFiles

type DirContainFiles struct {
	Directory string
	Files     []os.FileInfo
}

type DiskEncryption

type DiskEncryption struct {
	Type string       `yaml:"type"`
	Tang []TangConfig `yaml:"tang"`
	Tpm2 TPM2Config   `yaml:"tpm2"`
}

func (*DiskEncryption) UnmarshalYAML

func (rv *DiskEncryption) UnmarshalYAML(unmarshal func(interface{}) error) error

Provide custom YAML unmarshal for DiskEncryption which provides default values

type DiskPartition

type DiskPartition struct {
	Device     string       `yaml:"device"`
	Partitions []Partitions `yaml:"partitions"`
}

type ExtraManifests

type ExtraManifests struct {
	SearchPaths *[]string `yaml:"searchPaths"`
	Filter      *Filter   `yaml:"filter"`
}

type Filter

type Filter struct {
	InclusionDefault *string  `yaml:"inclusionDefault"`
	Exclude          []string `yaml:"exclude"`
	Include          []string `yaml:"include"`
}

type Interfaces

type Interfaces struct {
	Name       string `yaml:"name"`
	MacAddress string `yaml:"macAddress"`
}

Interfaces

type IronicInspect

type IronicInspect string

IronicInspect

func (IronicInspect) IsValid

func (i IronicInspect) IsValid() error

type MachineNetwork

type MachineNetwork struct {
	Cidr string `yaml:"cidr"`
}

MachineNetwork

type ManifestsConfigMapReference

type ManifestsConfigMapReference struct {
	// Name is the name of the ConfigMap that this refers to
	Name string `json:"name"`
}

ManifestsConfigMapReference is a reference to a manifests ConfigMap

type Metadata

type Metadata struct {
	Name      string            `yaml:"name"`
	Namespace string            `yaml:"namespace"`
	Labels    map[string]string `yaml:"labels"`
}

Metadata

type NodeNetwork

type NodeNetwork struct {
	Config     map[string]interface{} `yaml:"config"`
	Interfaces []Interfaces           `yaml:"interfaces"`
}

NodeNetwork

type Nodes

type Nodes struct {
	BmcAddress             string                 `yaml:"bmcAddress"`
	BootMACAddress         string                 `yaml:"bootMACAddress"`
	AutomatedCleaningMode  string                 `yaml:"automatedCleaningMode"`
	RootDeviceHints        map[string]interface{} `yaml:"rootDeviceHints"`
	Cpuset                 string                 `yaml:"cpuset"`
	NodeNetwork            NodeNetwork            `yaml:"nodeNetwork"`
	NodeLabels             map[string]string      `yaml:"nodeLabels"`
	HostName               string                 `yaml:"hostName"`
	BmcCredentialsName     BmcCredentialsName     `yaml:"bmcCredentialsName"`
	BootMode               string                 `yaml:"bootMode"`
	UserData               map[string]interface{} `yaml:"userData"`
	InstallerArgs          string                 `yaml:"installerArgs"`
	IgnitionConfigOverride string                 `yaml:"ignitionConfigOverride"`
	Role                   string                 `yaml:"role"`
	CrTemplates            map[string]string      `yaml:"crTemplates"`
	CrAnnotations          CrAnnotations          `yaml:"crAnnotations"`
	CrSuppression          []string               `yaml:"crSuppression"`
	BiosConfigRef          BiosConfigRef          `yaml:"biosConfigRef"`
	DiskPartition          []DiskPartition        `yaml:"diskPartition"`
	IronicInspect          IronicInspect          `yaml:"ironicInspect"`
}

Nodes

func (*Nodes) BiosFileSearch

func (node *Nodes) BiosFileSearch(cluster *Clusters, site *Spec) string

Lookup bios config file path for this node, with fallback to cluster and site

func (*Nodes) CrAnnotationSearch

func (node *Nodes) CrAnnotationSearch(kind string, action string, cluster *Clusters, site *Spec) (map[string]string, bool)

Lookup a specific CR annotation for this node, with fallback to cluster and site

func (*Nodes) CrTemplateSearch

func (node *Nodes) CrTemplateSearch(kind string, cluster *Clusters, site *Spec) (string, bool)

Lookup a specific CR template for this node, with fallback to cluster and site

func (*Nodes) UnmarshalYAML

func (rv *Nodes) UnmarshalYAML(unmarshal func(interface{}) error) error

Provide custom YAML unmarshal for Nodes which provides default values

type Partitions

type Partitions struct {
	MountPoint       string `yaml:"mount_point" `
	Size             int    `yaml:"size"`
	Start            int    `yaml:"start"`
	FileSystemFormat string `yaml:"file_system_format"`
	MountFileName    string `yaml:"-"`
	Label            string `yaml:"-"`
	Encryption       bool   `yaml:"-"` // TODO: a place holder to enable disk encryption
}

func (*Partitions) UnmarshalYAML

func (prt *Partitions) UnmarshalYAML(unmarshal func(interface{}) error) error

type Proxy

type Proxy struct {
	HttpProxy  string `yaml:"httpProxy,omitempty"`
	HttpsProxy string `yaml:"httpsProxy,omitempty"`
	NoProxy    string `yaml:"noProxy,omitempty"`
}

type PullSecretRef

type PullSecretRef struct {
	Name string `yaml:"name"`
}

PullSecretRef

type SiteConfig

type SiteConfig struct {
	ApiVersion string   `yaml:"apiVersion"`
	Kind       string   `yaml:"kind"`
	Metadata   Metadata `yaml:"metadata"`
	Spec       Spec     `yaml:"spec"`
}

SiteConfig

func (*SiteConfig) GetSiteConfigFieldValue

func (sc *SiteConfig) GetSiteConfigFieldValue(path string, clusterId int, nodeId int) (interface{}, error)

type SiteConfigBuilder

type SiteConfigBuilder struct {
	SourceClusterCRs []interface{}
	// contains filtered or unexported fields
}

func NewSiteConfigBuilder

func NewSiteConfigBuilder() (*SiteConfigBuilder, error)

func (*SiteConfigBuilder) Build

func (scbuilder *SiteConfigBuilder) Build(siteConfigTemp SiteConfig) (map[string][]interface{}, error)

func (*SiteConfigBuilder) SetLocalExtraManifestPath

func (scbuilder *SiteConfigBuilder) SetLocalExtraManifestPath(path string)

type SiteConfigMap

type SiteConfigMap struct {
	Name      string            `yaml:"name"`
	Namespace string            `yaml:"namespace"`
	Data      map[string]string `yaml:"data"`
}

func (*SiteConfigMap) UnmarshalYAML

func (rv *SiteConfigMap) UnmarshalYAML(unmarshal func(interface{}) error) error

Provide custom YAML unmarshal for SiteConfigMap which provides default values

type Spec

type Spec struct {
	PullSecretRef          PullSecretRef          `yaml:"pullSecretRef"`
	ClusterImageSetNameRef string                 `yaml:"clusterImageSetNameRef"`
	SshPublicKey           string                 `yaml:"sshPublicKey"`
	SshPrivateKeySecretRef SshPrivateKeySecretRef `yaml:"sshPrivateKeySecretRef"`
	Clusters               []Clusters             `yaml:"clusters"`
	BaseDomain             string                 `yaml:"baseDomain"`
	CrTemplates            map[string]string      `yaml:"crTemplates"`
	CrAnnotations          CrAnnotations          `yaml:"crAnnotations"`
	BiosConfigRef          BiosConfigRef          `yaml:"biosConfigRef"`
}

Spec

func (*Spec) BiosFileSearch

func (site *Spec) BiosFileSearch() string

Lookup bios config file path for this site

func (*Spec) CrAnnotationSearch

func (site *Spec) CrAnnotationSearch(kind string, action string) (map[string]string, bool)

Lookup a specific CR Annotation for this site

func (*Spec) CrTemplateSearch

func (site *Spec) CrTemplateSearch(kind string) (string, bool)

Lookup a specific CR template for this site

type SshPrivateKeySecretRef

type SshPrivateKeySecretRef struct {
	Name string `yaml:"name"`
}

SshPrivateKeySecretRef

type TPM2Config

type TPM2Config struct {
	PCRList string `yaml:"pcrList" json:"pcrList"`
}

type TangConfig

type TangConfig struct {
	URL        string `yaml:"url" json:"url"`
	Thumbprint string `yaml:"thumbprint" json:"thp"`
}

Jump to

Keyboard shortcuts

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