move annotation to controller package

This commit is contained in:
Tony Li 2017-03-07 15:22:30 -05:00
parent 172206c32b
commit 175daafc00

View file

@ -52,6 +52,13 @@ const (
// responsibility to create/delete it. // responsibility to create/delete it.
staticIPNameKey = "kubernetes.io/ingress.global-static-ip-name" staticIPNameKey = "kubernetes.io/ingress.global-static-ip-name"
// preSharedCertKey represents the specific pre-shared SSL
// certicate for the Ingress controller to use. The controller *does not*
// manage this certificate, it is the users responsibility to create/delete it.
// In GCP, the Ingress controller assigns the SSL certificate with this name
// to the target proxies of the Ingress.
preSharedCertKey = "ingress.gcp.kubernetes.io/pre-shared-cert"
// ingressClassKey picks a specific "class" for the Ingress. The controller // ingressClassKey picks a specific "class" for the Ingress. The controller
// only processes Ingresses with this annotation either unset, or set // only processes Ingresses with this annotation either unset, or set
// to either gceIngessClass or the empty string. // to either gceIngessClass or the empty string.
@ -82,7 +89,7 @@ func (ing ingAnnotations) allowHTTP() bool {
// useNamedTLS returns the name of the GCE SSL certificate. Empty by default. // useNamedTLS returns the name of the GCE SSL certificate. Empty by default.
// TODO: naming this (ie: external-ssl-cert) // TODO: naming this (ie: external-ssl-cert)
func (ing ingAnnotations) useNamedTLS() string { func (ing ingAnnotations) useNamedTLS() string {
val, ok := ing[extensions.IngressPreSharedCertAnnotationKey] val, ok := ing[preSharedCertKey]
if !ok { if !ok {
return "" return ""
} }