condition

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrWrongConfig is returned when a condition spec has missing attributes which are mandatory
	ErrWrongConfig = errors.New("wrong condition configuration")
)

Functions

This section is empty.

Types

type Condition

type Condition struct {
	// Result stores the condition result after a condition run.
	Result string
	// Config defines condition input parameters
	Config Config
	Scm    *scm.ScmHandler
}

Condition defines which condition needs to be met in order to update targets based on the source output

func (*Condition) Run

func (c *Condition) Run(source string) (err error)

Run tests if a specific condition is true

type Config

type Config struct {
	resource.ResourceConfig `yaml:",inline,omitempty"`
	// ! Deprecated in favor of sourceID
	DeprecatedSourceID string `yaml:"sourceID,omitempty" jsonschema:"-"`
	// sourceid specifies which "source", based on its ID, is used to retrieve the default value.
	SourceID string `yaml:",omitempty"`
	// disablesourceinput disable the mechanism to retrieve a default value from a source.
	DisableSourceInput bool `yaml:",omitempty"`
}

Config defines conditions input parameters

func (Config) JSONSchema added in v0.23.0

func (c Config) JSONSchema() *jschema.Schema

JSONSchema implements the json schema interface to generate the "condition" jsonschema.

func (*Config) Validate added in v0.23.0

func (c *Config) Validate() error

Jump to

Keyboard shortcuts

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