Documentation
¶
Index ¶
- Variables
- func CreateAllScenarios(testScenarios TestScenarios) error
- func CreateNamespaceResource(kubeconfig, namespace string) error
- func CreatePod(kubeconfig string, data PodData, templatePath string) error
- func CreatePodNetwork(kubeconfig string, data PodNetworkData, templatePath string) error
- func CreatePodNetworkInstance(kubeconfig string, data PNIData, templatePath string) error
- func CreatePodNetworkInstanceResource(resources TestResources) error
- func CreatePodNetworkResource(resources TestResources) error
- func CreatePodResource(resources TestResources, podName, nodeName string) error
- func CreateScenarioResources(scenario PodScenario, testScenarios TestScenarios) error
- func DeleteAllScenarios(testScenarios TestScenarios) error
- func DeleteScenarioResources(scenario PodScenario, buildID string) error
- func DeleteTestResources(kubeconfig, pnName, pniName string) error
- func ExecInPodWithTimeout(kubeconfig, namespace, podName, command string, timeout time.Duration) (string, error)
- func GenerateStorageSASToken(storageAccountName, containerName, blobName string) (string, error)
- func GetStoragePrivateEndpoint(storageAccountName string) (string, error)
- func RunConnectivityTest(test ConnectivityTest) error
- func RunPrivateEndpointTest(test ConnectivityTest) error
- type ConnectivityTest
- type NodePoolInfo
- type PNIData
- type PodData
- type PodNetworkData
- type PodScenario
- type TestResources
- type TestScenarios
- type VnetSubnetInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoLowNICNodes = errors.New("no low-NIC nodes available") ErrNoHighNICNodes = errors.New("no high-NIC nodes available") ErrAllLowNICNodesInUse = errors.New("all low-NIC nodes already in use") ErrAllHighNICNodesInUse = errors.New("all high-NIC nodes already in use") ErrFailedToGenerateSASToken = errors.New("failed to generate SAS token") ErrSASTokenEmpty = errors.New("generated SAS token is empty") ErrSASTokenInvalid = errors.New("generated SAS token appears invalid") ErrPodNotRunning = errors.New("pod is not running") ErrHTTPAuthError = errors.New("HTTP authentication error from private endpoint") ErrBlobNotFound = errors.New("blob not found (404) on private endpoint") ErrUnexpectedBlobResponse = errors.New("unexpected response from blob download (no 'Hello' or '200 OK' found)") ErrInvalidWorkloadType = errors.New("invalid workload type") ErrUnexpectedTCPResponse = errors.New("unexpected TCP response") )
Functions ¶
func CreateAllScenarios ¶
func CreateAllScenarios(testScenarios TestScenarios) error
func CreateNamespaceResource ¶
func CreatePodNetwork ¶
func CreatePodNetwork(kubeconfig string, data PodNetworkData, templatePath string) error
func CreatePodNetworkInstanceResource ¶
func CreatePodNetworkInstanceResource(resources TestResources) error
func CreatePodNetworkResource ¶
func CreatePodNetworkResource(resources TestResources) error
func CreatePodResource ¶
func CreatePodResource(resources TestResources, podName, nodeName string) error
func CreateScenarioResources ¶
func CreateScenarioResources(scenario PodScenario, testScenarios TestScenarios) error
func DeleteAllScenarios ¶
func DeleteAllScenarios(testScenarios TestScenarios) error
func DeleteScenarioResources ¶
func DeleteScenarioResources(scenario PodScenario, buildID string) error
func DeleteTestResources ¶
func ExecInPodWithTimeout ¶
func GenerateStorageSASToken ¶
func RunConnectivityTest ¶
func RunConnectivityTest(test ConnectivityTest) error
RunConnectivityTest tests TCP connectivity between two pods using netcat
func RunPrivateEndpointTest ¶
func RunPrivateEndpointTest(test ConnectivityTest) error
Types ¶
type ConnectivityTest ¶
type ConnectivityTest struct {
Name string
SourcePod string
SourceNamespace string // Namespace of the source pod
DestinationPod string
DestNamespace string // Namespace of the destination pod
Cluster string // Cluster where source pod is running (for backward compatibility)
DestCluster string // Cluster where destination pod is running (if different from source)
Description string
ShouldFail bool // If true, connectivity is expected to fail (NSG block, customer isolation)
// Fields for private endpoint tests
SourceCluster string // Cluster where source pod is running
SourcePodName string // Name of the source pod
SourceNS string // Namespace of the source pod
DestEndpoint string // Destination endpoint (IP or hostname)
TestType string // Type of test: "pod-to-pod" or "storage-access"
Purpose string // Description of the test purpose
}
ConnectivityTest defines a connectivity test between two pods
type NodePoolInfo ¶
func GetNodesByNicCount ¶
func GetNodesByNicCount(kubeconfig string) (NodePoolInfo, error)
type PodNetworkData ¶
type PodScenario ¶
type PodScenario struct {
Name string // Descriptive name for the scenario
Cluster string // "aks-1" or "aks-2"
VnetName string // e.g., "cx_vnet_v1", "cx_vnet_v4"
SubnetName string // e.g., "s1", "s2"
NodeSelector string // "low-nic" or "high-nic"
PodNameSuffix string // Unique suffix for pod name
}
type TestResources ¶
type TestScenarios ¶
type TestScenarios struct {
ResourceGroup string
BuildID string
PodImage string
Scenarios []PodScenario
VnetSubnetCache map[string]VnetSubnetInfo
UsedNodes map[string]bool
}
type VnetSubnetInfo ¶
type VnetSubnetInfo struct {
VnetGUID string
SubnetGUID string
SubnetARMID string
SubnetToken string
}
func GetOrFetchVnetSubnetInfo ¶
func GetOrFetchVnetSubnetInfo(rg, vnetName, subnetName string, cache map[string]VnetSubnetInfo) (VnetSubnetInfo, error)
Click to show internal directories.
Click to hide internal directories.