utils

package
v0.0.0-...-bb25da9 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TRIPLEO_ANSIBLE_INVENTORY_YAML string = "tripleo-ansible-inventory.yaml"
	OVERCLOUD_EXPORT               string = "overcloud-export.yaml"
	OVERCLOUD_PASSWORDS            string = "overcloud-passwords.yaml"
	GLOBAL_VARS                    string = "config-download/overcloud/global_vars.yaml"
	TRIPLEO_OVERCLOUD_NETWORK_DATA string = "tripleo-overcloud-network-data.yaml"
	BAREMETAL_DEPLOY               string = "tripleo-overcloud-baremetal-deployment.yaml"
	DEPLOY_STEPS_ONE               string = "config-download/overcloud/external_deploy_steps_tasks_step1.yaml"
)

Variables

This section is empty.

Functions

func GetFullPath

func GetFullPath(fileName string) string

func GetFuncMap

func GetFuncMap() template.FuncMap

func GetTripleoOvercloudNetworkData

func GetTripleoOvercloudNetworkData() ([]map[string]interface{}, error)

func IpOffset

func IpOffset(cidr netip.Prefix, offset int) (netip.Addr, error)

func MarshalArray

func MarshalArray[T any](mapInput interface{}, things *[]T)

func ProcessTemplate

func ProcessTemplate(templateFile string, name string, funcMap template.FuncMap, data interface{}) (*bytes.Buffer, error)

func ReadRhosoConfig

func ReadRhosoConfig(path string) error

func SearchFile

func SearchFile(targetFileName string) (string, error)

func SetRootDir

func SetRootDir(dir string)

func StructToJson

func StructToJson(obj interface{}) ([]byte, error)

func StructToYaml

func StructToYaml(obj interface{}) ([]byte, error)

func StructToYamlK8s

func StructToYamlK8s(obj interface{}) ([]byte, error)

func WalkDir

func WalkDir(dirname string)

func WriteByteData

func WriteByteData(buf []byte, dir string, fileName string) error

func YamlToList

func YamlToList(filename string) ([]map[string]interface{}, error)

func YamlToMap

func YamlToMap(filename string) (map[string]interface{}, error)

func YamlToStruct

func YamlToStruct[T any](filename string, obj *T) error

Types

type RhosoConfig

type RhosoConfig struct {
	WorkerNodes    WorkerNodes `yaml:"worker_nodes"`
	ControllerRole string      `yaml:"controller_role,omitempty"`
}

func GetConfig

func GetConfig() RhosoConfig

type WorkerNodes

type WorkerNodes struct {
	Names     []string `yaml:"names"`
	Interface string   `yaml:"interface"`
}

Jump to

Keyboard shortcuts

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