Documentation
¶
Index ¶
- func Checkout(gitHubOrg string, project string, branch string) (*git.Repository, error)
- func CheckoutPrevCommit(repo *git.Repository) (*plumbing.Reference, error)
- func CheckoutReference(repo *git.Repository, ref *plumbing.Reference) error
- func CreateNamespace(useInClusterConfig bool, namespace string) error
- func DoHelmUpgrade(project string, stage string) error
- func ExecuteCommand(command string, args []string) (string, error)
- func ExecuteCommandInDirectory(command string, args []string, directory string) (string, error)
- func ExistsNamespace(useInClusterConfig bool, namespace string) (bool, error)
- func ExpandTilde(fileName string) string
- func GetChart(project string, service string, stage string, chartName string, ...) (*chart.Chart, error)
- func GetClientset(useInClusterConfig bool) (*kubernetes.Clientset, error)
- func GetFiles(workingPath string, suffixes ...string) ([]string, error)
- func GetKeptnDirectory() (string, error)
- func GetKeptnDomain(useInClusterConfig bool) (string, error)
- func GetKubeAPI(useInClusterConfig bool) (v1.CoreV1Interface, error)
- func GetRenderedDeployments(ch *chart.Chart) ([]*appsv1.Deployment, error)
- func GetRenderedServices(ch *chart.Chart) ([]*corev1.Service, error)
- func IsDeployment(dpl *appsv1.Deployment) bool
- func IsService(svc *corev1.Service) bool
- func LoadChart(data []byte) (*chart.Chart, error)
- func LoadChartFromPath(path string) (*chart.Chart, error)
- func OpenWS(connData ConnectionData, apiEndPoint url.URL) (*websocket.Conn, *http.Response, error)
- func PackageChart(ch *chart.Chart) ([]byte, error)
- func RestartPodsWithSelector(useInClusterConfig bool, namespace string, selector string) error
- func ScaleDeployment(useInClusterConfig bool, deployment string, namespace string, replicas int32) error
- func StoreChart(project string, service string, stage string, chartName string, ...) error
- func UserHomeDir() string
- func ValidateKeptnEntityName(name string) bool
- func WaitForDeploymentToBeRolledOut(useInClusterConfig bool, deploymentName string, namespace string) error
- func WaitForDeploymentsInNamespace(useInClusterConfig bool, namespace string) error
- func WaitForPodsWithSelector(useInClusterConfig bool, namespace string, selector string, retries int, ...) error
- func WriteLog(ws *websocket.Conn, logData LogData, shkeptnContext string) error
- func WriteWSLog(ws *websocket.Conn, logEvent cloudevents.Event, message string, terminate bool, ...) error
- type CombinedLogger
- type ConnectionData
- type IncompleteCE
- type KeptnHandler
- type LogData
- type Logger
- type LoggerInterface
- type MyCloudEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckoutPrevCommit ¶
CheckoutPrevCommit moves the HEAD pointer to the previous commit. It returns the original HEAD.
func CheckoutReference ¶
CheckoutReference moves the HEAD pointer to the specified reference.
func CreateNamespace ¶ added in v0.6.0
CreateNamespace creates a new Kubernetes namespace with the provided name
func DoHelmUpgrade ¶
DoHelmUpgrade executes a helm update and upgrade
func ExecuteCommand ¶
ExecuteCommand exectues the command using the args
func ExecuteCommandInDirectory ¶
ExecuteCommandInDirectory executes the command using the args within the specified directory
func ExistsNamespace ¶ added in v0.6.0
ExistsNamespace checks whether a namespace with the provided name exists
func GetChart ¶
func GetChart(project string, service string, stage string, chartName string, configServiceURL string) (*chart.Chart, error)
GetChart reads the chart from the configuration service
func GetClientset ¶
func GetClientset(useInClusterConfig bool) (*kubernetes.Clientset, error)
GetClientset returns the kubernetes Clientset
func GetKeptnDirectory ¶
GetKeptnDirectory returns a path, which is used to store logs and possibly creds
func GetKeptnDomain ¶
GetKeptnDomain reads the configmap keptn-domain in namespace keptn and returns the contained app_domain
func GetKubeAPI ¶
func GetKubeAPI(useInClusterConfig bool) (v1.CoreV1Interface, error)
GetKubeAPI returns the CoreV1Interface
func GetRenderedDeployments ¶
func GetRenderedDeployments(ch *chart.Chart) ([]*appsv1.Deployment, error)
GetRenderedDeployments returns all deployments contained in the provided chart
func GetRenderedServices ¶
GetRenderedServices returns all services contained in the provided chart
func IsDeployment ¶
func IsDeployment(dpl *appsv1.Deployment) bool
IsDeployment tests whether the provided struct is a deployment
func LoadChartFromPath ¶
LoadChartFromPath loads a directory or Helm chart into a Chart
func PackageChart ¶
PackageChart packages the chart and returns it
func RestartPodsWithSelector ¶
RestartPodsWithSelector restarts the pods which are found in the provided namespace and selector
func ScaleDeployment ¶
func StoreChart ¶
func StoreChart(project string, service string, stage string, chartName string, helmChart []byte, configServiceURL string) error
StoreChart stores a chart in the configuration service
func UserHomeDir ¶
func UserHomeDir() string
UserHomeDir returns the HOME directory by taking into account the operating system
func ValidateKeptnEntityName ¶ added in v0.6.0
ValidateKeptnEntityName checks whether the provided name represents a valid project, service, or stage name
func WaitForDeploymentToBeRolledOut ¶
func WaitForDeploymentToBeRolledOut(useInClusterConfig bool, deploymentName string, namespace string) error
WaitForDeploymentToBeRolledOut waits until the deployment is Available
func WaitForDeploymentsInNamespace ¶
WaitForDeploymentsInNamespace waits until all deployments in a namespace are available
func WaitForPodsWithSelector ¶
func WriteWSLog ¶
func WriteWSLog(ws *websocket.Conn, logEvent cloudevents.Event, message string, terminate bool, logLevel string) error
WriteWSLog writes the log event to the websocket
Types ¶
type CombinedLogger ¶
type CombinedLogger struct {
// contains filtered or unexported fields
}
CombinedLogger logs messages to the logger as well as to the websocket
func NewCombinedLogger ¶
func NewCombinedLogger(logger *Logger, ws *websocket.Conn, shKeptnContext string) *CombinedLogger
NewCombinedLogger creates a new CombinedLogger which writes log messages to the logger as well as to the websocket
func (*CombinedLogger) Debug ¶
func (l *CombinedLogger) Debug(message string)
Debug logs a debug message
func (*CombinedLogger) Error ¶
func (l *CombinedLogger) Error(message string)
Error logs an error message
func (*CombinedLogger) Info ¶
func (l *CombinedLogger) Info(message string)
Info logs an info message
func (*CombinedLogger) Terminate ¶
func (l *CombinedLogger) Terminate()
Terminate sends a terminate message to the websocket
type ConnectionData ¶
type ConnectionData struct {
EventContext apimodels.EventContext `json:"eventContext"`
}
ConnectionData stores EventContext and Success data
type IncompleteCE ¶
type IncompleteCE struct {
ConnData ConnectionData `json:"data"`
}
IncompleteCE is a helper type for unmarshalling the CE data
type KeptnHandler ¶
type KeptnHandler struct {
ResourceHandler *utils.ResourceHandler
}
KeptnHandler provides an interface to keptn resources
func NewKeptnHandler ¶
func NewKeptnHandler(rh *utils.ResourceHandler) *KeptnHandler
NewKeptnHandler returns a new KeptnHandler instance
func (*KeptnHandler) GetShipyard ¶
func (k *KeptnHandler) GetShipyard(project string) (*models.Shipyard, error)
GetShipyard returns the shipyard definition of a project
type LogData ¶
type LogData struct { Message string `json:"message"` Terminate bool `json:"terminate"` LogLevel string `json:"loglevel"` }
LogData represents log data
type Logger ¶
type Logger struct { KeptnContext string `json:"keptnContext"` EventID string `json:"eventId"` ServiceName string `json:"keptnService"` }
Logger contains data for logging
type LoggerInterface ¶
LoggerInterface collects signatures of the logger
type MyCloudEvent ¶
type MyCloudEvent struct { SpecVersoin string `json:"specversion"` ContentType string `json:"contentType"` Data json.RawMessage `json:"data"` ID string `json:"id"` Time string `json:"time"` Type string `json:"type"` Source string `json:"source"` ShKeptnContext string `json:"shkeptncontext"` }
MyCloudEvent represents a keptn cloud event