helper

package
v1.2.47-rc3 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 21 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 CreatePEMCertificate

func CreatePEMCertificate() (string, error)

Create a PEM Certificate Code taken from https://shaneutt.com/blog/golang-ca-and-signed-cert-go/

func CreateTempFileWithContent

func CreateTempFileWithContent(fileContent string) (string, error)

func CreateTempFileWithPrefixAndContent

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

func CreateTempOCMConfig

func CreateTempOCMConfig() (string, error)

func ExtractAWSCmdsForClusterCreation

func ExtractAWSCmdsForClusterCreation(bf bytes.Buffer) []string

Extract aws commands to create AWS resource promted by rosacli, this function supports to parse bellow commands `rosa create cluster --mode manual --sts /--hosted-cp`

func ExtractCommandsFromOIDCRegister

func ExtractCommandsFromOIDCRegister(bf bytes.Buffer) []string

func ExtractCommandsToCreateAWSResoueces

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

func ExtractCommandsToDeleteAWSResoueces(bf bytes.Buffer) []string

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

func ExtractCommandsToDeleteAccountRoles

func ExtractCommandsToDeleteAccountRoles(bf bytes.Buffer) []string

Extract aws command to delete account roles in manual mode

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 ExtractOIDCProviderFromOidcUrl

func ExtractOIDCProviderFromOidcUrl(urlString string) (string, error)

Extract oidc provider from the 'OIDC Endpoint URL' field of `rosa describe cluster`

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

func GenerateRandomStringWithSymbols(length int) string

func GetConsoleUrlBasedOnEnv

func GetConsoleUrlBasedOnEnv(ocmApi string) string

func ParseCommaSeparatedStrings

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

func ParseCommandToArgs

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

func ParseIssuerURLFromCommand(command string) string

func ParseLabels

func ParseLabels(labels string) []string

func ParseRoleARN

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

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

func ParseSecretArnFromOutput

func ParseSecretArnFromOutput(output string) string

func ParseTagsFronJsonOutput

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

func ParseTaints

func ParseTaints(taints string) []string

func ParseTuningConfigs

func ParseTuningConfigs(tuningConfigs string) []string

func ParseVersion

func ParseVersion(version string) (major, minor, optional int, err error)

Extract the major, minor,optional parts from the version strings Major.Minor.Optional-<suffix>,

func RandomInt

func RandomInt(max int) int

func ReadENVWithDefaultValue

func ReadENVWithDefaultValue(envName string, fallback string) string

func ReadFileContent

func ReadFileContent(fileAbsPath string) (string, error)

Read file content to a string

func RemoveFromStringSlice

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

func ReplaceCommaSpaceWithComma

func ReplaceCommaSpaceWithComma(sourceValue string) string

func ReplaceCommaWithCommaSpace

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

func SplitMajorVersion(openshiftVersion string) string

func TrimNameByLength

func TrimNameByLength(name string, length int) string

func UniqueStringValues

func UniqueStringValues(slice []string) []string

Types

This section is empty.

Jump to

Keyboard shortcuts

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