contour
contour copied to clipboard
TLS certificate fixtures are duplicated many times
There are at least three sets of TLS certificate fixtures in the codebase. Ideally there should be one.
I have a partial prototype to consolidate test fixtures:
type Fixtures struct {
secrets map[string]*v1.Secret
services map[string]*v1.Service
ingresses map[string]*v1beta1.Ingress
ingressRoutes map[string]*ingressroutev1.IngressRoute
httpProxies map[string]*projcontour.HTTPProxy
}
func (f *Fixtures) Secret(s string) *v1.Secret {
return f.secrets[s]
}
func (f *Fixtures) Service(s string) *v1.Service {
return f.services[s]
}
func (f *Fixtures) Ingress(s string) *v1beta1.Ingress {
return f.ingresses[s]
}
func (f *Fixtures) IngressRoute(s string) *ingressroutev1.IngressRoute {
return f.ingressRoutes[s]
}
func (f *Fixtures) HTTPProxy(s string) *projcontour.HTTPProxy {
return f.httpProxies[s]
}