Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplyInput ¶ added in v0.2.0
type ApplyOutput ¶ added in v0.2.0
type Applyinator ¶
type Applyinator struct {
// contains filtered or unexported fields
}
func NewApplyinator ¶
func (*Applyinator) Apply ¶
func (a *Applyinator) Apply(ctx context.Context, input ApplyInput) (ApplyOutput, error)
Apply accepts a context, calculated plan, a bool to indicate whether to run the onetime instructions, the existing onetimeinstruction output, and an input byte slice which is a base64+gzip json-marshalled map of PeriodicInstructionOutput entries where the key is the PeriodicInstructionOutput.Name. It outputs a revised versions of the existing outputs, and if specified, runs the one time instructions. Notably, ApplyOutput.OneTimeApplySucceeded will be false if ApplyInput.RunOneTimeInstructions is false
type CalculatedPlan ¶
CalculatedPlan is passed into Applyinator and is a Plan with checksum calculated
func CalculatePlan ¶
func CalculatePlan(rawPlan []byte) (CalculatedPlan, error)
type CommonInstruction ¶ added in v0.2.0
type File ¶
type File struct {
Content string `json:"content,omitempty"`
Directory bool `json:"directory,omitempty"`
UID int `json:"uid,omitempty"`
GID int `json:"gid,omitempty"`
Path string `json:"path,omitempty"`
Permissions string `json:"permissions,omitempty"` // internally, the string will be converted to a uint32 to satisfy os.FileMode
Action string `json:"action,omitempty"`
}
Path would be `/etc/kubernetes/ssl/ca.pem`, Content is base64 encoded. If Directory is true, then we are creating a directory, not a file
type OneTimeInstruction ¶ added in v0.2.0
type OneTimeInstruction struct {
CommonInstruction
SaveOutput bool `json:"saveOutput,omitempty"`
}
type PeriodicInstruction ¶ added in v0.2.0
type PeriodicInstruction struct {
CommonInstruction
PeriodSeconds int `json:"periodSeconds,omitempty"` // default 600, i.e. 10 minutes
SaveStderrOutput bool `json:"saveStderrOutput,omitempty"`
}
type PeriodicInstructionOutput ¶ added in v0.2.0
type PeriodicInstructionOutput struct {
Name string `json:"name"`
Stdout []byte `json:"stdout"` // Stdout is a byte array of the gzip+base64 stdout output
Stderr []byte `json:"stderr"` // Stderr is a byte array of the gzip+base64 stderr output
ExitCode int `json:"exitCode"` // ExitCode is an int representing the exit code of the last run instruction
LastSuccessfulRunTime string `json:"lastSuccessfulRunTime"` // LastSuccessfulRunTime is a time.UnixDate formatted string of the last successful time (exit code 0) the instruction was run
Failures int `json:"failures"` // Failures is the number of time the periodic instruction has failed to run
LastFailedRunTime string `json:"lastFailedRunTime"` // LastFailedRunTime is a time.UnixDate formatted string of the time that the periodic instruction started failing
}
type Plan ¶
type Plan struct {
Files []File `json:"files,omitempty"`
OneTimeInstructions []OneTimeInstruction `json:"instructions,omitempty"`
Probes map[string]prober.Probe `json:"probes,omitempty"`
PeriodicInstructions []PeriodicInstruction `json:"periodicInstructions,omitempty"`
}