util

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClusterID

func ClusterID(group, cluster string) string

ClusterID return a cluster identifier for group and cluster name

func ClusterPath

func ClusterPath(group, cluster string) string

ClusterPath return the canonical path for a cluster given the group and name for the cluster

func GroupFromConfig

func GroupFromConfig(groupName string, path string) (v1alpha1.Group, error)

groupFromConfig return a Group struct if a group with groupName is found inside the configuration at path. Will return an error if the file cannot be read or groupName is not found

func InitializeConfiguration

func InitializeConfiguration(name, path string) error

InitializeConfiguration will create an empty configuration file at path and then create all the folder structure

func ReadConfig

func ReadConfig(configPath string) (*v1alpha1.ClustersConfiguration, error)

ReadConfig reads a configuration file into a ClustersConfiguration struct

func SyncDirectories

func SyncDirectories(config v1alpha1.ConfigSpec, path string) error

SyncDirectories will create all the folders and kustomization files needed by the config data, it will leave alone already present file in the custom-resources folder if they already exists, it will override everything else

func ValidateContextPath

func ValidateContextPath(contextPath string) (string, error)

ValidateContextPath will validate contextPath that is a valid existing path, and that is a directory it will also return the path in absolute form

func VendoredAddOnPath

func VendoredAddOnPath(packageName string) string

VendoredAddOnPath return a vendored path for addon with packageName

func VendoredModulePath

func VendoredModulePath(packageName string) string

VendoredModulePath return a vendored path for module with packageName

func WriteKustomizationData

func WriteKustomizationData(path string, writer io.Writer) error

WriteKustomizationData read kustomize configuration file at path and output the kustomize build result to writer

Types

type ConfigFlags

type ConfigFlags struct {
	ConfigPath *string
	Verbose    *int
}

func NewConfigFlags

func NewConfigFlags() *ConfigFlags

func (*ConfigFlags) AddFlags

func (f *ConfigFlags) AddFlags(flags *pflag.FlagSet)

Jump to

Keyboard shortcuts

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