Documentation ¶
Index ¶
- func ConvertDeployments(data []byte) ([]appsv1.Deployment, error)
- func ConvertReleaseName(data []byte) (string, error)
- func ConvertStatefulSet(data []byte) ([]appsv1.StatefulSet, error)
- func ConvertStatus(data []byte) (bool, error)
- func GetInClusterConfig() (*rest.Config, error)
- type Agent
- type AgentAction
- type Args
- type DefaultAgent
- type ReleaseNotFoundError
- type Result
- type ResultType
- type ResultTypeError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertDeployments ¶ added in v0.6.0
func ConvertDeployments(data []byte) ([]appsv1.Deployment, error)
ConvertDeployments returns the Deployments from this result
func ConvertReleaseName ¶ added in v0.8.6
ConvertReleaseName returns the ReleaseName from this result
func ConvertStatefulSet ¶ added in v0.6.0
func ConvertStatefulSet(data []byte) ([]appsv1.StatefulSet, error)
ConvertStatefulSet returns the StatefulSets from this result
func ConvertStatus ¶ added in v0.6.0
ConvertStatus returns the status from this result
func GetInClusterConfig ¶ added in v0.6.0
GetInClusterConfig gets the rest config for this cluster
Types ¶
type Agent ¶
type Agent interface { GetDeployments(args *Args) (*Result, error) GetReleaseName(args *Args) (*Result, error) GetStatefulSets(args *Args) (*Result, error) GetStatus(args *Args) (*Result, error) }
Agent is used for communication with Kubernetes, made into an interface for testability
type AgentAction ¶ added in v0.6.0
type AgentAction string
AgentAction is an enum/alias to make calling methods typed
const ( // GetDeployments represents the GetDeployments method GetDeployments AgentAction = "GetDeployments" // GetReleaseName represents the GetReleaseName method GetReleaseName AgentAction = "GetReleaseName" // GetStatefulSets represents the GetStatefulSets method GetStatefulSets AgentAction = "GetStatefulSets" // GetStatus represents the GetStatus method GetStatus AgentAction = "GetStatus" )
type Args ¶ added in v0.6.0
Args are arguments common to all commands
func ConvertArgs ¶ added in v0.6.0
ConvertArgs converts byte data back to args
type DefaultAgent ¶
type DefaultAgent struct {
// contains filtered or unexported fields
}
DefaultAgent is the default implementation of the KubeAgent
func NewDefaultAgent ¶ added in v0.6.0
func NewDefaultAgent(kubeFunc func() (kubernetes.Interface, error)) *DefaultAgent
NewDefaultAgent inits the default agent with the specified kube interface
func (DefaultAgent) GetDeployments ¶ added in v0.6.0
func (k DefaultAgent) GetDeployments(args *Args) (*Result, error)
GetDeployments gets all the deployments for a particular cluster
func (DefaultAgent) GetReleaseName ¶ added in v0.8.6
func (k DefaultAgent) GetReleaseName(args *Args) (*Result, error)
GetReleaseName name gets a helm release name from the annotation meta.helm.sh/release-name based on label selectors
func (DefaultAgent) GetStatefulSets ¶ added in v0.6.0
func (k DefaultAgent) GetStatefulSets(args *Args) (*Result, error)
GetStatefulSets gets all the statefulsets for a particular cluster
type ReleaseNotFoundError ¶ added in v0.8.6
type ReleaseNotFoundError struct{}
ReleaseNotFoundError represents an error when searching for a result name but none is found
func (ReleaseNotFoundError) Error ¶ added in v0.8.6
func (err ReleaseNotFoundError) Error() string
type Result ¶ added in v0.6.0
type Result struct { Data interface{} Type ResultType }
Result is the type this agent returns
type ResultType ¶ added in v0.6.0
type ResultType string
ResultType represents types to convert for this response
const ( // DeploymentsResult represents a result of Deployments DeploymentsResult ResultType = "DeploymentsResult" // ReleaseNameResult represents a helm release name lookup ReleaseNameResult ResultType = "ReleaseNameResult" // StatefulSetsResult represents a result of StatefulSets StatefulSetsResult ResultType = "StatefulSetsResult" // StatusResult represents a Status result StatusResult ResultType = "StatusResult" )
type ResultTypeError ¶ added in v0.6.0
type ResultTypeError struct{}
ResultTypeError is an eror when the wrong type conversion is made with a result
func (ResultTypeError) Error ¶ added in v0.6.0
func (err ResultTypeError) Error() string