Documentation ¶
Index ¶
- Variables
- func CheckWithRegex(pattern, name string) bool
- func GenerateRandomRouteName(componentName string) string
- func GenerateUniqueHashForWorkloadImageTag(namespace string) string
- func GetIntValue(intPtr *int) int
- func GetMappedGitOpsComponent(component appstudiov1alpha1.Component, ...) gitopsgenv1alpha1.GeneratorOptions
- func GetRandomString(n int, lower bool) string
- func ProcessGitOpsStatus(gitopsStatus appstudiov1alpha1.GitOpsStatus, gitToken string) (string, string, string, error)
- func RemoveStrFromList(str string, strList []string) []string
- func SanitizeName(name string) string
- func StrInList(str string, strList []string) bool
- func ValidateEndpoint(endpoint string) error
- func ValidateGithubURL(URL string) error
Constants ¶
This section is empty.
Variables ¶
var RevisionHistoryLimit = int32(0)
Functions ¶
func CheckWithRegex ¶
CheckWithRegex checks if a name matches the pattern. If a pattern fails to compile, it returns false
func GenerateRandomRouteName ¶
GenerateRandomRouteName returns a random, trimmed route name based on the Component name based on the following criteria 1. Under 30 characters 2. Contains 4 random characters
func GenerateUniqueHashForWorkloadImageTag ¶
GenerateUniqueHashForWorkloadImageTag generates a unique hash from the namespace in order to not expose user's username via namespace of a particular resource potentially.
func GetIntValue ¶
GetIntValue returns the value of an int pointer, with the default of 0 if nil
func GetMappedGitOpsComponent ¶
func GetMappedGitOpsComponent(component appstudiov1alpha1.Component, kubernetesResources parser.KubernetesResources) gitopsgenv1alpha1.GeneratorOptions
GetMappedGitOpsComponent gets a mapped GeneratorOptions from the Component for GitOps resource generation
func GetRandomString ¶
GetRandomString returns a random string which is n characters long. If lower is set to true a lower case string is returned.
func ProcessGitOpsStatus ¶
func ProcessGitOpsStatus(gitopsStatus appstudiov1alpha1.GitOpsStatus, gitToken string) (string, string, string, error)
ProcessGitOpsStatus processes the GitOps status and returns the remote url, branch, context and the error
func RemoveStrFromList ¶
RemoveStrFromList removes the first occurence of str from the slice strList
func SanitizeName ¶
func ValidateEndpoint ¶
ValidateEndpoint validates if the endpoint url can be parsed and if it has a host and a scheme
func ValidateGithubURL ¶
ValidateGithubURL checks if the given url includes github in hostname In case of invalid url (not able to parse / not github) returns an error.
Types ¶
This section is empty.