Documentation ¶
Index ¶
- Constants
- Variables
- func AddConfigMap(client *k8sfake.Clientset)
- func AddDefaultIngressClass()
- func AddDefaultNamespace(ns ...string)
- func AddIngressClassWithName(name string)
- func AddMiddleware(exec InjectFault)
- func AddNamespace(t *testing.T, nsName string, labels map[string]string) error
- func AddSecret(secretName string, namespace string, cert string, key string)
- func AnnotateAKONamespaceWithInfraSetting(t *testing.T, ns, infraSettingName string)
- func ClearAllCache(cacheObj *cache.AviObjCache)
- func ConstructService(ns string, Name string, protocol corev1.Protocol, Type corev1.ServiceType, ...) *corev1.Service
- func CreateEP(t *testing.T, ns string, Name string, multiPort bool, multiAddress bool, ...)
- func CreateNode(t *testing.T, nodeName string, nodeIP string)
- func CreateOrUpdateLease(ns, podName string) error
- func CreateSVC(t *testing.T, ns string, Name string, protocol corev1.Protocol, ...)
- func CreateSVCWithValidOrInvalidLBClass(t *testing.T, ns string, Name string, protocol corev1.Protocol, ...)
- func CreateServiceWithSelectors(t *testing.T, ns string, Name string, protocol corev1.Protocol, ...)
- func DelEP(t *testing.T, ns string, Name string)
- func DelSVC(t *testing.T, ns string, Name string)
- func DeleteConfigMap(kubeClient *k8sfake.Clientset, t *testing.T)
- func DeleteLease(ns string) error
- func DeleteNamespace(nsName string)
- func DeleteNode(t *testing.T, nodeName string)
- func DeleteSecret(secretName string, namespace string)
- func DetectModelChecksumChange(t *testing.T, key string, counter int) interface{}
- func FeedMockCollectionData(w http.ResponseWriter, r *http.Request, mockFilePath string)
- func GetShardVSNumber(s string) string
- func GetStaticRoute(nodeAddr, prefixAddr, routeID string, mask int32) *models.StaticRoute
- func InitializeFakeAKOAPIServer() *api.FakeApiServer
- func NewAviFakeClientInstance(kubeclient *k8sfake.Clientset, skipCachePopulation ...bool)
- func NormalControllerServer(w http.ResponseWriter, r *http.Request, args ...string)
- func PollForCompletion(t *testing.T, key string, counter int) interface{}
- func PollForSyncStart(ctrl *k8s.AviController, counter int) bool
- func RemoveAnnotateAKONamespaceWithInfraSetting(t *testing.T, ns string)
- func RemoveDefaultIngressClass()
- func RemoveIngressClassWithName(ingClassName string)
- func ResetAkoTenant()
- func ResetMiddleware()
- func ScaleCreateEP(t *testing.T, ns string, Name string)
- func SetAkoTenant()
- func SetClusterIPMode()
- func SetNodePortMode()
- func SetUpOAuthSecret() (err error)
- func SetupAviInfraSetting(t *testing.T, infraSettingName, shardSize string)
- func SetupHTTPRule(t *testing.T, rrname, fqdn, path string)
- func SetupHostRule(t *testing.T, hrname, fqdn string, secure bool, gslbHost ...string)
- func SetupIngressClass(t *testing.T, ingclassName, controller, infraSetting string)
- func SetupL4Rule(t *testing.T, name, namespace string, port []int)
- func SetupL4RuleSSL(t *testing.T, name, namespace string, port []int, ...)
- func SetupL7Rule(t *testing.T, name string, g *gomega.WithT)
- func SetupSSORule(t *testing.T, srname, fqdn string, ssoType string)
- func TearDownHostRuleWithNoVerify(t *testing.T, g *gomega.WithT, hrname string)
- func TearDownOAuthSecret() (err error)
- func TeardownAviInfraSetting(t *testing.T, infraSettingName string)
- func TeardownHTTPRule(t *testing.T, rrname string)
- func TeardownHostRule(t *testing.T, g *gomega.WithT, vskey cache.NamespaceName, hrname string)
- func TeardownIngressClass(t *testing.T, ingClassName string)
- func TeardownL4Rule(t *testing.T, name, namespace string)
- func TeardownSSORule(t *testing.T, g *gomega.WithT, vskey cache.NamespaceName, srname string)
- func UpdateNamespace(t *testing.T, nsName string, labels map[string]string) error
- func UpdateSVC(t *testing.T, ns string, Name string, protocol corev1.Protocol, ...)
- func UpdateServiceWithSelectors(t *testing.T, ns string, Name string, protocol corev1.Protocol, ...)
- func VerifyMetadataHTTPRule(t *testing.T, g *gomega.WithT, poolKey cache.NamespaceName, ...)
- func VerifyMetadataHostRule(t *testing.T, g *gomega.WithT, vsKey cache.NamespaceName, hrnsname string, ...)
- func VerifyMetadataSSORule(t *testing.T, g *gomega.WithT, vsKey cache.NamespaceName, srnsname string, ...)
- func WaitTillNamespaceDelete(nsName string, retry_count int)
- type FakeAviInfraSetting
- type FakeHTTPRule
- type FakeHTTPRulePath
- type FakeHostRule
- type FakeIngress
- func (ing FakeIngress) Ingress(multiport ...bool) *networking.Ingress
- func (ing FakeIngress) IngressMultiPath() *networking.Ingress
- func (ing FakeIngress) IngressMultiPort() *networking.Ingress
- func (ing FakeIngress) IngressNoHost() *networking.Ingress
- func (ing FakeIngress) IngressOnlyHostNoBackend() *networking.Ingress
- func (ing FakeIngress) SecureIngress() *networking.Ingress
- func (ing FakeIngress) UpdateIngress() (*networking.Ingress, error)
- type FakeIngressClass
- type FakeL4Rule
- type FakeL7Rule
- type FakeMultiClusterIngress
- type FakeNamespace
- type FakeNode
- type FakeSSORule
- type FakeSecret
- type FakeService
- type FakeServiceImport
- type InjectFault
- type Serviceport
Constants ¶
const ( SINGLEPORTSVC = "testsvc" // single port service name MULTIPORTSVC = "testsvcmulti" // multi port service name NAMESPACE = "red-ns" // namespace AVINAMESPACE = "admin" // avi namespace AKOTENANT = "akotenant" // ako tenant where TENANTS_PER_CLUSTER is enabled SINGLEPORTMODEL = "admin/cluster--red-ns-testsvc" // single port model name MULTIPORTMODEL = "admin/cluster--red-ns-testsvcmulti" // multi port model name RANDOMUUID = "random-uuid" // random avi object uuid DefaultIngressClass = "avi-lb" SSOTypeOAuth = "OAuth" SSOTypeSAML = "SAML" SHAREDVIPKEY = "shared-vip-key" SHAREDVIPSVC01 = "shared-vip-svc-01" SHAREDVIPSVC02 = "shared-vip-svc-02" EXTDNSANNOTATION = "custom-fqdn.com" EXTDNSSVC = "custom-fqdn-svc" INVALID_LB_CLASS = "not-ako-lb" )
constants to be used for creating K8s objs and verifying Avi objs
Variables ¶
var AllModels = []string{
"admin/cluster--Shared-L7-0",
"admin/cluster--Shared-L7-1",
"admin/cluster--Shared-L7-2",
"admin/cluster--Shared-L7-3",
"admin/cluster--Shared-L7-4",
"admin/cluster--Shared-L7-5",
"admin/cluster--Shared-L7-6",
"admin/cluster--Shared-L7-7",
"admin/cluster--Shared-L7-EVH-0",
"admin/cluster--Shared-L7-EVH-1",
"admin/cluster--Shared-L7-EVH-2",
"admin/cluster--Shared-L7-EVH-3",
"admin/cluster--Shared-L7-EVH-4",
"admin/cluster--Shared-L7-EVH-5",
"admin/cluster--Shared-L7-EVH-6",
"admin/cluster--Shared-L7-EVH-7",
}
var AviFakeClientInstance *httptest.Server
var CRDClient *crdfake.Clientset
var FakeAviObjects = []string{
"cloud",
"ipamdnsproviderprofile",
"ipamdnsproviderprofiledomainlist",
"network",
"pool",
"poolgroup",
"virtualservice",
"vrfcontext",
"vsdatascriptset",
"serviceenginegroup",
"tenant",
"vsvip",
"l4policyset",
}
var KubeClient *k8sfake.Clientset
Functions ¶
func AddConfigMap ¶
func AddDefaultIngressClass ¶
func AddDefaultIngressClass()
func AddDefaultNamespace ¶
func AddDefaultNamespace(ns ...string)
func AddIngressClassWithName ¶
func AddIngressClassWithName(name string)
func AddMiddleware ¶
func AddMiddleware(exec InjectFault)
func ClearAllCache ¶
func ClearAllCache(cacheObj *cache.AviObjCache)
func ConstructService ¶
func CreateEP ¶
func CreateEP(t *testing.T, ns string, Name string, multiPort bool, multiAddress bool, addressPrefix string, multiProtocol ...corev1.Protocol)
CreateEP creates a sample Endpoint object if multiPort: False and multiAddress: False
1.1.1.1:8080
if multiPort: True and multiAddress: False
1.1.1.1:8080, 1.1.1.2:8081, 1.1.1.3:8082
if multiPort: False and multiAddress: True
1.1.1.1:8080, 1.1.1.2:8080, 1.1.1.2:8080
if multiPort: True and multiAddress: True
1.1.1.1:8080, 1.1.1.2:8080, 1.1.1.3:8080, 1.1.1.4:8081, 1.1.1.5:8081, 1.1.1.6:8082
func CreateOrUpdateLease ¶
func CreateSVC ¶
func CreateSVC(t *testing.T, ns string, Name string, protocol corev1.Protocol, Type corev1.ServiceType, multiPort bool, multiProtocol ...corev1.Protocol)
CreateSVC creates a sample service of type: Type if multiPort: True, the service gets created with 3 ports as follows ServicePorts: [
{Name: "foo0", Port: 8080, Protocol: "TCP", TargetPort: 8080}, {Name: "foo1", Port: 8081, Protocol: "TCP", TargetPort: 8081}, {Name: "foo2", Port: 8082, Protocol: "TCP", TargetPort: 8082},
]
func DeleteLease ¶
func DeleteNamespace ¶
func DeleteNamespace(nsName string)
func DeleteNode ¶
func DeleteSecret ¶
func FeedMockCollectionData ¶
func FeedMockCollectionData(w http.ResponseWriter, r *http.Request, mockFilePath string)
FeedMockCollectionData reads data from avimockobjects/*.json files and returns mock data for GET objects list API. GET /api/virtualservice returns from virtualservice_mock.json and so on
func GetStaticRoute ¶
func GetStaticRoute(nodeAddr, prefixAddr, routeID string, mask int32) *models.StaticRoute
func InitializeFakeAKOAPIServer ¶
func InitializeFakeAKOAPIServer() *api.FakeApiServer
func NormalControllerServer ¶
func NormalControllerServer(w http.ResponseWriter, r *http.Request, args ...string)
func PollForSyncStart ¶
func PollForSyncStart(ctrl *k8s.AviController, counter int) bool
func RemoveDefaultIngressClass ¶
func RemoveDefaultIngressClass()
func RemoveIngressClassWithName ¶
func RemoveIngressClassWithName(ingClassName string)
func ResetAkoTenant ¶
func ResetAkoTenant()
func ResetMiddleware ¶
func ResetMiddleware()
func SetAkoTenant ¶
func SetAkoTenant()
func SetClusterIPMode ¶
func SetClusterIPMode()
func SetNodePortMode ¶
func SetNodePortMode()
func SetUpOAuthSecret ¶
func SetUpOAuthSecret() (err error)
func SetupAviInfraSetting ¶
func SetupHTTPRule ¶
func SetupHostRule ¶
func SetupIngressClass ¶
func SetupL4RuleSSL ¶
func TearDownOAuthSecret ¶
func TearDownOAuthSecret() (err error)
func TeardownAviInfraSetting ¶
func TeardownHTTPRule ¶
func TeardownHostRule ¶
func TeardownIngressClass ¶
func TeardownL4Rule ¶
func TeardownSSORule ¶
func UpdateNamespace ¶
func VerifyMetadataHTTPRule ¶
func VerifyMetadataHostRule ¶
func VerifyMetadataSSORule ¶
func WaitTillNamespaceDelete ¶
Types ¶
type FakeAviInfraSetting ¶
type FakeAviInfraSetting struct { Name string SeGroupName string Networks []string EnableRhi bool EnablePublicIP bool ShardSize string BGPPeerLabels []string T1LR string }
func (FakeAviInfraSetting) AviInfraSetting ¶
func (infraSetting FakeAviInfraSetting) AviInfraSetting() *akov1beta1.AviInfraSetting
type FakeHTTPRule ¶
type FakeHTTPRule struct { Name string Namespace string Fqdn string PathProperties []FakeHTTPRulePath }
func (FakeHTTPRule) HTTPRule ¶
func (rr FakeHTTPRule) HTTPRule() *akov1beta1.HTTPRule
type FakeHTTPRulePath ¶
type FakeHostRule ¶
type FakeHostRule struct { Name string Namespace string Fqdn string SslKeyCertificate string SslProfile string WafPolicy string ApplicationProfile string ICAPProfile []string EnableVirtualHost bool AnalyticsProfile string ErrorPageProfile string Datascripts []string HttpPolicySets []string GslbFqdn string NetworkSecurityPolicy string L7Rule string }
HostRule/HTTPRule lib functions
func (FakeHostRule) HostRule ¶
func (hr FakeHostRule) HostRule() *akov1beta1.HostRule
type FakeIngress ¶
type FakeIngress struct { DnsNames []string Paths []string Ips []string HostNames []string Namespace string Name string ClassName string ServiceName string TlsSecretDNS map[string][]string // contains filtered or unexported fields }
Fake ingress
func (FakeIngress) Ingress ¶
func (ing FakeIngress) Ingress(multiport ...bool) *networking.Ingress
func (FakeIngress) IngressMultiPath ¶
func (ing FakeIngress) IngressMultiPath() *networking.Ingress
func (FakeIngress) IngressMultiPort ¶
func (ing FakeIngress) IngressMultiPort() *networking.Ingress
func (FakeIngress) IngressNoHost ¶
func (ing FakeIngress) IngressNoHost() *networking.Ingress
func (FakeIngress) IngressOnlyHostNoBackend ¶
func (ing FakeIngress) IngressOnlyHostNoBackend() *networking.Ingress
func (FakeIngress) SecureIngress ¶
func (ing FakeIngress) SecureIngress() *networking.Ingress
func (FakeIngress) UpdateIngress ¶
func (ing FakeIngress) UpdateIngress() (*networking.Ingress, error)
UpdateIngress wrapper over ingress update call. internally calls Ingress() for fakeIngress object performs a get for ingress object so it will update only if ingress exists
type FakeIngressClass ¶
func (FakeIngressClass) IngressClass ¶
func (ingclass FakeIngressClass) IngressClass() *networking.IngressClass
type FakeL4Rule ¶
L4Rule lib functions
func (FakeL4Rule) L4Rule ¶
func (lr FakeL4Rule) L4Rule() *akov1alpha2.L4Rule
type FakeL7Rule ¶
type FakeL7Rule struct { AllowInvalidClientCert bool BotPolicyRef string CloseClientConnOnConfigUpdate bool HostNameXlate string IgnPoolNetReach bool MinPoolsUp uint32 RemoveListeningPortOnVsDown bool SecurityPolicyRef string SslSessCacheAvgSize uint32 Name string Namespace string }
func (FakeL7Rule) L7Rule ¶
func (l7 FakeL7Rule) L7Rule() *akov1alpha2.L7Rule
type FakeMultiClusterIngress ¶
type FakeMultiClusterIngress struct { HostName string Name string Clusters []string Weights []int Paths []string ServiceNames []string Ports []int Namespaces []string SecretName string // contains filtered or unexported fields }
Fake multi-cluster ingress
func (FakeMultiClusterIngress) Create ¶
func (mci FakeMultiClusterIngress) Create() *akov1alpha1.MultiClusterIngress
type FakeNamespace ¶
Fake Namespace
func (FakeNamespace) Namespace ¶
func (namespace FakeNamespace) Namespace() *corev1.Namespace
type FakeNode ¶
type FakeNode struct { Name string PodCIDR string PodCIDRs []string NodeIP string Version string PodCIDRsAnnotation string }
func (FakeNode) NodeCalico ¶
type FakeSSORule ¶
type FakeSSORule struct { Name string Namespace string Fqdn string // SSOType valid values currently are OAuth and SAML SSOType string }
func (FakeSSORule) SSORule ¶
func (sr FakeSSORule) SSORule() *akov1alpha2.SSORule
type FakeSecret ¶
Fake Secret
func (FakeSecret) Secret ¶
func (secret FakeSecret) Secret() *corev1.Secret
type FakeService ¶
type FakeService struct { Namespace string Name string Labels map[string]string Type corev1.ServiceType LoadBalancerIP string ServicePorts []Serviceport Selectors map[string]string Annotations map[string]string LoadBalancerClass string }
func (FakeService) Service ¶
func (svc FakeService) Service() *corev1.Service
type FakeServiceImport ¶
type FakeServiceImport struct { Name string Cluster string Namespace string ServiceName string EndPointIPs []string EndPointPorts []int32 }
Fake service import
func (FakeServiceImport) Create ¶
func (si FakeServiceImport) Create() *akov1alpha1.ServiceImport
type InjectFault ¶
type InjectFault func(w http.ResponseWriter, r *http.Request)
var FakeServerMiddleware InjectFault