Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder returns a new instance of builder
func BuilderForObject ¶
BuilderForObject returns a new instance of builder when a patch obj and patch type is given
func BuilderForRuntask ¶
func BuilderForRuntask(context, templateYaml string, templateValues map[string]interface{}) *Builder
BuilderForRuntask returns a new instance of builder for runtask when a runtask patch yaml is given
func (*Builder) AddCheck ¶
AddCheck adds the predicate as a condition to be validated against the patch instance
func (*Builder) AddCheckf ¶
AddCheckf adds the predicate as a condition to be validated against the patch instance and format the message string according to format specifier. If only predicate and message string is provided, it will treat it as the value for the corresponding predicate.
type Patch ¶
type Patch struct { // Type determines the type of patch to be applied Type types.PatchType `json:"type"` // object determines the actual patch object // in json format Object []byte `json:"object"` }
Patch will consist of patch that gets applied against a particular resource
func (*Patch) IsValidType ¶
IsValidType returns true if provided patch type is one of the valid patch types
type PatchType ¶
type PatchType string
PatchType is a custom type that holds the patch type
const ( // PatchTypeJSON refers to a generic json patch type that is understood // by Kubernetes API as well PatchTypeJSON PatchType = "json" // PatchTypeMerge refers to a generic json merge patch type that is // understood by Kubernetes API as well PatchTypeMerge PatchType = "merge" // PatchTypeStrategic refers to a patch type that is understood // by Kubernetes API only PatchTypeStrategic PatchType = "strategic" )
type Predicate ¶
Predicate abstracts conditional logic w.r.t the patch instance
NOTE: Predicate is a functional approach versus traditional approach to mix conditions such as *if-else* within blocks of business logic
NOTE: Predicate approach enables clear separation of conditionals from imperatives i.e. actions that form the business logic
func IsValidType ¶
func IsValidType() Predicate
IsValidType returns a predicate for checking valid patch type