Documentation ¶
Index ¶
- Constants
- Variables
- func APIBinding(t Test, workspace, name string) func(g gomega.Gomega) *apisv1alpha1.APIBinding
- func APIBindingPhase(binding *apisv1alpha1.APIBinding) apisv1alpha1.APIBindingPhaseType
- func AddRecord(t Test, host string, record Record) error
- func Annotations(object metav1.Object) map[string]string
- func Certificate(secret *corev1.Secret) (*x509.Certificate, error)
- func CertificateFrom(secret *corev1.Secret) (*x509.Certificate, error)
- func ConditionStatus(conditionType conditionsapi.ConditionType) func(getter conditionsutil.Getter) corev1.ConditionStatus
- func ConfigMap(t Test, namespace *corev1.Namespace, name string) func(g gomega.Gomega) *corev1.ConfigMap
- func DNSRecord(t Test, namespace *corev1.Namespace, name string) func(g gomega.Gomega) *kuadrantv1.DNSRecord
- func DNSRecordCondition(zoneID, condition string) func(record *kuadrantv1.DNSRecord) *kuadrantv1.DNSZoneCondition
- func DNSRecordEndpoints(record *kuadrantv1.DNSRecord) []*kuadrantv1.Endpoint
- func DNSRecordEndpointsCount(record *kuadrantv1.DNSRecord) int
- func DNSRecordToIngressCertReady(t Test, namespace *corev1.Namespace, name string) func(dnsrecord *kuadrantv1.DNSRecord) string
- func DNSRecords(t Test, namespace *corev1.Namespace, labelSelector string) func(g gomega.Gomega) []kuadrantv1.DNSRecord
- func DeploymentConfiguration(namespace, name string) *appsv1apply.DeploymentApplyConfiguration
- func Deployments(t Test, namespace *corev1.Namespace, labelSelector string) func(g gomega.Gomega) []appsv1.Deployment
- func DomainToken(verification *kuadrantv1.DomainVerification) string
- func DomainVerification(t Test, clusterName logicalcluster.Name, name string) func(g gomega.Gomega) *kuadrantv1.DomainVerification
- func DomainVerificationFor(verification *kuadrantv1.DomainVerification) string
- func DomainVerified(verification *kuadrantv1.DomainVerification) bool
- func EqualP(expected interface{}) types.GomegaMatcher
- func GenerateName(base string) string
- func GetAPIBinding(t Test, workspace, name string) *apisv1alpha1.APIBinding
- func GetCertificate(t Test, namespace, name string) *certman.Certificate
- func GetDNSRecord(t Test, namespace *corev1.Namespace, name string) *kuadrantv1.DNSRecord
- func GetDNSRecords(t Test, namespace *corev1.Namespace, labelSelector string) []kuadrantv1.DNSRecord
- func GetDefaultSpec(host, tlsSecretName, serviceName string) networkingv1.IngressSpec
- func GetDeployments(t Test, namespace *corev1.Namespace, labelSelector string) []appsv1.Deployment
- func GetIngress(t Test, namespace *corev1.Namespace, name string) *traffic.Ingress
- func GetIngresses(t Test, namespace *corev1.Namespace, labelSelector string) []networkingv1.Ingress
- func GetSecret(t Test, namespace *corev1.Namespace, name string) *corev1.Secret
- func GetSecrets(t Test, namespace *corev1.Namespace, labelSelector string) []corev1.Secret
- func GetServices(t Test, namespace *corev1.Namespace, labelSelector string) []corev1.Service
- func HasImportedAPIs(t Test, workspace *tenancyv1beta1.Workspace, GVKs ...schema.GroupVersionKind) func(g gomega.Gomega) bool
- func HasTLSSecretForGeneratedHost(secret string) func(ingress *traffic.Ingress) bool
- func HostsEqualsToGeneratedHost(ingress *traffic.Ingress) bool
- func Ingress(t Test, namespace *corev1.Namespace, name string) func(g gomega.Gomega) *traffic.Ingress
- func IngressConfiguration(namespace, name, serviceName, host string) *networkingv1apply.IngressApplyConfiguration
- func IngressEndpoints(t Test, ingress *traffic.Ingress, res dns.HostResolver) []types.GomegaMatcher
- func IngressHosts(ingress *traffic.Ingress) map[string]string
- func IngressPendingHosts(ingress *traffic.Ingress) map[string]string
- func IngressTLS(ingress *networkingv1.Ingress) []networkingv1.IngressTLS
- func Ingresses(t Test, namespace *corev1.Namespace, labelSelector string) func(g gomega.Gomega) []networkingv1.Ingress
- func LBHostEqualToGeneratedHost(ingress *traffic.Ingress) bool
- func Labels(object metav1.Object) map[string]string
- func LoadBalancerIngresses(ingress *traffic.Ingress) []corev1.LoadBalancerIngress
- func MatchFieldsP(options gstruct.Options, fields gstruct.Fields) types.GomegaMatcher
- func OriginalSpecUnchanged(t Test, originalSpec *networkingv1.IngressSpec) func(ingress *traffic.Ingress) bool
- func Secret(t Test, namespace *corev1.Namespace, name string) func(g gomega.Gomega) *corev1.Secret
- func Secrets(t Test, namespace *corev1.Namespace, labelSelector string) func(g gomega.Gomega) []corev1.Secret
- func ServiceConfiguration(namespace, name string, annotations map[string]string) *corev1apply.ServiceApplyConfiguration
- func Services(t Test, namespace *corev1.Namespace, labelSelector string) func(g gomega.Gomega) []corev1.Service
- func SetARecord(t Test, host, value string) error
- func SetTXTRecord(t Test, host, value string) error
- func SyncTarget(t Test, workspace, name string) func(g gomega.Gomega) *workloadv1alpha1.SyncTarget
- func Syncer() *syncer
- func TLSCertificate(t Test, namespace, name string) func(g gomega.Gomega) *certman.Certificate
- func TLSCertificateSpec(cert *certman.Certificate) certman.CertificateSpec
- func TransformedSpec(test Test, expectedSpec networkingv1.IngressSpec) func(ingress *traffic.Ingress) bool
- func ValidateTransformedIngress(expectedSpec networkingv1.IngressSpec, transformed *traffic.Ingress) error
- func ValidateTransformedRoute(expectedSpec routev1.RouteSpec, transformed *traffic.Route) error
- func Workspace(t Test, name string) func() *tenancyv1beta1.Workspace
- func WorkspacePhase(workspace *tenancyv1beta1.Workspace) tenancyv1alpha1.ClusterWorkspacePhaseType
- type Client
- type Option
- func InWorkspace(workspace interface{}) Option
- func WithComputeServiceExport(path logicalcluster.Name) Option
- func WithExportReference(path logicalcluster.Name, exportName string) Option
- func WithGLBCAcceptablePermissionClaims(identityHash string) Option
- func WithKubeConfigByID(id string) Option
- func WithLabel(key, value string) Option
- func WithLabels(labels map[string]string) Option
- type Record
- type T
- func (t *T) Client() Client
- func (t *T) CreateGLBCAPIBindings(targetWorkspace *tenancyv1beta1.Workspace, glbcWorkspace logicalcluster.Name, ...)
- func (t *T) CreatePlacements(targetWorkspace *tenancyv1beta1.Workspace)
- func (t *T) Ctx() context.Context
- func (t *T) NewAPIBinding(name string, options ...Option) *apisv1alpha1.APIBinding
- func (t *T) NewSyncTarget(name string, options ...Option) *workloadv1alpha1.SyncTarget
- func (t *T) NewTestNamespace(options ...Option) *corev1.Namespace
- func (t *T) NewTestWorkspace() *tenancyv1beta1.Workspace
- func (t *T) T() *testing.T
- type Test
- type Zone
Constants ¶
View Source
const ( ConfigmapName = "hosts" ConfigmapNamespace = "kcp-glbc" )
View Source
const ( TestTimeoutShort = 1 * time.Minute TestTimeoutMedium = 5 * time.Minute TestTimeoutLong = 10 * time.Minute MaxGeneratedNameLength = maxNameLength - randomLength )
View Source
const ComputeServiceExportName = "kubernetes"
Variables ¶
View Source
var ( GLBCResources = []string{"ingresses.networking.k8s.io", "services", "deployments.apps", "secrets", "configmaps"} WithKubeConfigByName = &withKubeConfigByName{} )
View Source
var ( TestOrganization = getEnvLogicalClusterName(testWorkspaceName, tenancyv1alpha1.RootCluster.Join("kuadrant")) GLBCWorkspace = getEnvLogicalClusterName(glbcWorkspaceName, TestOrganization) GLBCExportName = env.GetEnvString(glbcExportName, "glbc-root-kuadrant") ApplyOptions = metav1.ApplyOptions{FieldManager: "kcp-glbc-e2e", Force: true} )
Functions ¶
func APIBinding ¶
func APIBinding(t Test, workspace, name string) func(g gomega.Gomega) *apisv1alpha1.APIBinding
func APIBindingPhase ¶
func APIBindingPhase(binding *apisv1alpha1.APIBinding) apisv1alpha1.APIBindingPhaseType
func Certificate ¶
func Certificate(secret *corev1.Secret) (*x509.Certificate, error)
func CertificateFrom ¶
func CertificateFrom(secret *corev1.Secret) (*x509.Certificate, error)
func ConditionStatus ¶
func ConditionStatus(conditionType conditionsapi.ConditionType) func(getter conditionsutil.Getter) corev1.ConditionStatus
func DNSRecordCondition ¶
func DNSRecordCondition(zoneID, condition string) func(record *kuadrantv1.DNSRecord) *kuadrantv1.DNSZoneCondition
func DNSRecordEndpoints ¶
func DNSRecordEndpoints(record *kuadrantv1.DNSRecord) []*kuadrantv1.Endpoint
func DNSRecordEndpointsCount ¶
func DNSRecordEndpointsCount(record *kuadrantv1.DNSRecord) int
func DNSRecords ¶
func DeploymentConfiguration ¶
func DeploymentConfiguration(namespace, name string) *appsv1apply.DeploymentApplyConfiguration
func Deployments ¶
func DomainToken ¶
func DomainToken(verification *kuadrantv1.DomainVerification) string
func DomainVerification ¶
func DomainVerification(t Test, clusterName logicalcluster.Name, name string) func(g gomega.Gomega) *kuadrantv1.DomainVerification
func DomainVerificationFor ¶
func DomainVerificationFor(verification *kuadrantv1.DomainVerification) string
func DomainVerified ¶
func DomainVerified(verification *kuadrantv1.DomainVerification) bool
func EqualP ¶
func EqualP(expected interface{}) types.GomegaMatcher
func GenerateName ¶
GenerateName Borrowed from https://github.com/kubernetes/apiserver/blob/v0.25.2/pkg/storage/names/generate.go
func GetAPIBinding ¶
func GetAPIBinding(t Test, workspace, name string) *apisv1alpha1.APIBinding
func GetCertificate ¶
func GetCertificate(t Test, namespace, name string) *certman.Certificate
func GetDNSRecord ¶
func GetDNSRecords ¶
func GetDefaultSpec ¶
func GetDefaultSpec(host, tlsSecretName, serviceName string) networkingv1.IngressSpec
func GetDeployments ¶
func GetIngress ¶
func GetIngresses ¶
func GetSecrets ¶
func GetServices ¶
func HasImportedAPIs ¶
func HasImportedAPIs(t Test, workspace *tenancyv1beta1.Workspace, GVKs ...schema.GroupVersionKind) func(g gomega.Gomega) bool
func HostsEqualsToGeneratedHost ¶
HostsEqualsToGeneratedHost checks Ingress hosts are the same as the generated hosts
func IngressConfiguration ¶
func IngressConfiguration(namespace, name, serviceName, host string) *networkingv1apply.IngressApplyConfiguration
func IngressEndpoints ¶
func IngressEndpoints(t Test, ingress *traffic.Ingress, res dns.HostResolver) []types.GomegaMatcher
func IngressHosts ¶
IngressHosts returns each unique host used in the rules
func IngressPendingHosts ¶
IngressPendingHosts returns each unique host in the pending rules annotation
func IngressTLS ¶
func IngressTLS(ingress *networkingv1.Ingress) []networkingv1.IngressTLS
func LoadBalancerIngresses ¶
func LoadBalancerIngresses(ingress *traffic.Ingress) []corev1.LoadBalancerIngress
func MatchFieldsP ¶
func OriginalSpecUnchanged ¶
func OriginalSpecUnchanged(t Test, originalSpec *networkingv1.IngressSpec) func(ingress *traffic.Ingress) bool
func ServiceConfiguration ¶
func ServiceConfiguration(namespace, name string, annotations map[string]string) *corev1apply.ServiceApplyConfiguration
func SetARecord ¶
func SetTXTRecord ¶
func SyncTarget ¶
func SyncTarget(t Test, workspace, name string) func(g gomega.Gomega) *workloadv1alpha1.SyncTarget
func TLSCertificate ¶
func TLSCertificateSpec ¶
func TLSCertificateSpec(cert *certman.Certificate) certman.CertificateSpec
func TransformedSpec ¶
func TransformedSpec(test Test, expectedSpec networkingv1.IngressSpec) func(ingress *traffic.Ingress) bool
TransformedSpec will look at the transforms applied and compare them to the expected spec. cbrookes TODO(look at whether we could take the ingress apply configuration)
func ValidateTransformedIngress ¶
func ValidateTransformedIngress(expectedSpec networkingv1.IngressSpec, transformed *traffic.Ingress) error
func WorkspacePhase ¶
func WorkspacePhase(workspace *tenancyv1beta1.Workspace) tenancyv1alpha1.ClusterWorkspacePhaseType
Types ¶
type Client ¶
type Client interface { Core() kubernetes.ClusterInterface Kcp() kcp.ClusterInterface Kuadrant() kuadrantv1.ClusterInterface Certs() certmanclient.Interface GetConfig() *rest.Config }
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func InWorkspace ¶
func InWorkspace(workspace interface{}) Option
func WithComputeServiceExport ¶
func WithComputeServiceExport(path logicalcluster.Name) Option
func WithExportReference ¶
func WithKubeConfigByID ¶
func WithLabels ¶
type T ¶
func (*T) CreateGLBCAPIBindings ¶
func (t *T) CreateGLBCAPIBindings(targetWorkspace *tenancyv1beta1.Workspace, glbcWorkspace logicalcluster.Name, glbcExportName string)
func (*T) CreatePlacements ¶
func (t *T) CreatePlacements(targetWorkspace *tenancyv1beta1.Workspace)
func (*T) NewAPIBinding ¶
func (t *T) NewAPIBinding(name string, options ...Option) *apisv1alpha1.APIBinding
func (*T) NewSyncTarget ¶
func (t *T) NewSyncTarget(name string, options ...Option) *workloadv1alpha1.SyncTarget
func (*T) NewTestWorkspace ¶
func (t *T) NewTestWorkspace() *tenancyv1beta1.Workspace
type Test ¶
type Test interface { T() *testing.T Ctx() context.Context Client() Client gomega.Gomega CreateGLBCAPIBindings(*tenancyv1beta1.Workspace, logicalcluster.Name, string) CreatePlacements(workspace *tenancyv1beta1.Workspace) NewAPIBinding(name string, options ...Option) *apisv1alpha1.APIBinding NewSyncTarget(name string, options ...Option) *workloadv1alpha1.SyncTarget NewTestNamespace(...Option) *corev1.Namespace NewTestWorkspace() *tenancyv1beta1.Workspace }
Click to show internal directories.
Click to hide internal directories.