Move IngressEditInPlaceAnnotationKey into acme API

Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
This commit is contained in:
JoshVanL 2019-10-14 16:32:41 +02:00
parent 03e3897771
commit 536dc150ab
4 changed files with 8 additions and 7 deletions

View File

@ -31,6 +31,10 @@ const (
// classes into a single cluster that want to be able to re-use a single
// solver for each ingress class.
ACMECertificateHTTP01IngressClassOverride = "acme.cert-manager.io/http01-override-ingress-class"
// IngressEditInPlaceAnnotation is used to toggle the use of ingressClass instead
// of ingress on the created Certificate resource
IngressEditInPlaceAnnotationKey = "acme.cert-manager.io/http01-edit-in-place"
)
const (

View File

@ -29,9 +29,6 @@ const (
)
const (
// editInPlaceAnnotation is used to toggle the use of ingressClass instead
// of ingress on the created Certificate resource
IngressEditInPlaceAnnotationKey = "acme.cert-manager.io/http01-edit-in-place"
// issuerNameAnnotation can be used to override the issuer specified on the
// created Certificate resource.
IngressIssuerNameAnnotationKey = "cert-manager.io/issuer"

View File

@ -278,7 +278,7 @@ func (c *controller) setIssuerSpecificConfig(crt *cmapi.Certificate, ing *extv1b
}
// for ACME issuers
editInPlaceVal, _ := ingAnnotations[cmapi.IngressEditInPlaceAnnotationKey]
editInPlaceVal, _ := ingAnnotations[cmacme.IngressEditInPlaceAnnotationKey]
editInPlace := editInPlaceVal == "true"
if editInPlace {
if crt.Annotations == nil {

View File

@ -111,7 +111,7 @@ func TestSync(t *testing.T) {
},
Annotations: map[string]string{
cmapi.IngressClusterIssuerNameAnnotationKey: "issuer-name",
cmapi.IngressEditInPlaceAnnotationKey: "true",
cmacme.IngressEditInPlaceAnnotationKey: "true",
},
UID: types.UID("ingress-name"),
},
@ -162,7 +162,7 @@ func TestSync(t *testing.T) {
},
Annotations: map[string]string{
cmapi.IngressClusterIssuerNameAnnotationKey: "issuer-name",
cmapi.IngressEditInPlaceAnnotationKey: "true",
cmacme.IngressEditInPlaceAnnotationKey: "true",
},
UID: types.UID("ingress-name"),
},
@ -337,7 +337,7 @@ func TestSync(t *testing.T) {
Annotations: map[string]string{
cmapi.IngressClusterIssuerNameAnnotationKey: "issuer-name",
cmapi.IngressClassAnnotationKey: "nginx-ing",
cmapi.IngressEditInPlaceAnnotationKey: "false",
cmacme.IngressEditInPlaceAnnotationKey: "false",
},
UID: types.UID("ingress-name"),
},