common

package
v1.2.43 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendToStringSliceIfNotExist

func AppendToStringSliceIfNotExist(slice []string, value string) []string

func AssertWaitPollNoErr

func AssertWaitPollNoErr(e error, msg string)

func AssertWaitPollWithErr

func AssertWaitPollWithErr(e error, msg string)

func CreateFileWithContent

func CreateFileWithContent(fileAbsPath string, content interface{}) (string, error)

Write string to a file

func CreateTempFileWithContent

func CreateTempFileWithContent(fileContent string) (string, error)

func CreateTempFileWithPrefixAndContent

func CreateTempFileWithPrefixAndContent(prefix string, fileContent string) (string, error)

func CreateTempOCMConfig added in v1.2.41

func CreateTempOCMConfig() (string, error)

func ExtractCommandsFromOIDCRegister added in v1.2.43

func ExtractCommandsFromOIDCRegister(bf bytes.Buffer) []string

func ExtractCommandsToCreateAWSResoueces added in v1.2.43

func ExtractCommandsToCreateAWSResoueces(bf bytes.Buffer) []string

Extract aws commands to create AWS resource promted by rosacli, this function supports to parse bellow commands `rosa create account-role --mode manual` `rosa create operator-roles --mode manual` `rosa create oidc-provider --mode manual`

func ExtractCommandsToDeleteAWSResoueces added in v1.2.43

func ExtractCommandsToDeleteAWSResoueces(bf bytes.Buffer) []string

Extract aws commands to create AWS resource promted by rosacli, this function supports to parse bellow commands `rosa create operator-roles --mode manual` `rosa create oidc-provider --mode manual`

func ExtractOIDCProviderARN

func ExtractOIDCProviderARN(output string) string

Extract the oidc provider ARN from the output of `rosa create oidc-config --mode auto` and also for common message containing the arn

func ExtractOIDCProviderIDFromARN

func ExtractOIDCProviderIDFromARN(arn string) string

Extract the oidc provider ARN from the output of `rosa create oidc-config --mode auto` and also for common message containing the arn

func GenerateHtpasswdPair

func GenerateHtpasswdPair(user string, pass string) (string, string, string, error)

Generate htpasspwd key value pair, return with a string

func GenerateMultipleHtpasswdPairs

func GenerateMultipleHtpasswdPairs(pairNum int) ([]string, error)

generate Htpasswd user-password Pairs

func GenerateRandomName

func GenerateRandomName(prefix string, n int) string

func GenerateRandomString

func GenerateRandomString(length int) string

Generate random string

func GenerateRandomStringWithSymbols added in v1.2.39

func GenerateRandomStringWithSymbols(length int) string

func ParseCommaSeparatedStrings

func ParseCommaSeparatedStrings(input string) (output []string)

func ParseCommandToArgs added in v1.2.43

func ParseCommandToArgs(command string) []string

Parse command string to args array. NOTE:If the flag value contains spaces, put the whole value into the array

func ParseIssuerURLFromCommand added in v1.2.43

func ParseIssuerURLFromCommand(command string) string

func ParseLabels

func ParseLabels(labels string) []string

func ParseRoleARN added in v1.2.41

func ParseRoleARN(arn string) (string, string, error)

Function to parse the ARN of a role, return rolePath,roleName and err

func ParseSecretArnFromOutput added in v1.2.43

func ParseSecretArnFromOutput(output string) string

func ParseTagsFronJsonOutput added in v1.2.40

func ParseTagsFronJsonOutput(tags string) map[string]interface{}

func ParseTaints

func ParseTaints(taints string) []string

func ParseTuningConfigs

func ParseTuningConfigs(tuningConfigs string) []string

func RandomInt added in v1.2.42

func RandomInt(max int) int

func ReadENVWithDefaultValue added in v1.2.39

func ReadENVWithDefaultValue(envName string, fallback string) string

func ReadFileContent added in v1.2.38

func ReadFileContent(fileAbsPath string) (string, error)

Read file content to a string

func RemoveFromStringSlice

func RemoveFromStringSlice(slice []string, value string) []string

func ReplaceCommaSpaceWithComma added in v1.2.40

func ReplaceCommaSpaceWithComma(sourceValue string) string

func ReplaceCommaWithCommaSpace added in v1.2.39

func ReplaceCommaWithCommaSpace(sourceValue string) string

func SliceContains

func SliceContains(slice []string, value string) bool

func SplitARNResources

func SplitARNResources(v string) []string

Split resources from the aws arn

func SplitMajorVersion added in v1.2.39

func SplitMajorVersion(openshiftVersion string) string

func TrimNameByLength added in v1.2.39

func TrimNameByLength(name string, length int) string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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