Documentation ¶
Index ¶
- Constants
- func ConvertError(err error) error
- func GetClient(configPath string) (client *kubernetes.Clientset, config *rest.Config, err error)
- func IsClosedResponseBodyErrorMessage(err string) bool
- func IsStreamClosedError(err error) bool
- func Name(in string) (string, error)
- func Scope() (force.Group, error)
- type ApplyAction
- type Config
- type Namespace
- type NewApply
- type NewRun
- type Plugin
- type RunAction
- type Setup
Constants ¶
const ( // ActiveDeadlineSeconds is an active deadline for a job to run // 4 hours is default to avoid crashing jobs ActiveDeadlineSeconds = 60 * 60 * 4 // JobTTLSeconds is a default ttl for jobs, before they will be garbage // collected JobTTLSeconds = ActiveDeadlineSeconds * 2 // DefaultNamespace is a default kubernetes namespace DefaultNamespace = "default" KindJob = "Job" KindPod = "Pod" )
const ( // Key is a name of the github plugin variable Key = Namespace("kube") KeySetup = "Setup" KeyRun = "Run" KeyApply = "Apply" )
Variables ¶
This section is empty.
Functions ¶
func ConvertError ¶
ConvertError converts kubernetes client error to trace error
func GetClient ¶
GetClient returns instance of client to the kubernetes cluster using in-cluster configuration if available and falling back to configuration file under configPath otherwise
func IsClosedResponseBodyErrorMessage ¶
IsClosedResponseBodyErrorMessage determines if the error message describes a closed response body error
func IsStreamClosedError ¶
IsStreamClosedError determines if the given error is a response/stream closed error
Types ¶
type ApplyAction ¶
type ApplyAction struct {
// contains filtered or unexported fields
}
ApplyAction runs kubernetes job to it's completion
func (*ApplyAction) Eval ¶
func (r *ApplyAction) Eval(ctx force.ExecutionContext) (interface{}, error)
Eval creates or updates K8s object
func (*ApplyAction) MarshalCode ¶
func (s *ApplyAction) MarshalCode(ctx force.ExecutionContext) ([]byte, error)
MarshalCode marshals the action into code representation
type Config ¶
type Config struct { // Path is a path to kubernetes config file Path string }
Config specifies kube plugin configuration
func (*Config) CheckAndSetDefaults ¶
func (cfg *Config) CheckAndSetDefaults(ctx force.ExecutionContext) error
CheckAndSetDefaults checks and sets defaults
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin is a new plugin
type RunAction ¶
type RunAction struct {
// contains filtered or unexported fields
}
RunAction runs kubernetes job to it's completion
func (*RunAction) Eval ¶
func (r *RunAction) Eval(ctx force.ExecutionContext) (interface{}, error)
Eval runs kubernetes job
func (*RunAction) MarshalCode ¶
func (s *RunAction) MarshalCode(ctx force.ExecutionContext) ([]byte, error)
MarshalCode marshals the action into code representation
type Setup ¶
type Setup struct {
// contains filtered or unexported fields
}
Setup creates new plugins
func (*Setup) MarshalCode ¶
func (n *Setup) MarshalCode(ctx force.ExecutionContext) ([]byte, error)
MarshalCode marshals plugin to code representation
func (*Setup) NewInstance ¶
NewInstance returns a new kubernetes client bound to the process group and registers plugin within variable