Documentation ¶
Index ¶
- Variables
- func Age(t *metav1.Time, c clockwork.Clock) string
- func CamelCasit(s string) string
- func CleanKubernetesName(s string) string
- func CleanValueKubernetes(s string) string
- func ConditionEmoji(c knative1.Conditions) string
- func ConditionSad(c knative1.Conditions) string
- func Duration(t1, t2 *metav1.Time) string
- func GetRepoOwnerFromURL(ghURL string) (string, error)
- func GetRepoOwnerSplitted(u string) (string, string, error)
- func PRDuration(runStatus v1alpha1.RepositoryRunStatus) string
- func PipelineRunStatus(pr *tektonv1.PipelineRun) string
- func SanitizeBranch(s string) string
- func ShortSHA(sha string) string
- func ShowLastAge(repository v1alpha1.Repository, cw clockwork.Clock) string
- func ShowLastSHA(repository v1alpha1.Repository) string
- func ShowStatus(repository v1alpha1.Repository, cs *cli.ColorScheme) string
- func Timeout(t *metav1.Duration) string
- type MessageTemplate
Constants ¶
This section is empty.
Variables ¶
var PipelineRunStatusText string
var QueuingPipelineRunText string
var StartingPipelineRunText string
Functions ¶
func CleanKubernetesName ¶ added in v0.21.5
func CleanValueKubernetes ¶ added in v0.18.0
CleanValueKubernetes k8s do not like slash in labels value and on push we have the full ref, we replace the "/" by "-". The tools probably need to be aware of it when querying.
valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')
func ConditionEmoji ¶
func ConditionEmoji(c knative1.Conditions) string
func ConditionSad ¶ added in v0.12.0
func ConditionSad(c knative1.Conditions) string
func GetRepoOwnerFromURL ¶
func PRDuration ¶ added in v0.13.0
func PRDuration(runStatus v1alpha1.RepositoryRunStatus) string
PRDuration calculates the duration of a repository run, given its status. It takes a RepositoryRunStatus object as input. It returns a string with the duration of the run, or nonAttributedStr if the run has not started or completed.
func PipelineRunStatus ¶
func PipelineRunStatus(pr *tektonv1.PipelineRun) string
PipelineRunStatus return status of PR success failed or skipped
func SanitizeBranch ¶
SanitizeBranch remove refs/heads from string, only removing the first prefix in case we have branch that are actually called refs-heads 🙃
func ShowLastAge ¶
func ShowLastAge(repository v1alpha1.Repository, cw clockwork.Clock) string
func ShowLastSHA ¶
func ShowLastSHA(repository v1alpha1.Repository) string
func ShowStatus ¶
func ShowStatus(repository v1alpha1.Repository, cs *cli.ColorScheme) string
Types ¶
type MessageTemplate ¶ added in v0.22.0
type MessageTemplate struct { PipelineRunName string Namespace string NamespaceURL string ConsoleName string ConsoleURL string TknBinary string TknBinaryURL string TaskStatus string FailureSnippet string }
func (MessageTemplate) MakeTemplate ¶ added in v0.22.0
func (mt MessageTemplate) MakeTemplate(tmpl string) (string, error)