utils

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package utils provides all the helper functions needed vab's commands

Index

Constants

View Source
const (
	DefaultConfigFilename = "config.yaml"
	DefaultOutputDir      = "outputs"
	ClustersDirName       = "clusters"
	AllGroupsDirPath      = "clusters/all-groups"
	VendorsModulesPath    = "vendors/modules"
	VendorsAddOnsPath     = "vendors/addons"
	BasesDir              = "bases"
	CustomResourcesDir    = "custom-resources"
)

Variables

This section is empty.

Functions

func BuildPaths

func BuildPaths(configPath string, groupName string, clusterName string) ([]string, error)

BuildPaths returns a list of clusters paths based on configPath configuration selected by groupName and optionally by clusterName

func EmptyComponent

func EmptyComponent() kustomize.Kustomization

EmptyKustomization return a valid empty kustomization with valid kind and apiVersion fields

func EmptyKustomization

func EmptyKustomization() kustomize.Kustomization

EmptyKustomization return a valid empty kustomization with valid kind and apiVersion fields

func NewWrongFileNameError

func NewWrongFileNameError(expected string, actual string) error

func ReadConfig

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

ReadConfig reads a configuration file into a ClustersConfiguration struct

func ValidatePath

func ValidatePath(targetPath string) error

ValidatePath checks if the path exists and creates it eventually

func WriteConfig

func WriteConfig(config v1alpha1.ClustersConfiguration, dirOrFilePath string) error

WriteConfig creates and writes an empty vab configuration file

func WriteKustomization

func WriteKustomization(kustomization kustomize.Kustomization, dirOrFilePath string) error

WriteKustomization creates and writes an empty kustomization file

Types

type WrongFileNameError

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

func (WrongFileNameError) Error

func (e WrongFileNameError) Error() string

Jump to

Keyboard shortcuts

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