Documentation
¶
Overview ¶
Package check contains the check functions to test the network commands.
Index ¶
- Constants
- func ExecCurl(ctx context.Context, pod *corev1.Pod, clset *kubernetes.Clientset, ...) (ok bool, err error)
- func ExecNetcatTCPConnect(ctx context.Context, pod *corev1.Pod, clset *kubernetes.Clientset, ...) (ok bool, err error)
- func ForgePodTargetForConsumer(ctx context.Context, cl *client.Client, totalReplicas int32, target Targets) error
- func ForgePodTargetForProvider(ctx context.Context, cl *client.Client, name string, totalReplicas int32, ...) error
- func GetLocalIPRemapped(ctx context.Context, cl *client.Client) (map[string]string, error)
- func GetNodeAddress(node *corev1.Node) string
- func InitClientSet(cfg *rest.Config) (*kubernetes.Clientset, error)
- func PrintCheckResults(successCount, errorCount int32, logger *pterm.Logger)
- func RunCheckExternalToNodePortServiceWithClient(ctx context.Context, cl ctrlclient.Client, opts *flags.Options, ...) (successCount, errorCount int32, err error)
- func RunCheckPodToClusterIPService(ctx context.Context, cl *client.Client, cfg client.Configs, ...) (successCount, errorCount int32, err error)
- func RunCheckToTargets(ctx context.Context, cl ctrlclient.Client, cfg *rest.Config, ...) (successCount, errorCount int32, err error)
- func RunChecks(ctx context.Context, cl *client.Client, cfg client.Configs, ...) error
- func RunChecksNodeToPod(ctx context.Context, cl *client.Client, cfg client.Configs, ...) (successCount, errorCount int32, err error)
- func RunChecksPodToExternal(ctx context.Context, cl *client.Client, cfg client.Configs, ...) (successCount, errorCount int32, err error)
- func RunChecksPodToExternalRemappedIP(ctx context.Context, cl *client.Client, cfg client.Configs, ...) (successCount, errorCount int32, err error)
- func RunChecksPodToPod(ctx context.Context, cl *client.Client, cfg client.Configs, ...) (successCount, errorCount int32, err error)
- func RunsCheckExternalToLoadBalancerService(ctx context.Context, cl *client.Client, opts *flags.Options, totreplicas int32) (successCountTot, errorCountTot int32, err error)
- func RunsCheckExternalToLoadBalancerServiceWithClient(ctx context.Context, cl ctrlclient.Client, opts *flags.Options, ...) (successCount, errorCount int32, err error)
- func RunsCheckExternalToNodePortService(ctx context.Context, cl *client.Client, opts *flags.Options, totreplicas int32) (successCountTot, errorCountTot int32, err error)
- func RunsCheckPodToNodePortService(ctx context.Context, cl *client.Client, cfg client.Configs, ...) (successCountTot, errorCountTot int32, err error)
- func RunsCheckPodToNodePortServiceWithClient(ctx context.Context, cl ctrlclient.Client, cfg client.Configs, ...) (successCount, errorCount int32, err error)
- type ExecFunc
- type Targets
Constants ¶
const MaxRetries = 10
MaxRetries is the maximum number of retries for the command.
Variables ¶
This section is empty.
Functions ¶
func ExecCurl ¶
func ExecCurl(ctx context.Context, pod *corev1.Pod, clset *kubernetes.Clientset, cfg *rest.Config, quiet bool, endpoint string, logger *pterm.Logger) (ok bool, err error)
ExecCurl executes a curl command.
func ExecNetcatTCPConnect ¶
func ExecNetcatTCPConnect(ctx context.Context, pod *corev1.Pod, clset *kubernetes.Clientset, cfg *rest.Config, quiet bool, endpoint string, logger *pterm.Logger) (ok bool, err error)
ExecNetcatTCPConnect executes a netcat command.
func ForgePodTargetForConsumer ¶
func ForgePodTargetForConsumer(ctx context.Context, cl *client.Client, totalReplicas int32, target Targets) error
ForgePodTargetForConsumer creates a target for the consumer cluster.
func ForgePodTargetForProvider ¶
func ForgePodTargetForProvider(ctx context.Context, cl *client.Client, name string, totalReplicas int32, target Targets) error
ForgePodTargetForProvider creates a target for a specific cluster.
func GetLocalIPRemapped ¶
GetLocalIPRemapped gets the local IP remapped for the consumer and the providers.
func GetNodeAddress ¶
GetNodeAddress returns the address of the node.
func InitClientSet ¶
func InitClientSet(cfg *rest.Config) (*kubernetes.Clientset, error)
InitClientSet initializes the clientset.
func PrintCheckResults ¶
PrintCheckResults prints the check results.
func RunCheckExternalToNodePortServiceWithClient ¶
func RunCheckExternalToNodePortServiceWithClient(ctx context.Context, cl ctrlclient.Client, opts *flags.Options, totreplicas int32, httpclient *client.HTTPClient) (successCount, errorCount int32, err error)
RunCheckExternalToNodePortServiceWithClient runs all the checks from the external to the node port service.
func RunCheckPodToClusterIPService ¶
func RunCheckPodToClusterIPService(ctx context.Context, cl *client.Client, cfg client.Configs, opts *flags.Options, totreplicas int32) (successCount, errorCount int32, err error)
RunCheckPodToClusterIPService runs all the checks from the pod to the cluster IP service.
func RunCheckToTargets ¶
func RunCheckToTargets(ctx context.Context, cl ctrlclient.Client, cfg *rest.Config, opts *flags.Options, owner string, targets []string, hostnetwork bool, execFunc ExecFunc) (successCount, errorCount int32, err error)
RunCheckToTargets runs the checks to the targets.
func RunChecks ¶
func RunChecks(ctx context.Context, cl *client.Client, cfg client.Configs, opts *flags.Options, totreplicas int32) error
RunChecks runs all the checks.
func RunChecksNodeToPod ¶
func RunChecksNodeToPod(ctx context.Context, cl *client.Client, cfg client.Configs, opts *flags.Options, totreplicas int32) (successCount, errorCount int32, err error)
RunChecksNodeToPod runs the checks from the nodes to the pods.
func RunChecksPodToExternal ¶
func RunChecksPodToExternal(ctx context.Context, cl *client.Client, cfg client.Configs, opts *flags.Options) (successCount, errorCount int32, err error)
RunChecksPodToExternal runs the checks from pod to an external target.
func RunChecksPodToExternalRemappedIP ¶
func RunChecksPodToExternalRemappedIP(ctx context.Context, cl *client.Client, cfg client.Configs, opts *flags.Options) (successCount, errorCount int32, err error)
RunChecksPodToExternalRemappedIP runs all the checks from the pod to the external remapped IP.
func RunChecksPodToPod ¶
func RunChecksPodToPod(ctx context.Context, cl *client.Client, cfg client.Configs, opts *flags.Options, totreplicas int32) (successCount, errorCount int32, err error)
RunChecksPodToPod runs the checks from the pods to the pods.
func RunsCheckExternalToLoadBalancerService ¶
func RunsCheckExternalToLoadBalancerService(ctx context.Context, cl *client.Client, opts *flags.Options, totreplicas int32) (successCountTot, errorCountTot int32, err error)
RunsCheckExternalToLoadBalancerService runs all the checks from the external to the load balancer service.
func RunsCheckExternalToLoadBalancerServiceWithClient ¶
func RunsCheckExternalToLoadBalancerServiceWithClient(ctx context.Context, cl ctrlclient.Client, opts *flags.Options, httpclient *client.HTTPClient, totreplicas int32) (successCount, errorCount int32, err error)
RunsCheckExternalToLoadBalancerServiceWithClient runs all the checks from the external to the load balancer service.
func RunsCheckExternalToNodePortService ¶
func RunsCheckExternalToNodePortService(ctx context.Context, cl *client.Client, opts *flags.Options, totreplicas int32) (successCountTot, errorCountTot int32, err error)
RunsCheckExternalToNodePortService runs all the checks from the external to the node port service.
func RunsCheckPodToNodePortService ¶
func RunsCheckPodToNodePortService(ctx context.Context, cl *client.Client, cfg client.Configs, opts *flags.Options, totreplicas int32) (successCountTot, errorCountTot int32, err error)
RunsCheckPodToNodePortService runs all the checks from the pod to the node port service.
func RunsCheckPodToNodePortServiceWithClient ¶
func RunsCheckPodToNodePortServiceWithClient(ctx context.Context, cl ctrlclient.Client, cfg client.Configs, opts *flags.Options, totreplicas int32, name string) (successCount, errorCount int32, err error)
RunsCheckPodToNodePortServiceWithClient runs all the checks from the pod to the node port service.
Types ¶
type ExecFunc ¶
type ExecFunc func(ctx context.Context, pod *corev1.Pod, clset *kubernetes.Clientset, cfg *rest.Config, quiet bool, endpoint string, logger *pterm.Logger) (ok bool, err error)
ExecFunc is the function to execute.
type Targets ¶
Targets ia a map where the key is the name of the provider/consumer and the values are the endpoints from their point of view.
func ForgeIPTargets ¶
ForgeIPTargets forges the IP targets for the consumer and the providers.