openshift

package
v0.0.0-...-eb664fc Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2016 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnexpectedReadyStatus = errors.New("Unexpected status field in \"Ready\" condition")
	ErrNoReadyCondition      = errors.New("Node did not report readiness")
	ErrEC2LookupFailed       = errors.New("Failed to look up node info in EC2")
	ErrBadCaCert             = errors.New("Failed to load CA certificate")
)

Functions

func Create

func Create(svc *ec2.EC2, raw yaml.MapSlice) (commonlib.Checker, error)

Types

type Node

type Node interface {
	Info() *NodeInfo
}

This interface annoys me, but I can't see a way to get a decent representation of both a node in a multi-node response and the one node in a single-node response without removing Kind from NodeResponse. Which I don't want to do, since it acts as a sort of sanity check.

type NodeCheck

type NodeCheck struct {
	ConsecutiveFailures int
	CheckedAt           time.Time
}

type NodeCondition

type NodeCondition struct {
	Status             string `json:"status"`
	LastTransitionTime string `json:"lastTransitionTime"`
	Reason             string `json:"reason"`
	LastHeartbeatTime  string `json:"lastHeartbeatTime"`
	Message            string `json:"message"`
	Type               string `json:"type"`
}

type NodeInfo

type NodeInfo struct {
	Metadata NodeMetadata `json:"metadata"`
	Status   NodeStatus   `json:"status"`
}

func (*NodeInfo) Info

func (self *NodeInfo) Info() *NodeInfo

type NodeListResponse

type NodeListResponse struct {
	Kind  string     `json:"kind"`
	Items []NodeInfo `json:"items"`
}

type NodeMatcher

type NodeMatcher struct {
	EC2NamePrefix string            `yaml:"name_prefix,omitempty"`
	Labels        map[string]string `yaml:"labels,omitempty"`
}

type NodeMetadata

type NodeMetadata struct {
	Name   string            `json:"name"`
	Labels map[string]string `json:"labels"`
}

Since we don't need much of the data from the response, these structures don't represent the full JSON

type NodeResponse

type NodeResponse struct {
	Kind     string       `json:"kind"`
	Metadata NodeMetadata `json:"metadata"`
	Status   NodeStatus   `json:"status"`
}

func (*NodeResponse) Info

func (self *NodeResponse) Info() *NodeInfo

type NodeStatus

type NodeStatus struct {
	Conditions []NodeCondition `json:"conditions"`
}

type OpenShiftChecker

type OpenShiftChecker struct {
	AccessToken      string        `yaml:"token"`
	Host             string        `yaml:"host"`
	Port             int           `yaml:"port"`
	CaCertFile       string        `yaml:"ca_cert_file"`
	NodeMatchers     []NodeMatcher `yaml:"node_matchers"`
	Testing          TestingConfig `yaml:"testing"`
	Simulate         bool          `yaml:"simulate"`
	RestartTimeout   int           `yaml:"restart_timeout"`
	FailureThreshold int           `yaml:"failure_threshold"`
	// contains filtered or unexported fields
}

func (*OpenShiftChecker) Execute

func (self *OpenShiftChecker) Execute(logger *log.Entry)

func (*OpenShiftChecker) GetStatus

func (self *OpenShiftChecker) GetStatus() (bool, string)

func (*OpenShiftChecker) Validate

func (self *OpenShiftChecker) Validate() error

type TestingConfig

type TestingConfig struct {
	ForceNotReady []string `yaml:"force_not_ready"`
}

Jump to

Keyboard shortcuts

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