Documentation
¶
Index ¶
- Constants
- Variables
- func CreateEvent(reason string, msg ActionMessage) (*corev1.Event, error)
- func ExecCommand(ctx context.Context, command []string, envs []string) (string, error)
- func GetAllEnvs(args map[string]any) []string
- func GetClientSet() (*kubernetes.Clientset, error)
- func SendEvent(ctx context.Context, event *corev1.Event) error
- func SentEventForProbe(ctx context.Context, msg ActionMessage) error
- type ActionMessage
- type CronJob
- type Executor
- type ExecutorImpl
- type HandlerSpec
- type MessageBase
- type RoleProbeMessage
Constants ¶
View Source
const ( OperationSuccess = "Success" OperationFailed = "Failed" KBAgentEventFieldPath = "spec.containers{kb-agent}" )
View Source
const ( JSONContentTypeHeader = "application/json" Version = "v1.0" Path = "/action" )
for http server
Variables ¶
View Source
var EventSendMaxAttempts = 30
View Source
var EventSendPeriod = 10 * time.Second
Functions ¶
func CreateEvent ¶
func CreateEvent(reason string, msg ActionMessage) (*corev1.Event, error)
func ExecCommand ¶
func GetAllEnvs ¶
func GetClientSet ¶
func GetClientSet() (*kubernetes.Clientset, error)
GetClientSet returns a kubernetes clientSet.
func SentEventForProbe ¶
func SentEventForProbe(ctx context.Context, msg ActionMessage) error
Types ¶
type ActionMessage ¶
type ActionMessage interface {
GetAction() string
}
type HandlerSpec ¶
type MessageBase ¶
type MessageBase struct {
Event string `json:"event,omitempty"`
Message string `json:"message,omitempty"`
Action string `json:"action,omitempty"`
}
func (MessageBase) GetAction ¶
func (m MessageBase) GetAction() string
type RoleProbeMessage ¶
type RoleProbeMessage struct {
MessageBase
Role string `json:"role,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.