helpers

package
v1.7.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPodNotRunning           = errors.New("pod did not reach Running state")
	ErrPodNoIP                 = errors.New("pod has no IP address assigned")
	ErrPodNoEth1IP             = errors.New("pod has no eth1 IP address (delegated subnet not configured?)")
	ErrPodContainerNotReady    = errors.New("pod container not ready")
	ErrMTPNCStuckDeletion      = errors.New("MTPNC resources should have been deleted but were found")
	ErrPodDeletionFailed       = errors.New("pod still exists after deletion attempts")
	ErrPNIDeletionFailed       = errors.New("PodNetworkInstance still exists after deletion attempts")
	ErrPNDeletionFailed        = errors.New("PodNetwork still exists after deletion attempts")
	ErrNamespaceDeletionFailed = errors.New("namespace still exists after deletion attempts")
)

Functions

func DeleteNamespace

func DeleteNamespace(kubeconfig, namespace string) error

DeleteNamespace deletes a namespace and waits for it to be removed

func DeletePod

func DeletePod(kubeconfig, namespace, podName string) error

DeletePod deletes a pod in the specified namespace and waits for it to be fully removed

func DeletePodNetwork

func DeletePodNetwork(kubeconfig, pnName string) error

func DeletePodNetworkInstance

func DeletePodNetworkInstance(kubeconfig, namespace, pniName string) error

func EnsureNamespaceExists

func EnsureNamespaceExists(kubeconfig, namespace string) error

EnsureNamespaceExists checks if a namespace exists and creates it if it doesn't

func ExecInPod

func ExecInPod(kubeconfig, namespace, podName, command string) (string, error)

ExecInPod executes a command in a pod and returns the output

func GetClusterNodes

func GetClusterNodes(kubeconfig string) ([]string, error)

GetClusterNodes returns a slice of node names from a cluster using the given kubeconfig

func GetPodDelegatedIP

func GetPodDelegatedIP(kubeconfig, namespace, podName string) (string, error)

GetPodDelegatedIP retrieves the eth1 IP address (delegated subnet IP) of a pod This is the IP used for cross-VNet communication and is subject to NSG rules

func GetPodIP

func GetPodIP(kubeconfig, namespace, podName string) (string, error)

GetPodIP retrieves the IP address of a pod

func GetSubnetARMID

func GetSubnetARMID(rg, vnet, subnet string) (string, error)

func GetSubnetGUID

func GetSubnetGUID(rg, vnet, subnet string) (string, error)

func GetVnetGUID

func GetVnetGUID(rg, vnet string) (string, error)

func VerifyNoMTPNC

func VerifyNoMTPNC(kubeconfig, buildID string) error

VerifyNoMTPNC checks if there are any pending MTPNC (MultiTenantPodNetworkConfig) resources associated with a specific build ID that should have been cleaned up

func WaitForPodRunning

func WaitForPodRunning(kubeconfig, namespace, podName string, maxRetries, sleepSeconds int) error

WaitForPodRunning waits for a pod to reach Running state with retries

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL