util

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindFlags

func BindFlags(o *zap.Options, fs *flag.FlagSet)

BindFlags custom flags

func Condition

func Condition(c v1beta1.Conditions) (status ci.State)

Condition returns a kubernetes State

func GetCILabels

func GetCILabels(p *ci.Play) map[string]string

GetCILabels return CI label

func GetCINamespacedName

func GetCINamespacedName(prefix string, play *ci.Play) types.NamespacedName

GetCINamespacedName return CI namespacedName

func GetCINamespacedName2 added in v0.1.7

func GetCINamespacedName2(prefix string, play *ci.Play) types.NamespacedName

GetCINamespacedName2 return CI namespacedName

func GetDeployNamespacedName

func GetDeployNamespacedName(prefix string, play *ci.Play) types.NamespacedName

GetDeployNamespacedName return CI namespacedName

func GetDockerImageTag

func GetDockerImageTag(play *ci.Play) (*url.URL, error)

GetDockerImageTag return the URL of the Docker repository

func GetDockerImageTagRaw

func GetDockerImageTagRaw(play *ci.Play) (address string, uri string, tag string, err error)

GetDockerImageTagRaw return the Docker repository

func GetObjectContain

func GetObjectContain(obj runtime.Object) string

GetObjectContain ...

func IgnoreNotExists

func IgnoreNotExists(err error) error

IgnoreNotExists returns nil on NotExist errors. All other values that are not NotExist errors or nil are returned unmodified.

func InNamespace

func InNamespace(play *ci.Play) client.InNamespace

func IsBuildStage

func IsBuildStage(play *ci.Play) bool

IsBuildStage check whether the stage is build or not

func IsPipelineRunning

func IsPipelineRunning(pr tkn.PipelineRun) bool

IsPipelineRunning return whether or not the pipeline is running

func JsonEncoderConfig

func JsonEncoderConfig() zapcore.EncoderConfig

JsonEncoderConfig returns an opinionated EncoderConfig

func LookupEnvOrBool added in v0.3.0

func LookupEnvOrBool(key string, defaultVal bool) bool

LookupEnvOrBool adds the capability to get env instead of param flag

func LookupEnvOrString added in v0.3.0

func LookupEnvOrString(key string, defaultVal string) string

LookupEnvOrString adds the capability to get env instead of param flag

func Message added in v0.4.0

func Message(c v1beta1.Conditions) string

Message returns a kubernetes Message

func ParseHostURL

func ParseHostURL(host string) (*url.URL, error)

ParseHostURL parses a url string, validates the string is a host url, and returns the parsed URL

func TextEncoderConfig

func TextEncoderConfig() zapcore.EncoderConfig

TextEncoderConfig returns an opinionated EncoderConfig

Types

type ConfigFlag added in v0.9.3

type ConfigFlag struct {
	// contains filtered or unexported fields
}

func (ConfigFlag) Set added in v0.9.3

func (f ConfigFlag) Set(flagValue string) error

func (ConfigFlag) String added in v0.9.3

func (f ConfigFlag) String() string

type LevelFlag added in v0.9.3

type LevelFlag struct {
	ZapOptions *zap.Options
	// contains filtered or unexported fields
}

LevelFlag contains structure for managing zap level

func (LevelFlag) Set added in v0.9.3

func (l LevelFlag) Set(flagValue string) error

func (LevelFlag) String added in v0.9.3

func (l LevelFlag) String() string

type OutputFormatFlag added in v0.9.3

type OutputFormatFlag struct {
	ZapOptions *zap.Options
	// contains filtered or unexported fields
}

OutputFormatFlag contains structure for managing zap encoding

func (*OutputFormatFlag) Set added in v0.9.3

func (o *OutputFormatFlag) Set(flagValue string) error

func (*OutputFormatFlag) String added in v0.9.3

func (o *OutputFormatFlag) String() string

Jump to

Keyboard shortcuts

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