contour icon indicating copy to clipboard operation
contour copied to clipboard

TLS certificate fixtures are duplicated many times

Open davecheney opened this issue 4 years ago • 1 comments

There are at least three sets of TLS certificate fixtures in the codebase. Ideally there should be one.

davecheney avatar Dec 06 '19 00:12 davecheney

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]
}

jpeach avatar Dec 06 '19 00:12 jpeach