utils

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

View Source
const PROMPT_END = ": "

Variables

View Source
var VOLUMES = map[string]string{
	"var-lib-cobbler":     "/var/lib/cobbler",
	"var-pgsql":           "/var/lib/pgsql",
	"var-cache":           "/var/cache",
	"var-spacewalk":       "/var/spacewalk",
	"var-log":             "/var/log",
	"srv-salt":            "/srv/salt",
	"srv-www-pub":         "/srv/www/htdocs/pub",
	"srv-www-cobbler":     "/srv/www/cobbler",
	"srv-www-osimages":    "/srv/www/os-images",
	"srv-tftpboot":        "/srv/tftpboot",
	"srv-formulametadata": "/srv/formula_metadata",
	"srv-pillar":          "/srv/pillar",
	"srv-susemanager":     "/srv/susemanager",
	"srv-spacewalk":       "/srv/spacewalk",
	"root":                "/root",
	"etc-apache2":         "/etc/apache2",
	"etc-rhn":             "/etc/rhn",
	"etc-systemd":         "/etc/systemd/system/multi-user.target.wants",
	"etc-salt":            "/etc/salt",
	"etc-tomcat":          "/etc/tomcat",
	"etc-cobbler":         "/etc/cobbler",
	"etc-sysconfig":       "/etc/sysconfig",
	"etc-tls":             "/etc/pki/tls",
	"ca-cert":             "/etc/pki/trust/anchors/",
}

This map should match the volumes mapping from the container definition in both the helm chart and the systemctl services definitions

Functions

func AskIfMissing

func AskIfMissing(viper *viper.Viper, key string, prompt string)

func AskPasswordIfMissing

func AskPasswordIfMissing(viper *viper.Viper, key string, prompt string)

func Contains

func Contains(slice []string, needle string) bool

func Copy

func Copy(globalFlags *types.GlobalFlags, src string, dst string, user string, group string)

Copy transfers a file to or from the container. Prefix one of src or dst parameters with `server:` to designate the path is in the container user and group parameters are used to set the owner of a file transfered in the container.

func Exec

func Exec(globalFlags *types.GlobalFlags, interactive bool, tty bool, env []string, args ...string)

func GetCommand

func GetCommand() string

func GetLocalTimezone

func GetLocalTimezone() string

Get the timezone set on the machine running the tool

func GetPodName

func GetPodName(fail bool) (string, string)

func ReadConfig

func ReadConfig(configPath string, configFilename string, cmd *cobra.Command) *viper.Viper

func RunCmd

func RunCmd(command string, args []string, errMessage string, verbose bool)

func WaitForServer

func WaitForServer()

WaitForServer waits at most 60s for multi-user systemd target to be reached.

Types

This section is empty.

Jump to

Keyboard shortcuts

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