Documentation ¶
Index ¶
- Variables
- func CreateProcessInstanceOnPartition(piCreator ProcessInstanceCreator, requiredPartition int32, ...) error
- func CreateZeebeClient(port int) (zbc.Client, error)
- func DeployChaosModels(client zbc.Client) error
- func DeployDifferentVersions(client zbc.Client, versions int32) error
- func DeployModel(client zbc.Client, fileName string) (int64, error)
- func DeployModelBytes(client zbc.Client, fileName string, bpmnBytes []byte) (int64, error)
- func ExtractPartitionIdFromKey(key int64) int32
- func FindCorrelationKeyForPartition(expectedPartition int, partitionsCount int) (string, error)
- func GetBrokerNodeId(zbClient zbc.Client, partitionId int, role string) (int32, error)
- func GetBrokerPodForNodeId(k8Client K8Client, brokerNodeId int32) (*v1.Pod, error)
- func GetBrokerPodForPartitionAndRole(k8Client K8Client, zbClient zbc.Client, partitionId int, role string) (*v1.Pod, error)
- func GetBrokerPodNameForPartitionAndRole(k8Client K8Client, zbClient zbc.Client, partitionId int, role string) (string, error)
- func GetTopology(zbClient zbc.Client) (*pb.TopologyResponse, error)
- func LogInfo(text string, a ...any)
- func LogVerbose(text string, a ...any)
- func MakeIpReachable(k8Client K8Client, podName string, ip string) error
- func MakeIpReachableForPod(k8Client K8Client, podName string) error
- func MakeIpUnreachableForPod(k8Client K8Client, podIp string, podName string) error
- func PutStressOnPod(k8Client K8Client, timeoutSec string, podName string, containerName string, ...) error
- func SendCountOfCommands(commandSender ZCCommandSender, countOfInstances int32, timeout time.Duration) error
- func SetInitContainerBlockFlag(k8Client K8Client, nodeId int, flag string) error
- type FakeActivateCommand
- type FakeClient
- func (f *FakeClient) BPMNProcessId(id string) commands.CreateInstanceCommandStep2
- func (f *FakeClient) JobKey(key int64) commands.CompleteJobCommandStep2
- func (f *FakeClient) JobType(jobType string) commands.ActivateJobsCommandStep2
- func (f *FakeClient) NewActivateJobsCommand() commands.ActivateJobsCommandStep1
- func (f *FakeClient) NewCompleteJobCommand() commands.CompleteJobCommandStep1
- func (f *FakeClient) NewCreateInstanceCommand() commands.CreateInstanceCommandStep1
- func (f *FakeClient) Send(ctx context.Context) (*pb.CreateProcessInstanceResponse, error)
- func (f *FakeClient) VariablesFromString(json string) (commands.CreateInstanceCommandStep3, error)
- func (f *FakeClient) Version(v int32) commands.CreateInstanceCommandStep3
- func (f *FakeClient) WithResult() commands.CreateInstanceWithResultCommandStep1
- type FakeCompleteCommand
- type FakeResultCommand
- type JobCompleteOptions
- type K8Client
- func (c K8Client) ApplyInitContainerPatch() error
- func (c K8Client) AwaitPodReadiness(podName string, timeout time.Duration) error
- func (c K8Client) AwaitReadiness() error
- func (c K8Client) AwaitReadinessWithTimeout(timeout time.Duration, tickTime time.Duration) error
- func (c K8Client) CreateWorkerDeployment(dockerImageTag string, pollingDelayMs int) error
- func (c K8Client) CreateWorkerDeploymentDefault() error
- func (c K8Client) DeletePvcOfBroker(podName string) error
- func (c K8Client) ExecuteCmdOnPod(cmd []string, pod string) error
- func (c K8Client) ExecuteCmdOnPodWriteIntoOutput(cmd []string, pod string, output io.Writer) error
- func (c K8Client) ExecuteCommandViaDebugContainer(podName string, containerName string, debugImage string, cmd []string) error
- func (c K8Client) GetBrokerPodNames() ([]string, error)
- func (c K8Client) GetBrokerPods() (*v1.PodList, error)
- func (c K8Client) GetCurrentNamespace() string
- func (c K8Client) GetGatewayPodNames() ([]string, error)
- func (c K8Client) GetGatewayPods() (*v1.PodList, error)
- func (c K8Client) GetVolume(podName string) (*v1.Volume, error)
- func (c K8Client) GetWorkerPods() (*v1.PodList, error)
- func (c K8Client) GetZeebeStatefulSet() (*v1.StatefulSet, error)
- func (c K8Client) MustGatewayPortForward(localPort int, remotePort int) (int, func())
- func (c K8Client) PauseReconciliation() error
- func (c K8Client) RestartPod(podName string) error
- func (c K8Client) RestartPodWithGracePeriod(podName string, gracePeriodSec *int64) error
- func (c K8Client) ResumeReconciliation() error
- func (c K8Client) ScaleZeebeCluster(replicas int) (int, error)
- func (c K8Client) TerminatePod(podName string) error
- type KubernetesSettings
- type ProcessInstanceCreationOptions
- type ProcessInstanceCreator
- type StressType
- type ZCCommandSender
Constants ¶
This section is empty.
Variables ¶
var JsonLogger zerolog.Logger
var JsonLogging bool
JsonLogging defines whether the logging should be structured json logging
var LoggingContext map[string]interface{}
var Verbosity = false
Verbosity defines whether the functions should print verbose output
Functions ¶
func CreateProcessInstanceOnPartition ¶
func CreateProcessInstanceOnPartition(piCreator ProcessInstanceCreator, requiredPartition int32, timeout time.Duration) error
func DeployChaosModels ¶
func DeployDifferentVersions ¶
func DeployModelBytes ¶
func GetBrokerNodeId ¶
func GetBrokerPodForNodeId ¶
func GetTopology ¶
func GetTopology(zbClient zbc.Client) (*pb.TopologyResponse, error)
func LogVerbose ¶
func MakeIpReachableForPod ¶
func MakeIpUnreachableForPod ¶
func PutStressOnPod ¶
func SendCountOfCommands ¶
func SendCountOfCommands(commandSender ZCCommandSender, countOfInstances int32, timeout time.Duration) error
func SetInitContainerBlockFlag ¶
If the flag set to true, init container will be caught in a loop and prevents the start up of the zeebe broker. When the flag is set to false, init container exits and zeebe broker will be restarted.
Types ¶
type FakeActivateCommand ¶
type FakeActivateCommand struct { commands.ActivateJobsCommandStep2 commands.ActivateJobsCommandStep3 commands.DispatchActivateJobsCommand // contains filtered or unexported fields }
func (*FakeActivateCommand) MaxJobsToActivate ¶
func (f *FakeActivateCommand) MaxJobsToActivate(maxActivate int32) commands.ActivateJobsCommandStep3
type FakeClient ¶
type FakeClient struct { zbc.Client commands.CreateInstanceCommandStep1 commands.CreateInstanceCommandStep2 commands.CreateInstanceCommandStep3 commands.DispatchCreateInstanceCommand commands.ActivateJobsCommandStep1 commands.CompleteJobCommandStep1 // contains filtered or unexported fields }
Fake implementation of the Zeebe client.
Can be used for unit tests to verify whether the right properties are set. Should be continously extended to increase test coverage.
func (*FakeClient) BPMNProcessId ¶
func (f *FakeClient) BPMNProcessId(id string) commands.CreateInstanceCommandStep2
func (*FakeClient) JobKey ¶
func (f *FakeClient) JobKey(key int64) commands.CompleteJobCommandStep2
func (*FakeClient) JobType ¶
func (f *FakeClient) JobType(jobType string) commands.ActivateJobsCommandStep2
func (*FakeClient) NewActivateJobsCommand ¶
func (f *FakeClient) NewActivateJobsCommand() commands.ActivateJobsCommandStep1
func (*FakeClient) NewCompleteJobCommand ¶
func (f *FakeClient) NewCompleteJobCommand() commands.CompleteJobCommandStep1
func (*FakeClient) NewCreateInstanceCommand ¶
func (f *FakeClient) NewCreateInstanceCommand() commands.CreateInstanceCommandStep1
func (*FakeClient) Send ¶
func (f *FakeClient) Send(ctx context.Context) (*pb.CreateProcessInstanceResponse, error)
func (*FakeClient) VariablesFromString ¶
func (f *FakeClient) VariablesFromString(json string) (commands.CreateInstanceCommandStep3, error)
func (*FakeClient) Version ¶
func (f *FakeClient) Version(v int32) commands.CreateInstanceCommandStep3
func (*FakeClient) WithResult ¶
func (f *FakeClient) WithResult() commands.CreateInstanceWithResultCommandStep1
type FakeCompleteCommand ¶
type FakeCompleteCommand struct { commands.CompleteJobCommandStep2 commands.DispatchCompleteJobCommand }
func (*FakeCompleteCommand) Send ¶
func (f *FakeCompleteCommand) Send(ctx context.Context) (*pb.CompleteJobResponse, error)
type FakeResultCommand ¶
type FakeResultCommand struct { commands.CreateInstanceWithResultCommandStep1 commands.DispatchCreateInstanceWithResultCommand }
func (*FakeResultCommand) Send ¶
func (f *FakeResultCommand) Send(ctx context.Context) (*pb.CreateProcessInstanceWithResultResponse, error)
type JobCompleteOptions ¶
type JobCompleteOptions struct {
JobType string
}
type K8Client ¶
type K8Client struct { ClientConfig clientcmd.ClientConfig DynamicClient dynamic.Interface Clientset kubernetes.Interface SaaSEnv bool }
func CreateK8Client ¶
Creates a kubernetes client, based on the local kubeconfig
func (K8Client) ApplyInitContainerPatch ¶
Used for dataloss simulation test, to restrict when a deleted zeebe broker is restarted.
This add an InitContainer to zeebe pods. The init container is blocked in an infinite loop, until the value of `block_{node_id}` in the config map is set to false. To restrict when a deleted pod is restarted, first update the configmap and set the respective `block_{node_id}` true. Then delete the pod. Once it is time to restart the pod, update the config map to set the `block_{nodeId}` to false. The updated config map will be eventually (usually with in a minute) by the init container and breaks out of the loop. The init container exits and the zeebe container will be started.
func (K8Client) AwaitPodReadiness ¶
func (K8Client) AwaitReadiness ¶
func (K8Client) AwaitReadinessWithTimeout ¶
func (K8Client) CreateWorkerDeployment ¶
func (K8Client) CreateWorkerDeploymentDefault ¶
func (K8Client) DeletePvcOfBroker ¶
func (K8Client) ExecuteCmdOnPodWriteIntoOutput ¶
func (K8Client) ExecuteCommandViaDebugContainer ¶
func (K8Client) GetBrokerPodNames ¶
func (K8Client) GetCurrentNamespace ¶
Returns the current namespace, defined in the kubeconfig
func (K8Client) GetGatewayPodNames ¶
func (K8Client) GetZeebeStatefulSet ¶
func (c K8Client) GetZeebeStatefulSet() (*v1.StatefulSet, error)
func (K8Client) MustGatewayPortForward ¶
MustGatewayPortForward creates a port forwarding to a zeebe gateway with the given port. Panics when port forwarding fails. localPort can be 0 to let the OS choose a random, free port. Returns the exposed local port and a function to close the port forwarding.
https://github.com/gruntwork-io/terratest/blob/master/modules/k8s/tunnel.go#L187-L196 https://github.com/kubernetes/client-go/issues/51#issuecomment-436200428
func (K8Client) PauseReconciliation ¶
func (K8Client) RestartPod ¶
func (K8Client) RestartPodWithGracePeriod ¶
func (K8Client) ResumeReconciliation ¶
func (K8Client) ScaleZeebeCluster ¶
ScaleZeebeCluster Scales the StatefulSet for Zeebe. Waits until scaling is complete before returning the initial scale.
func (K8Client) TerminatePod ¶
type KubernetesSettings ¶
type KubernetesSettings struct {
// contains filtered or unexported fields
}
type ProcessInstanceCreator ¶
func CreateProcessInstanceCreator ¶
func CreateProcessInstanceCreator(zbClient zbc.Client, options ProcessInstanceCreationOptions) (ProcessInstanceCreator, error)
type StressType ¶
type ZCCommandSender ¶
func CreateJobCompleter ¶
func CreateJobCompleter(zbClient zbc.Client, options JobCompleteOptions) (ZCCommandSender, error)