Documentation
¶
Index ¶
- Constants
- Variables
- func CreateDefaultDomainSecret(certPEM, keyPEM []byte) *corev1.Secret
- func DefaultDomainServer(name string) []client.Object
- func DefaultNginxIngressController() *v1alpha1.NginxIngressController
- func E2e(image, loadableProvisionedJson string) []client.Object
- func GenerateSelfSignedCert() (certPEM, keyPEM []byte, err error)
- func MarshalJson(obj client.Object) ([]byte, error)
- func NewNginxIngressController(name, ingressClassName string) *v1alpha1.NginxIngressController
- func Operator(latestImage string, publicZones, privateZones []string, cfg *OperatorConfig, ...) []client.Object
- func PrometheusClientAndServer(namespace, name string) prometheusResources
- func UncollisionedNs() *corev1.Namespace
- type ClientServerResources
- type DnsZoneCount
- type DnsZones
- type GatewayClientServerResources
- type GatewayFilterTestResources
- type GatewayLabelFilterTestConfig
- type OperatorConfig
- type OperatorVersion
Constants ¶
const ( ManagedByKey = "app.kubernetes.io/managed-by" // ManagedByVal is the value for the ManagedByKey label on all resources directly managed by our e2e tester ManagedByVal = "app-routing-operator-e2e" )
const ( // IstioGatewayClassName is the GatewayClass name for Istio managed gateways IstioGatewayClassName = "istio" // TLSCertKeyvaultURIOption is the TLS option key for specifying the KeyVault certificate URI TLSCertKeyvaultURIOption = "kubernetes.azure.com/tls-cert-keyvault-uri" // TLSCertServiceAccountOption is the TLS option key for specifying the ServiceAccount for workload identity TLSCertServiceAccountOption = "kubernetes.azure.com/tls-cert-service-account" )
const (
ManagedResourceNs = "app-routing-system"
)
Variables ¶
var ( // AllUsedOperatorVersions is a list of all the operator versions used today AllUsedOperatorVersions = []OperatorVersion{OperatorVersion0_2_5, OperatorVersionLatest} // AllDnsZoneCounts is a list of all the dns zone counts AllDnsZoneCounts = []DnsZoneCount{DnsZoneCountNone, DnsZoneCountOne, DnsZoneCountMultiple} NonZeroDnsZoneCounts = []DnsZoneCount{DnsZoneCountOne, DnsZoneCountMultiple} SingleStackIPFamilyPolicy = corev1.IPFamilyPolicySingleStack )
Functions ¶
func CreateDefaultDomainSecret ¶ added in v0.2.9
func DefaultDomainServer ¶ added in v0.2.14
func DefaultNginxIngressController ¶ added in v0.2.18
func DefaultNginxIngressController() *v1alpha1.NginxIngressController
DefaultNginxIngressController returns the default NIC that the operator creates. This must match the values in pkg/controller/nginxingress/default.go GetDefaultNginxIngressController
func GenerateSelfSignedCert ¶ added in v0.2.9
GenerateSelfSignedCert generates a self-signed TLS certificate and private key for testing
func MarshalJson ¶
MarshalJson converts an object to json
func NewNginxIngressController ¶
func NewNginxIngressController(name, ingressClassName string) *v1alpha1.NginxIngressController
func PrometheusClientAndServer ¶
func PrometheusClientAndServer(namespace, name string) prometheusResources
func UncollisionedNs ¶
UncollisionedNs returns a namespace with a guaranteed unique name after creating the namespace
Types ¶
type ClientServerResources ¶
type ClientServerResources struct {
Client *appsv1.Deployment
Server *appsv1.Deployment
Ingress *netv1.Ingress
Service *corev1.Service
AddedObjects []client.Object
}
func ClientAndServer ¶
func ClientAndServer(namespace, name, nameserver, keyvaultURI, host, tlsHost string) ClientServerResources
func CustomErrorsClientAndServer ¶
func CustomErrorsClientAndServer(namespace, name, nameserver, keyvaultURI, host, tlsHost, ingressClassName string, serviceName *string) ClientServerResources
func DefaultBackendClientAndServer ¶
func DefaultBackendClientAndServer(namespace, name, nameserver, keyvaultURI, ingressClassName, host, tlsHost string) ClientServerResources
func (ClientServerResources) Objects ¶
func (t ClientServerResources) Objects() []client.Object
type DnsZoneCount ¶
type DnsZoneCount uint
DnsZoneCount is enum for the number of dns zones but shouldn't be used directly. Use the exported fields of this type instead.
const ( // DnsZoneCountNone represents no dns zones DnsZoneCountNone DnsZoneCount = iota // DnsZoneCountOne represents one dns zone DnsZoneCountOne // DnsZoneCountMultiple represents multiple dns zones DnsZoneCountMultiple )
func (DnsZoneCount) String ¶
func (d DnsZoneCount) String() string
type DnsZones ¶
type DnsZones struct {
Public DnsZoneCount
Private DnsZoneCount
}
type GatewayClientServerResources ¶ added in v0.2.18
type GatewayClientServerResources struct {
Client *appsv1.Deployment
Server *appsv1.Deployment
Service *corev1.Service
Gateway *gatewayv1.Gateway
HTTPRoute *gatewayv1.HTTPRoute
AddedObjects []client.Object
}
GatewayClientServerResources contains the Kubernetes resources needed for Gateway API e2e testing
func GatewayClientAndServer ¶ added in v0.2.18
func GatewayClientAndServer(namespace, name, nameserver, keyvaultURI, host, tlsHost, serviceAccountName, gatewayClassName string) GatewayClientServerResources
GatewayClientAndServer creates the resources needed for Gateway API e2e testing with TLS Parameters:
- namespace: the namespace for all resources
- name: base name for resources (will be sanitized)
- nameserver: DNS nameserver for the client to use for resolution
- keyvaultURI: Azure Key Vault certificate URI for TLS
- host: hostname for the Gateway listener and HTTPRoute
- tlsHost: hostname for TLS certificate (can include wildcards)
- serviceAccountName: name of the ServiceAccount for workload identity (must be created separately)
- gatewayClassName: the GatewayClass name to use (e.g., "istio")
func (GatewayClientServerResources) Objects ¶ added in v0.2.18
func (g GatewayClientServerResources) Objects() []client.Object
Objects returns all Kubernetes objects in this resource set
type GatewayFilterTestResources ¶ added in v0.2.18
type GatewayFilterTestResources struct {
Client *appsv1.Deployment
Server *appsv1.Deployment
Service *corev1.Service
LabeledGateway *gatewayv1.Gateway
UnlabeledGateway *gatewayv1.Gateway
LabeledRoute *gatewayv1.HTTPRoute
UnlabeledRoute *gatewayv1.HTTPRoute
AddedObjects []client.Object
}
GatewayFilterTestResources contains resources for testing gateway/route label selectors It includes two gateways - one labeled (reachable) and one unlabeled (unreachable)
func GatewayLabelFilterResources ¶ added in v0.2.18
func GatewayLabelFilterResources(cfg GatewayLabelFilterTestConfig) GatewayFilterTestResources
GatewayLabelFilterResources creates resources for testing gateway label selectors Creates two gateways: one with the filter label (reachable) and one without (unreachable)
func RouteLabelFilterResources ¶ added in v0.2.18
func RouteLabelFilterResources(cfg GatewayLabelFilterTestConfig) GatewayFilterTestResources
RouteLabelFilterResources creates resources for testing route label selectors Creates two gateways with routes: one route with the filter label (reachable) and one without (unreachable)
func (GatewayFilterTestResources) Objects ¶ added in v0.2.18
func (g GatewayFilterTestResources) Objects() []client.Object
Objects returns all Kubernetes objects in this resource set
type GatewayLabelFilterTestConfig ¶ added in v0.2.18
type GatewayLabelFilterTestConfig struct {
Namespace string
Name string
Nameserver string
KeyvaultURI string
LabeledHost string // Host for the labeled gateway (should be reachable)
UnlabeledHost string // Host for the unlabeled gateway (should be unreachable)
ServiceAccountName string
GatewayClassName string
FilterLabelKey string
FilterLabelValue string
}
GatewayLabelFilterTestConfig contains configuration for gateway label filter tests
type OperatorConfig ¶
type OperatorVersion ¶
type OperatorVersion uint
OperatorVersion is an enum for the different versions of the operator
const ( OperatorVersion0_2_1_Patch_7 OperatorVersion = iota // use iota to number with earlier versions being lower numbers OperatorVersion0_2_3_Patch_5 OperatorVersion0_2_5 // OperatorVersionLatest represents the latest version of the operator which is essentially whatever code changes this test is running against OperatorVersionLatest = math.MaxUint // this must always be the last/largest value in the enum because we order by value )
func (OperatorVersion) String ¶
func (o OperatorVersion) String() string