package
0.0.0-20241104161355-939959eb3a81
Repository: https://github.com/uyuni-project/uyuni-tools.git
Documentation: pkg.go.dev

# Functions

AddBackendFlag add the flag for setting the backend ('podman', 'podman-remote', 'kubectl').
AddFlagHelpGroup adds a new flags group.
AddFlagsToHelpGroupID adds several flags to a group.
AddFlagToHelpGroupID adds a flag to a group.
AddPTFFlag add PTF flag to a command.
AddPullPolicyFlag adds the --pullPolicy flag to a command.
AddUninstallFlags adds the common flags for uninstall commands.
AskIfMissing asks for a value if missing.
AskPasswordIfMissing asks for password if missing.
AskPasswordIfMissingOnce asks for password if missing only once Don't perform any check if min and max are set to 0.
CheckValidPassword performs check to a given password.
CommandExists checks if cmd exists in $PATH.
CommandHelper parses the configuration file into the flags and runs the fn function.
CompareVersion compare the server image version and the server deployed version.
ComputeImage assembles the container image from its name and tag.
ComputePTF returns a PTF or Test image from registry.suse.com.
Contains returns true if a string is contained in a string slice.
ContainsUpperCase check if string contains an uppercase character.
CreateSupportConfigTarball will create a tarball in outputFolder with all the supportconfig * files generated by host and pods.
DownloadFile downloads from a remote path to a local file.
Errorf helps providing consistent errors.
ExtractTarGz extracts a tar.gz file to dstPath.
FileExists check if path exists.
GetConfigHelpCommand provides a help command describing the config file and environment variables.
GetContainersFromSystemdFiles parse a string of systemdfile and return a list of containers.
GetEnvironmentVarsList returns list of environmental variables to be passed to exec.
GetFileBoolean gets the value of a file containing a boolean.
GetFqdn returns and checks the FQDN of the host system.
GetLocalizedUsageTemplate provides the help template, but localized.
GetLocalTimezone returns the timezone set on the current machine.
GetRandomBase64 generates random base64-encoded data.
GetSupportConfigFileSaveName returns the support config file name.
GetSupportConfigPath returns the support config tarball path.
GetURLBody provide the body content of an GET HTTP request.
GetUserConfigDir returns the user configuration directory.
IsEmptyDirectory return true if a given directory is empty.
IsInstalled checks if a tool is in the path.
IsValidFQDN returns an error if the argument is not a valid FQDN.
IsWellFormedFQDN returns an false if the argument is not a well formed FQDN.
JoinErrors aggregate multiple multiple errors into one.
LogInit initialize logs.
MarkMandatoryFlags ensures that the specified flags are marked as required for the given command.
NewPortMap is a constructor for PortMap type.
NewServerInspector creates a new ServerInspector generating the inspection script and data in scriptDir.
NewTarGz create a targz object with writers opened.
ReadConfig parse configuration file and env variables a return parameters.
ReadFile returns the content of a file and exit if there was an error.
ReadInspectData returns an unmarshalled object of type T from the data file.
RemoveDirectory remove a given directory.
RemoveRegistryFromImage removes registry fqdn from image path.
RunCmd execute a shell command.
RunCmdOutput execute a shell command and collects output.
RunCmdStdMapping execute a shell command mapping the stdout and stderr.
RunSupportConfigOnHost will run supportconfig command on host machine.
SaveBinaryData saves binary data to a file.
SetLogLevel sets the loglevel.
TempDir creates a temporary directory.
UninstallFile uninstalls a file.
WriteTemplateToFile writes a template to a file.
YesNo asks a question in CLI.

# Constants

FlagHelpGroupAnnotation is an annotation to store the flag group to.
GlobalConfigFilename is the path for the global configuration.
InspectContainerDirectory represents the directory and the basename where the inspect values are stored.
InspectScriptFilename is the inspect script basename.
KubernetesBuilt is a flag for compiling kubernetes code.

# Variables

DebugPorts are the port used by dev for debugging applications.
DefaultHelmRegistry represents the default name used for helm charts.
DefaultPullPolicy represents the default pull policy used for image.
DefaultRegistry represents the default name used for container image.
DefaultTag represents the default tag used for image.
EtcServerVolumeMounts represents volumes mounted in /etc folder.
EtcServerVolumes represents volumes used for configuration.
HubXmlrpcPorts are the tcp ports required by the Hub XMLRPC API service.
HubXmlrpcVolumeMounts represents volumes used by Hub Xmlrpc container.
LocaleRoot is the default path where to look for locale files.
PgsqlRequiredVolumeMounts represents volumes mount used by PostgreSQL.
PgsqlRequiredVolumes represents volumes used by PostgreSQL.
ProxyHttpdVolumes volumes used by HTTPD in proxy.
ProxyPodmanPorts are the http/s ports required by the proxy.
ProxySquidVolumes volumes used by Squid in proxy.
ProxyTCPPorts are the tcp ports required by the proxy.
ProxyTftpdVolumes used by TFTP in proxy.
ServerVolumeMounts should match the volumes mapping from the container definition in both the helm chart and the systemctl services definitions.
ServerVolumes match the volume with Persistent Volume Claim.
TCPPodmanPorts are the tcp ports required by the server on podman.
TCPPorts are the tcp ports required by the server The port names should be less than 15 characters long and lowercased for traefik to eat them.
UDPPorts are the udp ports required by the server.
Version is the tools version.

# Structs

BaseInspector is offering the basic implementation for the Inspector interface.
CommonInspectData are data common between the migration source inspect and server inspector results.
Group Structure to manage groups for commands.
InspectResult holds the results of the inspection scripts.
OutputLogWriter contains information output the logger and the loglevel.
PurgeFlags defined what has te be removed in an uninstall command.
ServerInspectData are the data extracted by a server inspector.
ServerInspector inspects a running server container or its image.
TarGz holds a .tar.gz to write it to a file.
UninstallFlags are the common flags for uninstall commands.
UyuniConsoleWriter parses the JSON input and writes it in an (optionally) colorized, human-friendly format to Out.
UyuniLogger is an io.WriteCloser that writes to the specified filename.

# Interfaces

Inspector implementations can generate a inspection script and parse its results.
Template is an interface for implementing Render function.

# Type aliases

CommandFunc is a function to be executed by a Cobra command.
FlagsUpdaterFunc is a function to be executed to update the flags from the viper instance used to parsed the config.