diff --git a/BUILD.bazel b/BUILD.bazel index c3c03c51430..301d475b7c2 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -49,6 +49,7 @@ filegroup( "//pkg/apis:all-srcs", "//pkg/client/clientset/versioned:all-srcs", "//pkg/client/informers/externalversions:all-srcs", + "//pkg/client/listers/acme/v1alpha2:all-srcs", "//pkg/client/listers/certmanager/v1alpha2:all-srcs", "//pkg/controller:all-srcs", "//pkg/feature:all-srcs", diff --git a/deploy/charts/cert-manager/templates/rbac.yaml b/deploy/charts/cert-manager/templates/rbac.yaml index 21e964a3c7f..cebd73d7fdd 100644 --- a/deploy/charts/cert-manager/templates/rbac.yaml +++ b/deploy/charts/cert-manager/templates/rbac.yaml @@ -88,7 +88,7 @@ rules: resources: ["certificates", "certificates/status", "certificaterequests", "certificaterequests/status"] verbs: ["update"] - apiGroups: ["certmanager.k8s.io"] - resources: ["certificates", "certificaterequests", "clusterissuers", "issuers", "orders"] + resources: ["certificates", "certificaterequests", "clusterissuers", "issuers"] verbs: ["get", "list", "watch"] # We require these rules to support users with the OwnerReferencesPermissionEnforcement # admission controller enabled: @@ -96,9 +96,9 @@ rules: - apiGroups: ["certmanager.k8s.io"] resources: ["certificates/finalizers"] verbs: ["update"] - - apiGroups: ["certmanager.k8s.io"] + - apiGroups: ["acme.cert-manager.io"] resources: ["orders"] - verbs: ["create", "delete"] + verbs: ["create", "delete", "get", "list", "watch"] - apiGroups: [""] resources: ["secrets"] verbs: ["get", "list", "watch", "create", "update", "delete"] @@ -120,19 +120,22 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} helm.sh/chart: {{ template "cert-manager.chart" . }} rules: - - apiGroups: ["certmanager.k8s.io"] + - apiGroups: ["acme.cert-manager.io"] resources: ["orders", "orders/status"] verbs: ["update"] - - apiGroups: ["certmanager.k8s.io"] - resources: ["orders", "clusterissuers", "issuers", "challenges"] + - apiGroups: ["acme.cert-manager.io"] + resources: ["orders", "challenges"] verbs: ["get", "list", "watch"] - apiGroups: ["certmanager.k8s.io"] + resources: ["clusterissuers", "issuers"] + verbs: ["get", "list", "watch"] + - apiGroups: ["acme.cert-manager.io"] resources: ["challenges"] verbs: ["create", "delete"] # We require these rules to support users with the OwnerReferencesPermissionEnforcement # admission controller enabled: # https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#ownerreferencespermissionenforcement - - apiGroups: ["certmanager.k8s.io"] + - apiGroups: ["acme.cert-manager.io"] resources: ["orders/finalizers"] verbs: ["update"] - apiGroups: [""] @@ -157,12 +160,16 @@ metadata: helm.sh/chart: {{ template "cert-manager.chart" . }} rules: # Use to update challenge resource status - - apiGroups: ["certmanager.k8s.io"] + - apiGroups: ["acme.cert-manager.io"] resources: ["challenges", "challenges/status"] verbs: ["update"] + # Used to watch challenge resources + - apiGroups: ["acme.cert-manager.io"] + resources: ["challenges"] + verbs: ["get", "list", "watch"] # Used to watch challenges, issuer and clusterissuer resources - apiGroups: ["certmanager.k8s.io"] - resources: ["challenges", "issuers", "clusterissuers"] + resources: ["issuers", "clusterissuers"] verbs: ["get", "list", "watch"] # Need to be able to retrieve ACME account private key to complete challenges - apiGroups: [""] @@ -190,7 +197,7 @@ rules: # We require these rules to support users with the OwnerReferencesPermissionEnforcement # admission controller enabled: # https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#ownerreferencespermissionenforcement - - apiGroups: ["certmanager.k8s.io"] + - apiGroups: ["acme.cert-manager.io"] resources: ["challenges/finalizers"] verbs: ["update"] # DNS01 rules (duplicated above) diff --git a/deploy/manifests/00-crds.yaml b/deploy/manifests/00-crds.yaml index ff631253323..210a40eb070 100644 --- a/deploy/manifests/00-crds.yaml +++ b/deploy/manifests/00-crds.yaml @@ -4,18 +4,17 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: certificaterequests.certmanager.k8s.io + name: challenges.acme.cert-manager.io spec: additionalPrinterColumns: - - JSONPath: .status.conditions[?(@.type=="Ready")].status - name: Ready + - JSONPath: .status.state + name: State type: string - - JSONPath: .spec.issuerRef.name - name: Issuer - priority: 1 + - JSONPath: .spec.dnsName + name: Domain type: string - - JSONPath: .status.conditions[?(@.type=="Ready")].message - name: Status + - JSONPath: .status.reason + name: Reason priority: 1 type: string - JSONPath: .metadata.creationTimestamp @@ -25,19 +24,16 @@ spec: in RFC3339 form and is in UTC. name: Age type: date - group: certmanager.k8s.io + group: acme.cert-manager.io names: - kind: CertificateRequest - plural: certificaterequests - shortNames: - - cr - - crs + kind: Challenge + plural: challenges scope: Namespaced subresources: {} validation: openAPIV3Schema: - description: CertificateRequest is a type to represent a Certificate Signing - Request + description: Challenge is a type to represent a Challenge request with an ACME + server properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation @@ -52,27 +48,21 @@ spec: metadata: type: object spec: - description: CertificateRequestSpec defines the desired state of CertificateRequest properties: - csr: - description: Byte slice containing the PEM encoded CertificateSigningRequest - format: byte + authzURL: + description: AuthzURL is the URL to the ACME Authorization resource + that this challenge is a part of. type: string - duration: - description: Requested certificate default Duration + dnsName: + description: DNSName is the identifier that this challenge is for, e.g. + example.com. type: string - isCA: - description: IsCA will mark the resulting certificate as valid for signing. - This implies that the 'cert sign' usage is set - type: boolean issuerRef: - description: IssuerRef is a reference to the issuer for this CertificateRequest. If - the 'kind' field is not set, or set to 'Issuer', an Issuer resource - with the given name in the same namespace as the CertificateRequest - will be used. If the 'kind' field is set to 'ClusterIssuer', a ClusterIssuer - with the provided name will be used. The 'name' field in this stanza - is required at all times. The group field refers to the API group - of the issuer which defaults to 'certmanager.k8s.io' if empty. + description: IssuerRef references a properly configured ACME-type Issuer + which should be used to create this Challenge. If the Issuer does + not exist, processing will be retried. If the Issuer is not an 'ACME' + Issuer, an error will be returned and the Challenge will be marked + as failed. properties: group: type: string @@ -83,429 +73,14 @@ spec: required: - name type: object - usages: - description: Usages is the set of x509 actions that are enabled for - a given key. Defaults are ('digital signature', 'key encipherment') - if empty - items: - description: 'KeyUsage specifies valid usage contexts for keys. See: - https://tools.ietf.org/html/rfc5280#section-4.2.1.3 https://tools.ietf.org/html/rfc5280#section-4.2.1.12' - enum: - - signing - - digital signature - - content commitment - - key encipherment - - key agreement - - data encipherment - - cert sign - - crl sign - - encipher only - - decipher only - - any - - server auth - - client auth - - code signing - - email protection - - s/mime - - ipsec end system - - ipsec tunnel - - ipsec user - - timestamping - - ocsp signing - - microsoft sgc - - netscape sgc - type: string - type: array - required: - - issuerRef - type: object - status: - description: CertificateStatus defines the observed state of CertificateRequest - and resulting signed certificate. - properties: - ca: - description: Byte slice containing the PEM encoded certificate authority - of the signed certificate. - format: byte - type: string - certificate: - description: Byte slice containing a PEM encoded signed certificate - resulting from the given certificate signing request. - format: byte - type: string - conditions: - items: - description: CertificateRequestCondition contains condition information - for a CertificateRequest. - properties: - lastTransitionTime: - description: LastTransitionTime is the timestamp corresponding - to the last status change of this condition. - format: date-time - type: string - message: - description: Message is a human readable description of the details - of the last transition, complementing reason. - type: string - reason: - description: Reason is a brief machine readable explanation for - the condition's last transition. - type: string - status: - description: Status of the condition, one of ('True', 'False', - 'Unknown'). - enum: - - "True" - - "False" - - Unknown - type: string - type: - description: Type of the condition, currently ('Ready'). - type: string - required: - - status - - type - type: object - type: array - failureTime: - description: FailureTime stores the time that this CertificateRequest - failed. This is used to influence garbage collection and back-off. - format: date-time - type: string - type: object - type: object - versions: - - name: v1alpha2 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] ---- - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - creationTimestamp: null - name: certificates.certmanager.k8s.io -spec: - additionalPrinterColumns: - - JSONPath: .status.conditions[?(@.type=="Ready")].status - name: Ready - type: string - - JSONPath: .spec.secretName - name: Secret - type: string - - JSONPath: .spec.issuerRef.name - name: Issuer - priority: 1 - type: string - - JSONPath: .status.conditions[?(@.type=="Ready")].message - name: Status - priority: 1 - type: string - - JSONPath: .metadata.creationTimestamp - description: CreationTimestamp is a timestamp representing the server time when - this object was created. It is not guaranteed to be set in happens-before order - across separate operations. Clients may not set this value. It is represented - in RFC3339 form and is in UTC. - name: Age - type: date - group: certmanager.k8s.io - names: - kind: Certificate - plural: certificates - shortNames: - - cert - - certs - scope: Namespaced - subresources: {} - validation: - openAPIV3Schema: - description: Certificate is a type to represent a Certificate from ACME - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: CertificateSpec defines the desired state of Certificate - properties: - commonName: - description: CommonName is a common name to be used on the Certificate. - If no CommonName is given, then the first entry in DNSNames is used - as the CommonName. The CommonName should have a length of 64 characters - or fewer to avoid generating invalid CSRs; in order to have longer - domain names, set the CommonName (or first DNSNames entry) to have - 64 characters or fewer, and then add the longer domain name to DNSNames. - type: string - dnsNames: - description: DNSNames is a list of subject alt names to be used on the - Certificate. If no CommonName is given, then the first entry in DNSNames - is used as the CommonName and must have a length of 64 characters - or fewer. - items: - type: string - type: array - duration: - description: Certificate default Duration + key: + description: Key is the ACME challenge key for this challenge type: string - ipAddresses: - description: IPAddresses is a list of IP addresses to be used on the - Certificate - items: - type: string - type: array - isCA: - description: IsCA will mark this Certificate as valid for signing. This - implies that the 'cert sign' usage is set - type: boolean - issuerRef: - description: IssuerRef is a reference to the issuer for this certificate. - If the 'kind' field is not set, or set to 'Issuer', an Issuer resource - with the given name in the same namespace as the Certificate will - be used. If the 'kind' field is set to 'ClusterIssuer', a ClusterIssuer - with the provided name will be used. The 'name' field in this stanza - is required at all times. - properties: - group: - type: string - kind: - type: string - name: - type: string - required: - - name - type: object - keyAlgorithm: - description: KeyAlgorithm is the private key algorithm of the corresponding - private key for this certificate. If provided, allowed values are - either "rsa" or "ecdsa" If KeyAlgorithm is specified and KeySize is - not provided, key size of 256 will be used for "ecdsa" key algorithm - and key size of 2048 will be used for "rsa" key algorithm. - enum: - - rsa - - ecdsa - type: string - keyEncoding: - description: KeyEncoding is the private key cryptography standards (PKCS) - for this certificate's private key to be encoded in. If provided, - allowed values are "pkcs1" and "pkcs8" standing for PKCS#1 and PKCS#8, - respectively. If KeyEncoding is not specified, then PKCS#1 will be - used by default. - enum: - - pkcs1 - - pkcs8 - type: string - keySize: - description: KeySize is the key bit size of the corresponding private - key for this certificate. If provided, value must be between 2048 - and 8192 inclusive when KeyAlgorithm is empty or is set to "rsa", - and value must be one of (256, 384, 521) when KeyAlgorithm is set - to "ecdsa". - type: integer - organization: - description: Organization is the organization to be used on the Certificate - items: - type: string - type: array - renewBefore: - description: Certificate renew before expiration duration - type: string - secretName: - description: SecretName is the name of the secret resource to store - this secret in - type: string - usages: - description: Usages is the set of x509 actions that are enabled for - a given key. Defaults are ('digital signature', 'key encipherment') - if empty - items: - description: 'KeyUsage specifies valid usage contexts for keys. See: - https://tools.ietf.org/html/rfc5280#section-4.2.1.3 https://tools.ietf.org/html/rfc5280#section-4.2.1.12' - enum: - - signing - - digital signature - - content commitment - - key encipherment - - key agreement - - data encipherment - - cert sign - - crl sign - - encipher only - - decipher only - - any - - server auth - - client auth - - code signing - - email protection - - s/mime - - ipsec end system - - ipsec tunnel - - ipsec user - - timestamping - - ocsp signing - - microsoft sgc - - netscape sgc - type: string - type: array - required: - - issuerRef - - secretName - type: object - status: - description: CertificateStatus defines the observed state of Certificate - properties: - conditions: - items: - description: CertificateCondition contains condition information for - an Certificate. - properties: - lastTransitionTime: - description: LastTransitionTime is the timestamp corresponding - to the last status change of this condition. - format: date-time - type: string - message: - description: Message is a human readable description of the details - of the last transition, complementing reason. - type: string - reason: - description: Reason is a brief machine readable explanation for - the condition's last transition. - type: string - status: - description: Status of the condition, one of ('True', 'False', - 'Unknown'). - enum: - - "True" - - "False" - - Unknown - type: string - type: - description: Type of the condition, currently ('Ready'). - type: string - required: - - status - - type - type: object - type: array - lastFailureTime: - format: date-time - type: string - notAfter: - description: The expiration time of the certificate stored in the secret - named by this resource in spec.secretName. - format: date-time - type: string - type: object - type: object - versions: - - name: v1alpha2 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] ---- - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - creationTimestamp: null - name: challenges.certmanager.k8s.io -spec: - additionalPrinterColumns: - - JSONPath: .status.state - name: State - type: string - - JSONPath: .spec.dnsName - name: Domain - type: string - - JSONPath: .status.reason - name: Reason - priority: 1 - type: string - - JSONPath: .metadata.creationTimestamp - description: CreationTimestamp is a timestamp representing the server time when - this object was created. It is not guaranteed to be set in happens-before order - across separate operations. Clients may not set this value. It is represented - in RFC3339 form and is in UTC. - name: Age - type: date - group: certmanager.k8s.io - names: - kind: Challenge - plural: challenges - scope: Namespaced - subresources: {} - validation: - openAPIV3Schema: - description: Challenge is a type to represent a Challenge request with an ACME - server - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - authzURL: - description: AuthzURL is the URL to the ACME Authorization resource - that this challenge is a part of. - type: string - dnsName: - description: DNSName is the identifier that this challenge is for, e.g. - example.com. - type: string - issuerRef: - description: IssuerRef references a properly configured ACME-type Issuer - which should be used to create this Challenge. If the Issuer does - not exist, processing will be retried. If the Issuer is not an 'ACME' - Issuer, an error will be returned and the Challenge will be marked - as failed. - properties: - group: - type: string - kind: - type: string - name: - type: string - required: - - name - type: object - key: - description: Key is the ACME challenge key for this challenge - type: string - solver: - description: Solver contains the domain solving configuration that should - be used to solve this challenge resource. Only **one** of 'config' - or 'solver' may be specified, and if both are specified then no action - will be performed on the Challenge resource. + solver: + description: Solver contains the domain solving configuration that should + be used to solve this challenge resource. Only **one** of 'config' + or 'solver' may be specified, and if both are specified then no action + will be performed on the Challenge resource. properties: dns01: properties: @@ -1770,21 +1345,652 @@ spec: description: Reason contains human readable information on why the Challenge is in the current state. type: string - state: - description: State contains the current 'state' of the challenge. If - not set, the state of the challenge is unknown. - enum: - - valid - - ready - - pending - - processing - - invalid - - expired - - errored + state: + description: State contains the current 'state' of the challenge. If + not set, the state of the challenge is unknown. + enum: + - valid + - ready + - pending + - processing + - invalid + - expired + - errored + type: string + type: object + required: + - metadata + type: object + versions: + - name: v1alpha2 + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] +--- + +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: orders.acme.cert-manager.io +spec: + additionalPrinterColumns: + - JSONPath: .status.state + name: State + type: string + - JSONPath: .spec.issuerRef.name + name: Issuer + priority: 1 + type: string + - JSONPath: .status.reason + name: Reason + priority: 1 + type: string + - JSONPath: .metadata.creationTimestamp + description: CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. + name: Age + type: date + group: acme.cert-manager.io + names: + kind: Order + plural: orders + scope: Namespaced + subresources: {} + validation: + openAPIV3Schema: + description: Order is a type to represent an Order with an ACME server + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + commonName: + description: CommonName is the common name as specified on the DER encoded + CSR. If CommonName is not specified, the first DNSName specified will + be used as the CommonName. At least one of CommonName or a DNSNames + must be set. This field must match the corresponding field on the + DER encoded CSR. + type: string + csr: + description: Certificate signing request bytes in DER encoding. This + will be used when finalizing the order. This field must be set on + the order. + format: byte + type: string + dnsNames: + description: DNSNames is a list of DNS names that should be included + as part of the Order validation process. If CommonName is not specified, + the first DNSName specified will be used as the CommonName. At least + one of CommonName or a DNSNames must be set. This field must match + the corresponding field on the DER encoded CSR. + items: + type: string + type: array + issuerRef: + description: IssuerRef references a properly configured ACME-type Issuer + which should be used to create this Order. If the Issuer does not + exist, processing will be retried. If the Issuer is not an 'ACME' + Issuer, an error will be returned and the Order will be marked as + failed. + properties: + group: + type: string + kind: + type: string + name: + type: string + required: + - name + type: object + required: + - csr + - issuerRef + type: object + status: + properties: + authorizations: + description: Authorizations contains data returned from the ACME server + on what authoriations must be completed in order to validate the DNS + names specified on the Order. + items: + description: ACMEAuthorization contains data returned from the ACME + server on an authorization that must be completed in order validate + a DNS name on an ACME Order resource. + properties: + challenges: + description: Challenges specifies the challenge types offered + by the ACME server. One of these challenge types will be selected + when validating the DNS name and an appropriate Challenge resource + will be created to perform the ACME challenge process. + items: + description: Challenge specifies a challenge offered by the + ACME server for an Order. An appropriate Challenge resource + can be created to perform the ACME challenge process. + properties: + token: + description: Token is the token that must be presented for + this challenge. This is used to compute the 'key' that + must also be presented. + type: string + type: + description: Type is the type of challenge being offered, + e.g. http-01, dns-01 + type: string + url: + description: URL is the URL of this challenge. It can be + used to retrieve additional metadata about the Challenge + from the ACME server. + type: string + required: + - token + - type + - url + type: object + type: array + identifier: + description: Identifier is the DNS name to be validated as part + of this authorization + type: string + url: + description: URL is the URL of the Authorization that must be + completed + type: string + wildcard: + description: Wildcard will be true if this authorization is for + a wildcard DNS name. If this is true, the identifier will be + the *non-wildcard* version of the DNS name. For example, if + '*.example.com' is the DNS name being validated, this field + will be 'true' and the 'identifier' field will be 'example.com'. + type: boolean + required: + - url + type: object + type: array + certificate: + description: Certificate is a copy of the PEM encoded certificate for + this Order. This field will be populated after the order has been + successfully finalized with the ACME server, and the order has transitioned + to the 'valid' state. + format: byte + type: string + failureTime: + description: FailureTime stores the time that this order failed. This + is used to influence garbage collection and back-off. + format: date-time + type: string + finalizeURL: + description: FinalizeURL of the Order. This is used to obtain certificates + for this order once it has been completed. + type: string + reason: + description: Reason optionally provides more information about a why + the order is in the current state. + type: string + state: + description: State contains the current state of this Order resource. + States 'success' and 'expired' are 'final' + enum: + - valid + - ready + - pending + - processing + - invalid + - expired + - errored + type: string + url: + description: URL of the Order. This will initially be empty when the + resource is first created. The Order controller will populate this + field when the Order is first processed. This field will be immutable + after it is initially set. + type: string + type: object + required: + - metadata + type: object + versions: + - name: v1alpha2 + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] +--- + +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: certificaterequests.certmanager.k8s.io +spec: + additionalPrinterColumns: + - JSONPath: .status.conditions[?(@.type=="Ready")].status + name: Ready + type: string + - JSONPath: .spec.issuerRef.name + name: Issuer + priority: 1 + type: string + - JSONPath: .status.conditions[?(@.type=="Ready")].message + name: Status + priority: 1 + type: string + - JSONPath: .metadata.creationTimestamp + description: CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. + name: Age + type: date + group: certmanager.k8s.io + names: + kind: CertificateRequest + plural: certificaterequests + shortNames: + - cr + - crs + scope: Namespaced + subresources: {} + validation: + openAPIV3Schema: + description: CertificateRequest is a type to represent a Certificate Signing + Request + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: CertificateRequestSpec defines the desired state of CertificateRequest + properties: + csr: + description: Byte slice containing the PEM encoded CertificateSigningRequest + format: byte + type: string + duration: + description: Requested certificate default Duration + type: string + isCA: + description: IsCA will mark the resulting certificate as valid for signing. + This implies that the 'cert sign' usage is set + type: boolean + issuerRef: + description: IssuerRef is a reference to the issuer for this CertificateRequest. If + the 'kind' field is not set, or set to 'Issuer', an Issuer resource + with the given name in the same namespace as the CertificateRequest + will be used. If the 'kind' field is set to 'ClusterIssuer', a ClusterIssuer + with the provided name will be used. The 'name' field in this stanza + is required at all times. The group field refers to the API group + of the issuer which defaults to 'certmanager.k8s.io' if empty. + properties: + group: + type: string + kind: + type: string + name: + type: string + required: + - name + type: object + usages: + description: Usages is the set of x509 actions that are enabled for + a given key. Defaults are ('digital signature', 'key encipherment') + if empty + items: + description: 'KeyUsage specifies valid usage contexts for keys. See: + https://tools.ietf.org/html/rfc5280#section-4.2.1.3 https://tools.ietf.org/html/rfc5280#section-4.2.1.12' + enum: + - signing + - digital signature + - content commitment + - key encipherment + - key agreement + - data encipherment + - cert sign + - crl sign + - encipher only + - decipher only + - any + - server auth + - client auth + - code signing + - email protection + - s/mime + - ipsec end system + - ipsec tunnel + - ipsec user + - timestamping + - ocsp signing + - microsoft sgc + - netscape sgc + type: string + type: array + required: + - issuerRef + type: object + status: + description: CertificateStatus defines the observed state of CertificateRequest + and resulting signed certificate. + properties: + ca: + description: Byte slice containing the PEM encoded certificate authority + of the signed certificate. + format: byte + type: string + certificate: + description: Byte slice containing a PEM encoded signed certificate + resulting from the given certificate signing request. + format: byte + type: string + conditions: + items: + description: CertificateRequestCondition contains condition information + for a CertificateRequest. + properties: + lastTransitionTime: + description: LastTransitionTime is the timestamp corresponding + to the last status change of this condition. + format: date-time + type: string + message: + description: Message is a human readable description of the details + of the last transition, complementing reason. + type: string + reason: + description: Reason is a brief machine readable explanation for + the condition's last transition. + type: string + status: + description: Status of the condition, one of ('True', 'False', + 'Unknown'). + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: Type of the condition, currently ('Ready'). + type: string + required: + - status + - type + type: object + type: array + failureTime: + description: FailureTime stores the time that this CertificateRequest + failed. This is used to influence garbage collection and back-off. + format: date-time + type: string + type: object + type: object + versions: + - name: v1alpha2 + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] +--- + +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: certificates.certmanager.k8s.io +spec: + additionalPrinterColumns: + - JSONPath: .status.conditions[?(@.type=="Ready")].status + name: Ready + type: string + - JSONPath: .spec.secretName + name: Secret + type: string + - JSONPath: .spec.issuerRef.name + name: Issuer + priority: 1 + type: string + - JSONPath: .status.conditions[?(@.type=="Ready")].message + name: Status + priority: 1 + type: string + - JSONPath: .metadata.creationTimestamp + description: CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. + name: Age + type: date + group: certmanager.k8s.io + names: + kind: Certificate + plural: certificates + shortNames: + - cert + - certs + scope: Namespaced + subresources: {} + validation: + openAPIV3Schema: + description: Certificate is a type to represent a Certificate from ACME + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: CertificateSpec defines the desired state of Certificate + properties: + commonName: + description: CommonName is a common name to be used on the Certificate. + If no CommonName is given, then the first entry in DNSNames is used + as the CommonName. The CommonName should have a length of 64 characters + or fewer to avoid generating invalid CSRs; in order to have longer + domain names, set the CommonName (or first DNSNames entry) to have + 64 characters or fewer, and then add the longer domain name to DNSNames. + type: string + dnsNames: + description: DNSNames is a list of subject alt names to be used on the + Certificate. If no CommonName is given, then the first entry in DNSNames + is used as the CommonName and must have a length of 64 characters + or fewer. + items: + type: string + type: array + duration: + description: Certificate default Duration + type: string + ipAddresses: + description: IPAddresses is a list of IP addresses to be used on the + Certificate + items: + type: string + type: array + isCA: + description: IsCA will mark this Certificate as valid for signing. This + implies that the 'cert sign' usage is set + type: boolean + issuerRef: + description: IssuerRef is a reference to the issuer for this certificate. + If the 'kind' field is not set, or set to 'Issuer', an Issuer resource + with the given name in the same namespace as the Certificate will + be used. If the 'kind' field is set to 'ClusterIssuer', a ClusterIssuer + with the provided name will be used. The 'name' field in this stanza + is required at all times. + properties: + group: + type: string + kind: + type: string + name: + type: string + required: + - name + type: object + keyAlgorithm: + description: KeyAlgorithm is the private key algorithm of the corresponding + private key for this certificate. If provided, allowed values are + either "rsa" or "ecdsa" If KeyAlgorithm is specified and KeySize is + not provided, key size of 256 will be used for "ecdsa" key algorithm + and key size of 2048 will be used for "rsa" key algorithm. + enum: + - rsa + - ecdsa + type: string + keyEncoding: + description: KeyEncoding is the private key cryptography standards (PKCS) + for this certificate's private key to be encoded in. If provided, + allowed values are "pkcs1" and "pkcs8" standing for PKCS#1 and PKCS#8, + respectively. If KeyEncoding is not specified, then PKCS#1 will be + used by default. + enum: + - pkcs1 + - pkcs8 + type: string + keySize: + description: KeySize is the key bit size of the corresponding private + key for this certificate. If provided, value must be between 2048 + and 8192 inclusive when KeyAlgorithm is empty or is set to "rsa", + and value must be one of (256, 384, 521) when KeyAlgorithm is set + to "ecdsa". + type: integer + organization: + description: Organization is the organization to be used on the Certificate + items: + type: string + type: array + renewBefore: + description: Certificate renew before expiration duration + type: string + secretName: + description: SecretName is the name of the secret resource to store + this secret in + type: string + usages: + description: Usages is the set of x509 actions that are enabled for + a given key. Defaults are ('digital signature', 'key encipherment') + if empty + items: + description: 'KeyUsage specifies valid usage contexts for keys. See: + https://tools.ietf.org/html/rfc5280#section-4.2.1.3 https://tools.ietf.org/html/rfc5280#section-4.2.1.12' + enum: + - signing + - digital signature + - content commitment + - key encipherment + - key agreement + - data encipherment + - cert sign + - crl sign + - encipher only + - decipher only + - any + - server auth + - client auth + - code signing + - email protection + - s/mime + - ipsec end system + - ipsec tunnel + - ipsec user + - timestamping + - ocsp signing + - microsoft sgc + - netscape sgc + type: string + type: array + required: + - issuerRef + - secretName + type: object + status: + description: CertificateStatus defines the observed state of Certificate + properties: + conditions: + items: + description: CertificateCondition contains condition information for + an Certificate. + properties: + lastTransitionTime: + description: LastTransitionTime is the timestamp corresponding + to the last status change of this condition. + format: date-time + type: string + message: + description: Message is a human readable description of the details + of the last transition, complementing reason. + type: string + reason: + description: Reason is a brief machine readable explanation for + the condition's last transition. + type: string + status: + description: Status of the condition, one of ('True', 'False', + 'Unknown'). + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: Type of the condition, currently ('Ready'). + type: string + required: + - status + - type + type: object + type: array + lastFailureTime: + format: date-time + type: string + notAfter: + description: The expiration time of the certificate stored in the secret + named by this resource in spec.secretName. + format: date-time type: string type: object - required: - - metadata type: object versions: - name: v1alpha2 @@ -5045,209 +5251,3 @@ status: conditions: [] storedVersions: [] --- - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - creationTimestamp: null - name: orders.certmanager.k8s.io -spec: - additionalPrinterColumns: - - JSONPath: .status.state - name: State - type: string - - JSONPath: .spec.issuerRef.name - name: Issuer - priority: 1 - type: string - - JSONPath: .status.reason - name: Reason - priority: 1 - type: string - - JSONPath: .metadata.creationTimestamp - description: CreationTimestamp is a timestamp representing the server time when - this object was created. It is not guaranteed to be set in happens-before order - across separate operations. Clients may not set this value. It is represented - in RFC3339 form and is in UTC. - name: Age - type: date - group: certmanager.k8s.io - names: - kind: Order - plural: orders - scope: Namespaced - subresources: {} - validation: - openAPIV3Schema: - description: Order is a type to represent an Order with an ACME server - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - commonName: - description: CommonName is the common name as specified on the DER encoded - CSR. If CommonName is not specified, the first DNSName specified will - be used as the CommonName. At least one of CommonName or a DNSNames - must be set. This field must match the corresponding field on the - DER encoded CSR. - type: string - csr: - description: Certificate signing request bytes in DER encoding. This - will be used when finalizing the order. This field must be set on - the order. - format: byte - type: string - dnsNames: - description: DNSNames is a list of DNS names that should be included - as part of the Order validation process. If CommonName is not specified, - the first DNSName specified will be used as the CommonName. At least - one of CommonName or a DNSNames must be set. This field must match - the corresponding field on the DER encoded CSR. - items: - type: string - type: array - issuerRef: - description: IssuerRef references a properly configured ACME-type Issuer - which should be used to create this Order. If the Issuer does not - exist, processing will be retried. If the Issuer is not an 'ACME' - Issuer, an error will be returned and the Order will be marked as - failed. - properties: - group: - type: string - kind: - type: string - name: - type: string - required: - - name - type: object - required: - - csr - - issuerRef - type: object - status: - properties: - authorizations: - description: Authorizations contains data returned from the ACME server - on what authoriations must be completed in order to validate the DNS - names specified on the Order. - items: - description: ACMEAuthorization contains data returned from the ACME - server on an authorization that must be completed in order validate - a DNS name on an ACME Order resource. - properties: - challenges: - description: Challenges specifies the challenge types offered - by the ACME server. One of these challenge types will be selected - when validating the DNS name and an appropriate Challenge resource - will be created to perform the ACME challenge process. - items: - description: Challenge specifies a challenge offered by the - ACME server for an Order. An appropriate Challenge resource - can be created to perform the ACME challenge process. - properties: - token: - description: Token is the token that must be presented for - this challenge. This is used to compute the 'key' that - must also be presented. - type: string - type: - description: Type is the type of challenge being offered, - e.g. http-01, dns-01 - type: string - url: - description: URL is the URL of this challenge. It can be - used to retrieve additional metadata about the Challenge - from the ACME server. - type: string - required: - - token - - type - - url - type: object - type: array - identifier: - description: Identifier is the DNS name to be validated as part - of this authorization - type: string - url: - description: URL is the URL of the Authorization that must be - completed - type: string - wildcard: - description: Wildcard will be true if this authorization is for - a wildcard DNS name. If this is true, the identifier will be - the *non-wildcard* version of the DNS name. For example, if - '*.example.com' is the DNS name being validated, this field - will be 'true' and the 'identifier' field will be 'example.com'. - type: boolean - required: - - url - type: object - type: array - certificate: - description: Certificate is a copy of the PEM encoded certificate for - this Order. This field will be populated after the order has been - successfully finalized with the ACME server, and the order has transitioned - to the 'valid' state. - format: byte - type: string - failureTime: - description: FailureTime stores the time that this order failed. This - is used to influence garbage collection and back-off. - format: date-time - type: string - finalizeURL: - description: FinalizeURL of the Order. This is used to obtain certificates - for this order once it has been completed. - type: string - reason: - description: Reason optionally provides more information about a why - the order is in the current state. - type: string - state: - description: State contains the current state of this Order resource. - States 'success' and 'expired' are 'final' - enum: - - valid - - ready - - pending - - processing - - invalid - - expired - - errored - type: string - url: - description: URL of the Order. This will initially be empty when the - resource is first created. The Order controller will populate this - field when the Order is first processed. This field will be immutable - after it is initially set. - type: string - type: object - required: - - metadata - type: object - versions: - - name: v1alpha2 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] ---- diff --git a/docs/generated/reference/generate/config.yaml b/docs/generated/reference/generate/config.yaml index d6d63b20ab5..03ce31d9757 100644 --- a/docs/generated/reference/generate/config.yaml +++ b/docs/generated/reference/generate/config.yaml @@ -1,6 +1,7 @@ example_location: "examples" api_groups: - "Certmanager" + - "ACME" resource_categories: - name: "Certmanager" include: "certmanager" @@ -14,9 +15,12 @@ resource_categories: - name: "Issuer" version: "v1alpha2" group: "certmanager" - - name: "Order" - version: "v1alpha2" - group: "certmanager" - - name: "Challenge" - version: "v1alpha2" - group: "certmanager" +- name: "ACME" + include: "acme" + resources: + - name: "Order" + version: "v1alpha2" + group: "acme" + - name: "Challenge" + version: "v1alpha2" + group: "acme" diff --git a/docs/generated/reference/generate/go_openapi/BUILD.bazel b/docs/generated/reference/generate/go_openapi/BUILD.bazel index 0acfebdd9e7..1f2448dec64 100644 --- a/docs/generated/reference/generate/go_openapi/BUILD.bazel +++ b/docs/generated/reference/generate/go_openapi/BUILD.bazel @@ -10,10 +10,12 @@ openapi_library( go_prefix = "github.com/jetstack/cert-manager/", openapi_targets = [ "pkg/apis/certmanager/v1alpha2", + "pkg/apis/acme/v1alpha2", "pkg/apis/meta/v1", ], tags = ["docs"], vendor_targets = [ + "k8s.io/api/core/v1", "k8s.io/apimachinery/pkg/apis/meta/v1", "k8s.io/apimachinery/pkg/runtime", "k8s.io/apimachinery/pkg/version", diff --git a/docs/generated/reference/output/reference/api-docs/index.html b/docs/generated/reference/output/reference/api-docs/index.html index 52038a8fd9b..00489ea2f3b 100755 --- a/docs/generated/reference/output/reference/api-docs/index.html +++ b/docs/generated/reference/output/reference/api-docs/index.html @@ -11,7 +11,7 @@ - +

cert-manager

@@ -310,6 +310,8 @@

IssuerStatus v1alpha2

+

Acme

+

Order v1alpha2

@@ -321,7 +323,7 @@

Order v1alpha2

- + @@ -442,7 +444,7 @@

Challenge v1alpha2

- + @@ -574,7 +576,7 @@

ACMEAuthorization v1alpha2

- + @@ -621,7 +623,7 @@

ACMEChallenge v1alpha2

- + @@ -664,7 +666,7 @@

ACMEChallengeSolver v1alpha2

- + @@ -707,7 +709,7 @@

ACMEChallengeSolverDNS01 v1alpha2

- + @@ -777,7 +779,7 @@

ACMEChallengeSolverHTTP01 v1alpha2

- + @@ -812,7 +814,7 @@

ACMEChallengeSolverHTTP01Ingr

- + @@ -858,7 +860,7 @@

ACMEChallengeSolverHTT

- + @@ -878,7 +880,7 @@

ACMEChallengeSolverHTT

- + @@ -886,7 +888,7 @@

ACMEChallengeSolverHTT

- +
certmanageracme v1alpha2 Order
certmanageracme v1alpha2 Challenge
certmanageracme v1alpha2 ACMEAuthorization
certmanageracme v1alpha2 ACMEChallenge
certmanageracme v1alpha2 ACMEChallengeSolver
certmanageracme v1alpha2 ACMEChallengeSolverDNS01
certmanageracme v1alpha2 ACMEChallengeSolverHTTP01
certmanageracme v1alpha2 ACMEChallengeSolverHTTP01Ingress
certmanageracme v1alpha2 ACMEChallengeSolverHTTP01IngressPodSpec
affinity
Affinity
affinity
*Affinity*
If specified, the pod's scheduling constraints
NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
tolerations
Toleration array
tolerations
*Toleration array*
If specified, the pod's tolerations.
@@ -900,7 +902,7 @@

ACMEChallengeSolve -certmanager +acme v1alpha2 ACMEChallengeSolverHTTP01IngressPodTemplate @@ -938,7 +940,7 @@

ACMEIssuer v1alpha2

-certmanager +acme v1alpha2 ACMEIssuer @@ -989,7 +991,7 @@

ACMEIssuerDNS01ProviderAcmeDNS -certmanager +acme v1alpha2 ACMEIssuerDNS01ProviderAcmeDNS @@ -1028,7 +1030,7 @@

ACMEIssuerDNS01ProviderAkamai v1 -certmanager +acme v1alpha2 ACMEIssuerDNS01ProviderAkamai @@ -1075,7 +1077,7 @@

ACMEIssuerDNS01ProviderAzureDN -certmanager +acme v1alpha2 ACMEIssuerDNS01ProviderAzureDNS @@ -1134,7 +1136,7 @@

ACMEIssuerDNS01ProviderCloudDN -certmanager +acme v1alpha2 ACMEIssuerDNS01ProviderCloudDNS @@ -1173,7 +1175,7 @@

ACMEIssuerDNS01ProviderCloud -certmanager +acme v1alpha2 ACMEIssuerDNS01ProviderCloudflare @@ -1212,7 +1214,7 @@

ACMEIssuerDNS01ProviderDig -certmanager +acme v1alpha2 ACMEIssuerDNS01ProviderDigitalOcean @@ -1247,7 +1249,7 @@

ACMEIssuerDNS01ProviderRFC2136 -certmanager +acme v1alpha2 ACMEIssuerDNS01ProviderRFC2136 @@ -1294,7 +1296,7 @@

ACMEIssuerDNS01ProviderRoute53 -certmanager +acme v1alpha2 ACMEIssuerDNS01ProviderRoute53 @@ -1345,7 +1347,7 @@

ACMEIssuerDNS01ProviderWebhook -certmanager +acme v1alpha2 ACMEIssuerDNS01ProviderWebhook @@ -1378,6 +1380,49 @@

ACMEIssuerDNS01ProviderWebhook The name of the solver to use, as defined in the webhook provider implementation. This will typically be the name of the provider, e.g. 'cloudflare'. +

Affinity v1

+ + + + + + + + + + + + + +
GroupVersionKind
corev1Affinity
+

Affinity is a group of affinity scheduling rules.

+ + + + + + + + + + + + + + + + + + + + + +
FieldDescription
nodeAffinity
*NodeAffinity*
Describes node affinity scheduling rules for the pod.
podAffinity
*PodAffinity*
Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).
podAntiAffinity
*PodAntiAffinity*
Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).

CAIssuer v1alpha2

@@ -1473,7 +1518,7 @@

CertificateDNSNameSelector v1alpha2

- + @@ -1621,6 +1666,88 @@

IssuerCondition v1alpha2

certmanageracme v1alpha2 CertificateDNSNameSelector
Type of the condition, currently ('Ready').
+

LabelSelector v1

+ + + + + + + + + + + + + +
GroupVersionKind
metav1LabelSelector
+

A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.

+ + + + + + + + + + + + + + + + + +
FieldDescription
matchExpressions
*LabelSelectorRequirement array*
matchExpressions is a list of label selector requirements. The requirements are ANDed.
matchLabels
object
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
+

LabelSelectorRequirement v1

+ + + + + + + + + + + + + +
GroupVersionKind
metav1LabelSelectorRequirement
+

A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.

+ + + + + + + + + + + + + + + + + + + + + +
FieldDescription
key
string
patch type: merge
patch merge key: key
key is the label key that the selector applies to.
operator
string
operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
values
string array
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.

LocalObjectReference v1

@@ -1710,6 +1837,163 @@

ManagedFieldsEntry v1

Time is timestamp of when these fields were set. It should always be empty if Operation is 'Apply'
+

NodeAffinity v1

+ + + + + + + + + + + + + +
GroupVersionKind
corev1NodeAffinity
+

Node affinity is a group of node affinity scheduling rules.

+ + + + + + + + + + + + + + + + + +
FieldDescription
preferredDuringSchedulingIgnoredDuringExecution
*PreferredSchedulingTerm array*
The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.
requiredDuringSchedulingIgnoredDuringExecution
*NodeSelector*
If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.
+

NodeSelector v1

+ + + + + + + + + + + + + +
GroupVersionKind
corev1NodeSelector
+

A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.

+ + + + + + + + + + + + + +
FieldDescription
nodeSelectorTerms
*NodeSelectorTerm array*
Required. A list of node selector terms. The terms are ORed.
+

NodeSelectorRequirement v1

+ + + + + + + + + + + + + +
GroupVersionKind
corev1NodeSelectorRequirement
+

A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.

+ + + + + + + + + + + + + + + + + + + + + +
FieldDescription
key
string
The label key that the selector applies to.
operator
string
Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
values
string array
An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.
+

NodeSelectorTerm v1

+ + + + + + + + + + + + + +
GroupVersionKind
corev1NodeSelectorTerm
+

A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.

+ + + + + + + + + + + + + + + + + +
FieldDescription
matchExpressions
*NodeSelectorRequirement array*
A list of node selector requirements by node's labels.
matchFields
*NodeSelectorRequirement array*
A list of node selector requirements by node's fields.

ObjectMeta v1

@@ -1910,6 +2194,168 @@

OwnerReference v1

UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids
+

PodAffinity v1

+ + + + + + + + + + + + + +
GroupVersionKind
corev1PodAffinity
+

Pod affinity is a group of inter pod affinity scheduling rules.

+ + + + + + + + + + + + + + + + + +
FieldDescription
preferredDuringSchedulingIgnoredDuringExecution
*WeightedPodAffinityTerm array*
The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.
requiredDuringSchedulingIgnoredDuringExecution
*PodAffinityTerm array*
If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.
+

PodAffinityTerm v1

+ + + + + + + + + + + + + +
GroupVersionKind
corev1PodAffinityTerm
+

Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key <topologyKey> matches that of any node on which a pod of the set of pods is running

+ + + + + + + + + + + + + + + + + + + + + +
FieldDescription
labelSelector
*LabelSelector*
A label query over a set of resources, in this case pods.
namespaces
string array
namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means "this pod's namespace"
topologyKey
string
This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.
+

PodAntiAffinity v1

+ + + + + + + + + + + + + +
GroupVersionKind
corev1PodAntiAffinity
+

Pod anti affinity is a group of inter pod anti affinity scheduling rules.

+ + + + + + + + + + + + + + + + + +
FieldDescription
preferredDuringSchedulingIgnoredDuringExecution
*WeightedPodAffinityTerm array*
The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.
requiredDuringSchedulingIgnoredDuringExecution
*PodAffinityTerm array*
If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.
+

PreferredSchedulingTerm v1

+ + + + + + + + + + + + + +
GroupVersionKind
corev1PreferredSchedulingTerm
+

An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).

+ + + + + + + + + + + + + + + + + +
FieldDescription
preference
*NodeSelectorTerm*
A node selector term, associated with the corresponding weight.
weight
integer
Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.

SecretKeySelector v1

@@ -2025,6 +2471,57 @@

Time v1

+

Toleration v1

+ + + + + + + + + + + + + +
GroupVersionKind
corev1Toleration
+

The pod this Toleration is attached to tolerates any taint that matches the triple <key,value,effect> using the matching operator <operator>.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
effect
string
Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
key
string
Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.
operator
string
Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.
tolerationSeconds
integer
TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.
value
string
Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.

VaultAppRole v1alpha2

@@ -2278,6 +2775,46 @@

VenafiTPP v1alpha2

URL is the base URL for the Venafi TPP instance
+

WeightedPodAffinityTerm v1

+ + + + + + + + + + + + + +
GroupVersionKind
corev1WeightedPodAffinityTerm
+

The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)

+ + + + + + + + + + + + + + + + + +
FieldDescription
podAffinityTerm
*PodAffinityTerm*
Required. A pod affinity term, associated with the corresponding weight.
weight
integer
weight associated with matching the corresponding podAffinityTerm, in the range 1-100.
diff --git a/docs/generated/reference/output/reference/api-docs/navData.js b/docs/generated/reference/output/reference/api-docs/navData.js index 7b7b3fa0b67..6551bab3447 100755 --- a/docs/generated/reference/output/reference/api-docs/navData.js +++ b/docs/generated/reference/output/reference/api-docs/navData.js @@ -1 +1 @@ -(function(){navData = {"toc":[{"section":"-strong-field-definitions-strong-","subsections":[{"section":"venafitpp-v1alpha2"},{"section":"venafiissuer-v1alpha2"},{"section":"venaficloud-v1alpha2"},{"section":"vaultissuer-v1alpha2"},{"section":"vaultauth-v1alpha2"},{"section":"vaultapprole-v1alpha2"},{"section":"time-v1"},{"section":"selfsignedissuer-v1alpha2"},{"section":"secretkeyselector-v1"},{"section":"ownerreference-v1"},{"section":"objectreference-v1"},{"section":"objectmeta-v1"},{"section":"managedfieldsentry-v1"},{"section":"localobjectreference-v1"},{"section":"issuercondition-v1alpha2"},{"section":"fieldsv1-v1"},{"section":"duration-v1"},{"section":"certificatednsnameselector-v1alpha2"},{"section":"certificatecondition-v1alpha2"},{"section":"caissuer-v1alpha2"},{"section":"acmeissuerdns01providerwebhook-v1alpha2"},{"section":"acmeissuerdns01providerroute53-v1alpha2"},{"section":"acmeissuerdns01providerrfc2136-v1alpha2"},{"section":"acmeissuerdns01providerdigitalocean-v1alpha2"},{"section":"acmeissuerdns01providercloudflare-v1alpha2"},{"section":"acmeissuerdns01providerclouddns-v1alpha2"},{"section":"acmeissuerdns01providerazuredns-v1alpha2"},{"section":"acmeissuerdns01providerakamai-v1alpha2"},{"section":"acmeissuerdns01provideracmedns-v1alpha2"},{"section":"acmeissuer-v1alpha2"},{"section":"acmechallengesolverhttp01ingresspodtemplate-v1alpha2"},{"section":"acmechallengesolverhttp01ingresspodspec-v1alpha2"},{"section":"acmechallengesolverhttp01ingress-v1alpha2"},{"section":"acmechallengesolverhttp01-v1alpha2"},{"section":"acmechallengesolverdns01-v1alpha2"},{"section":"acmechallengesolver-v1alpha2"},{"section":"acmechallenge-v1alpha2"},{"section":"acmeauthorization-v1alpha2"}]},{"section":"-strong-old-api-versions-strong-","subsections":[]},{"section":"challenge-v1alpha2","subsections":[]},{"section":"order-v1alpha2","subsections":[]},{"section":"issuer-v1alpha2","subsections":[]},{"section":"clusterissuer-v1alpha2","subsections":[]},{"section":"certificate-v1alpha2","subsections":[]},{"section":"-strong-cert-manager-strong-","subsections":[]}],"flatToc":["venafitpp-v1alpha2","venafiissuer-v1alpha2","venaficloud-v1alpha2","vaultissuer-v1alpha2","vaultauth-v1alpha2","vaultapprole-v1alpha2","time-v1","selfsignedissuer-v1alpha2","secretkeyselector-v1","ownerreference-v1","objectreference-v1","objectmeta-v1","managedfieldsentry-v1","localobjectreference-v1","issuercondition-v1alpha2","fieldsv1-v1","duration-v1","certificatednsnameselector-v1alpha2","certificatecondition-v1alpha2","caissuer-v1alpha2","acmeissuerdns01providerwebhook-v1alpha2","acmeissuerdns01providerroute53-v1alpha2","acmeissuerdns01providerrfc2136-v1alpha2","acmeissuerdns01providerdigitalocean-v1alpha2","acmeissuerdns01providercloudflare-v1alpha2","acmeissuerdns01providerclouddns-v1alpha2","acmeissuerdns01providerazuredns-v1alpha2","acmeissuerdns01providerakamai-v1alpha2","acmeissuerdns01provideracmedns-v1alpha2","acmeissuer-v1alpha2","acmechallengesolverhttp01ingresspodtemplate-v1alpha2","acmechallengesolverhttp01ingresspodspec-v1alpha2","acmechallengesolverhttp01ingress-v1alpha2","acmechallengesolverhttp01-v1alpha2","acmechallengesolverdns01-v1alpha2","acmechallengesolver-v1alpha2","acmechallenge-v1alpha2","acmeauthorization-v1alpha2","-strong-field-definitions-strong-","-strong-old-api-versions-strong-","challenge-v1alpha2","order-v1alpha2","issuer-v1alpha2","clusterissuer-v1alpha2","certificate-v1alpha2","-strong-cert-manager-strong-"]};})(); \ No newline at end of file +(function(){navData = {"toc":[{"section":"-strong-field-definitions-strong-","subsections":[{"section":"weightedpodaffinityterm-v1"},{"section":"venafitpp-v1alpha2"},{"section":"venafiissuer-v1alpha2"},{"section":"venaficloud-v1alpha2"},{"section":"vaultissuer-v1alpha2"},{"section":"vaultauth-v1alpha2"},{"section":"vaultapprole-v1alpha2"},{"section":"toleration-v1"},{"section":"time-v1"},{"section":"selfsignedissuer-v1alpha2"},{"section":"secretkeyselector-v1"},{"section":"preferredschedulingterm-v1"},{"section":"podantiaffinity-v1"},{"section":"podaffinityterm-v1"},{"section":"podaffinity-v1"},{"section":"ownerreference-v1"},{"section":"objectreference-v1"},{"section":"objectmeta-v1"},{"section":"nodeselectorterm-v1"},{"section":"nodeselectorrequirement-v1"},{"section":"nodeselector-v1"},{"section":"nodeaffinity-v1"},{"section":"managedfieldsentry-v1"},{"section":"localobjectreference-v1"},{"section":"labelselectorrequirement-v1"},{"section":"labelselector-v1"},{"section":"issuercondition-v1alpha2"},{"section":"fieldsv1-v1"},{"section":"duration-v1"},{"section":"certificatednsnameselector-v1alpha2"},{"section":"certificatecondition-v1alpha2"},{"section":"caissuer-v1alpha2"},{"section":"affinity-v1"},{"section":"acmeissuerdns01providerwebhook-v1alpha2"},{"section":"acmeissuerdns01providerroute53-v1alpha2"},{"section":"acmeissuerdns01providerrfc2136-v1alpha2"},{"section":"acmeissuerdns01providerdigitalocean-v1alpha2"},{"section":"acmeissuerdns01providercloudflare-v1alpha2"},{"section":"acmeissuerdns01providerclouddns-v1alpha2"},{"section":"acmeissuerdns01providerazuredns-v1alpha2"},{"section":"acmeissuerdns01providerakamai-v1alpha2"},{"section":"acmeissuerdns01provideracmedns-v1alpha2"},{"section":"acmeissuer-v1alpha2"},{"section":"acmechallengesolverhttp01ingresspodtemplate-v1alpha2"},{"section":"acmechallengesolverhttp01ingresspodspec-v1alpha2"},{"section":"acmechallengesolverhttp01ingress-v1alpha2"},{"section":"acmechallengesolverhttp01-v1alpha2"},{"section":"acmechallengesolverdns01-v1alpha2"},{"section":"acmechallengesolver-v1alpha2"},{"section":"acmechallenge-v1alpha2"},{"section":"acmeauthorization-v1alpha2"}]},{"section":"-strong-old-api-versions-strong-","subsections":[]},{"section":"challenge-v1alpha2","subsections":[]},{"section":"order-v1alpha2","subsections":[]},{"section":"-strong-acme-strong-","subsections":[]},{"section":"issuer-v1alpha2","subsections":[]},{"section":"clusterissuer-v1alpha2","subsections":[]},{"section":"certificate-v1alpha2","subsections":[]},{"section":"-strong-cert-manager-strong-","subsections":[]}],"flatToc":["weightedpodaffinityterm-v1","venafitpp-v1alpha2","venafiissuer-v1alpha2","venaficloud-v1alpha2","vaultissuer-v1alpha2","vaultauth-v1alpha2","vaultapprole-v1alpha2","toleration-v1","time-v1","selfsignedissuer-v1alpha2","secretkeyselector-v1","preferredschedulingterm-v1","podantiaffinity-v1","podaffinityterm-v1","podaffinity-v1","ownerreference-v1","objectreference-v1","objectmeta-v1","nodeselectorterm-v1","nodeselectorrequirement-v1","nodeselector-v1","nodeaffinity-v1","managedfieldsentry-v1","localobjectreference-v1","labelselectorrequirement-v1","labelselector-v1","issuercondition-v1alpha2","fieldsv1-v1","duration-v1","certificatednsnameselector-v1alpha2","certificatecondition-v1alpha2","caissuer-v1alpha2","affinity-v1","acmeissuerdns01providerwebhook-v1alpha2","acmeissuerdns01providerroute53-v1alpha2","acmeissuerdns01providerrfc2136-v1alpha2","acmeissuerdns01providerdigitalocean-v1alpha2","acmeissuerdns01providercloudflare-v1alpha2","acmeissuerdns01providerclouddns-v1alpha2","acmeissuerdns01providerazuredns-v1alpha2","acmeissuerdns01providerakamai-v1alpha2","acmeissuerdns01provideracmedns-v1alpha2","acmeissuer-v1alpha2","acmechallengesolverhttp01ingresspodtemplate-v1alpha2","acmechallengesolverhttp01ingresspodspec-v1alpha2","acmechallengesolverhttp01ingress-v1alpha2","acmechallengesolverhttp01-v1alpha2","acmechallengesolverdns01-v1alpha2","acmechallengesolver-v1alpha2","acmechallenge-v1alpha2","acmeauthorization-v1alpha2","-strong-field-definitions-strong-","-strong-old-api-versions-strong-","challenge-v1alpha2","order-v1alpha2","-strong-acme-strong-","issuer-v1alpha2","clusterissuer-v1alpha2","certificate-v1alpha2","-strong-cert-manager-strong-"]};})(); \ No newline at end of file diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 2e2b1f69c24..5287b5b5485 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -45,7 +45,7 @@ generate-groups.sh "deepcopy" \ generate-groups.sh "deepcopy,client,informer,lister" \ github.com/jetstack/cert-manager/pkg/client \ github.com/jetstack/cert-manager/pkg/apis \ - "certmanager:v1alpha2" \ + "certmanager:v1alpha2 acme:v1alpha2" \ --output-base "${GOPATH}/src/" \ --go-header-file "${runfiles}/hack/boilerplate/boilerplate.go.txt" @@ -54,7 +54,7 @@ generate-groups-internal.sh "deepcopy,defaulter,conversion" \ github.com/jetstack/cert-manager/pkg/client \ github.com/jetstack/cert-manager/pkg/internal/apis \ github.com/jetstack/cert-manager/pkg/internal/apis \ - "certmanager:v1alpha2 meta:v1" \ + "certmanager:v1alpha2 acme:v1alpha2 meta:v1" \ --output-base "${GOPATH}/src/" \ --go-header-file "${runfiles}/hack/boilerplate/boilerplate.go.txt" diff --git a/pkg/acme/BUILD.bazel b/pkg/acme/BUILD.bazel index 5bc22727237..306860e11d4 100644 --- a/pkg/acme/BUILD.bazel +++ b/pkg/acme/BUILD.bazel @@ -12,6 +12,7 @@ go_library( deps = [ "//pkg/acme/client:go_default_library", "//pkg/acme/client/middleware:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", "//pkg/util:go_default_library", diff --git a/pkg/acme/cache.go b/pkg/acme/cache.go index 5ab6c00d64e..ce59a3adc52 100644 --- a/pkg/acme/cache.go +++ b/pkg/acme/cache.go @@ -28,6 +28,7 @@ import ( acme "github.com/jetstack/cert-manager/pkg/acme/client" acmemw "github.com/jetstack/cert-manager/pkg/acme/client/middleware" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" "github.com/jetstack/cert-manager/pkg/util" acmecl "github.com/jetstack/cert-manager/third_party/crypto/acme" @@ -66,7 +67,7 @@ type repoKey struct { exponent int } -func lookupClient(spec *cmapi.ACMEIssuer, pk *rsa.PrivateKey) *acmecl.Client { +func lookupClient(spec *cmacme.ACMEIssuer, pk *rsa.PrivateKey) *acmecl.Client { clientRepoMu.Lock() defer clientRepoMu.Unlock() if clientRepo == nil { diff --git a/pkg/acme/util.go b/pkg/acme/util.go index c3650d22046..27b636e59f9 100644 --- a/pkg/acme/util.go +++ b/pkg/acme/util.go @@ -19,7 +19,7 @@ package acme import ( corev1 "k8s.io/api/core/v1" - cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" ) @@ -27,17 +27,17 @@ import ( // This is either one of 'ready', 'invalid' or 'expired'. // The 'valid' state is a special case, as it is a final state for Challenges but // not for Orders. -func IsFinalState(s cmapi.State) bool { +func IsFinalState(s cmacme.State) bool { switch s { - case cmapi.Valid: + case cmacme.Valid: return true } return IsFailureState(s) } -func IsFailureState(s cmapi.State) bool { +func IsFailureState(s cmacme.State) bool { switch s { - case cmapi.Invalid, cmapi.Expired, cmapi.Errored: + case cmacme.Invalid, cmacme.Expired, cmacme.Errored: return true } return false diff --git a/pkg/api/BUILD.bazel b/pkg/api/BUILD.bazel index ac60ccbb6f9..5a483f69c71 100644 --- a/pkg/api/BUILD.bazel +++ b/pkg/api/BUILD.bazel @@ -7,6 +7,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/acme/webhook/apis/acme/v1alpha1:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1:go_default_library", diff --git a/pkg/api/scheme.go b/pkg/api/scheme.go index b8bf3b01823..e4ddc715cc9 100644 --- a/pkg/api/scheme.go +++ b/pkg/api/scheme.go @@ -27,6 +27,7 @@ import ( apireg "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1" whapi "github.com/jetstack/cert-manager/pkg/acme/webhook/apis/acme/v1alpha1" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" ) @@ -45,6 +46,7 @@ var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ cmapi.AddToScheme, + cmacme.AddToScheme, cmmeta.AddToScheme, whapi.AddToScheme, kscheme.AddToScheme, diff --git a/pkg/apis/BUILD.bazel b/pkg/apis/BUILD.bazel index fd2648b1e75..3f8faaffbc6 100644 --- a/pkg/apis/BUILD.bazel +++ b/pkg/apis/BUILD.bazel @@ -18,6 +18,7 @@ filegroup( name = "all-srcs", srcs = [ ":package-srcs", + "//pkg/apis/acme:all-srcs", "//pkg/apis/certmanager:all-srcs", "//pkg/apis/meta:all-srcs", ], diff --git a/pkg/apis/acme/BUILD.bazel b/pkg/apis/acme/BUILD.bazel new file mode 100644 index 00000000000..089c5cfb347 --- /dev/null +++ b/pkg/apis/acme/BUILD.bazel @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["doc.go"], + importpath = "github.com/jetstack/cert-manager/pkg/apis/acme", + visibility = ["//visibility:public"], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [ + ":package-srcs", + "//pkg/apis/acme/v1alpha2:all-srcs", + ], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/pkg/apis/acme/doc.go b/pkg/apis/acme/doc.go new file mode 100644 index 00000000000..5b1c057c4d5 --- /dev/null +++ b/pkg/apis/acme/doc.go @@ -0,0 +1,22 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +groupName=acme.cert-manager.io + +// Package acme contains types in the acme cert-manager API group +package acme + +const GroupName = "acme.cert-manager.io" diff --git a/pkg/apis/acme/v1alpha2/BUILD.bazel b/pkg/apis/acme/v1alpha2/BUILD.bazel new file mode 100644 index 00000000000..e9fae8f4983 --- /dev/null +++ b/pkg/apis/acme/v1alpha2/BUILD.bazel @@ -0,0 +1,40 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "const.go", + "doc.go", + "register.go", + "types.go", + "types_challenge.go", + "types_issuer.go", + "types_order.go", + "zz_generated.deepcopy.go", + ], + importpath = "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2", + visibility = ["//visibility:public"], + deps = [ + "//pkg/apis/acme:go_default_library", + "//pkg/apis/meta/v1:go_default_library", + "//vendor/k8s.io/api/core/v1:go_default_library", + "//vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/pkg/apis/acme/v1alpha2/const.go b/pkg/apis/acme/v1alpha2/const.go new file mode 100644 index 00000000000..2e7a50c6e76 --- /dev/null +++ b/pkg/apis/acme/v1alpha2/const.go @@ -0,0 +1,21 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha2 + +const ( + ACMEFinalizer = "finalizer.acme.cert-manager.io" +) diff --git a/pkg/apis/acme/v1alpha2/doc.go b/pkg/apis/acme/v1alpha2/doc.go new file mode 100644 index 00000000000..ebd0b36a7f5 --- /dev/null +++ b/pkg/apis/acme/v1alpha2/doc.go @@ -0,0 +1,24 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=github.com/jetstack/cert-manager/pkg/apis/acme +// +k8s:openapi-gen=true +// +k8s:defaulter-gen=TypeMeta + +// Package v1alpha2 is the v1alpha2 version of the API. +// +groupName=acme.cert-manager.io +package v1alpha2 diff --git a/pkg/apis/acme/v1alpha2/register.go b/pkg/apis/acme/v1alpha2/register.go new file mode 100644 index 00000000000..ebfa423132e --- /dev/null +++ b/pkg/apis/acme/v1alpha2/register.go @@ -0,0 +1,58 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/jetstack/cert-manager/pkg/apis/acme" +) + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: acme.GroupName, Version: "v1alpha2"} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + SchemeBuilder runtime.SchemeBuilder + localSchemeBuilder = &SchemeBuilder + AddToScheme = localSchemeBuilder.AddToScheme +) + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addKnownTypes) +} + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &Order{}, + &OrderList{}, + &Challenge{}, + &ChallengeList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/pkg/apis/acme/v1alpha2/types.go b/pkg/apis/acme/v1alpha2/types.go new file mode 100644 index 00000000000..72a7211f378 --- /dev/null +++ b/pkg/apis/acme/v1alpha2/types.go @@ -0,0 +1,38 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha2 + +const ( + // If this annotation is specified on a Certificate or Order resource when + // using the HTTP01 solver type, the ingress.name field of the HTTP01 + // solver's configuration will be set to the value given here. + // This is especially useful for users of Ingress controllers that maintain + // a 1:1 mapping between endpoint IP and Ingress resource. + ACMECertificateHTTP01IngressNameOverride = "acme.cert-manager.io/http01-override-ingress-name" + + // If this annotation is specified on a Certificate or Order resource when + // using the HTTP01 solver type, the ingress.class field of the HTTP01 + // solver's configuration will be set to the value given here. + // This is especially useful for users deploying many different ingress + // 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" +) + +const ( + OrderKind = "Order" +) diff --git a/pkg/apis/certmanager/v1alpha2/types_challenge.go b/pkg/apis/acme/v1alpha2/types_challenge.go similarity index 96% rename from pkg/apis/certmanager/v1alpha2/types_challenge.go rename to pkg/apis/acme/v1alpha2/types_challenge.go index 6a68dee02f8..a1285c1a337 100644 --- a/pkg/apis/certmanager/v1alpha2/types_challenge.go +++ b/pkg/apis/acme/v1alpha2/types_challenge.go @@ -22,9 +22,6 @@ import ( cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" ) -// TODO: these types should be moved into their own API group once we have a loose -// coupling between ACME Issuers and their solver configurations (see: Solver proposal) - // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/acme/v1alpha2/types_issuer.go b/pkg/apis/acme/v1alpha2/types_issuer.go new file mode 100644 index 00000000000..470fdb59143 --- /dev/null +++ b/pkg/apis/acme/v1alpha2/types_issuer.go @@ -0,0 +1,373 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha2 + +import ( + corev1 "k8s.io/api/core/v1" + apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" +) + +// ACMEIssuer contains the specification for an ACME issuer +type ACMEIssuer struct { + // Email is the email for this account + // +optional + Email string `json:"email,omitempty"` + + // Server is the ACME server URL + Server string `json:"server"` + + // If true, skip verifying the ACME server TLS certificate + // +optional + SkipTLSVerify bool `json:"skipTLSVerify,omitempty"` + + // PrivateKey is the name of a secret containing the private key for this + // user account. + PrivateKey cmmeta.SecretKeySelector `json:"privateKeySecretRef"` + + // Solvers is a list of challenge solvers that will be used to solve + // ACME challenges for the matching domains. + // +optional + Solvers []ACMEChallengeSolver `json:"solvers,omitempty"` +} + +type ACMEChallengeSolver struct { + // Selector selects a set of DNSNames on the Certificate resource that + // should be solved using this challenge solver. + Selector *CertificateDNSNameSelector `json:"selector,omitempty"` + + // +optional + HTTP01 *ACMEChallengeSolverHTTP01 `json:"http01,omitempty"` + + // +optional + DNS01 *ACMEChallengeSolverDNS01 `json:"dns01,omitempty"` +} + +// CertificateDomainSelector selects certificates using a label selector, and +// can optionally select individual DNS names within those certificates. +// If both MatchLabels and DNSNames are empty, this selector will match all +// certificates and DNS names within them. +type CertificateDNSNameSelector struct { + // A label selector that is used to refine the set of certificate's that + // this challenge solver will apply to. + // +optional + MatchLabels map[string]string `json:"matchLabels,omitempty"` + + // List of DNSNames that this solver will be used to solve. + // If specified and a match is found, a dnsNames selector will take + // precedence over a dnsZones selector. + // If multiple solvers match with the same dnsNames value, the solver + // with the most matching labels in matchLabels will be selected. + // If neither has more matches, the solver defined earlier in the list + // will be selected. + // +optional + DNSNames []string `json:"dnsNames,omitempty"` + + // List of DNSZones that this solver will be used to solve. + // The most specific DNS zone match specified here will take precedence + // over other DNS zone matches, so a solver specifying sys.example.com + // will be selected over one specifying example.com for the domain + // www.sys.example.com. + // If multiple solvers match with the same dnsZones value, the solver + // with the most matching labels in matchLabels will be selected. + // If neither has more matches, the solver defined earlier in the list + // will be selected. + // +optional + DNSZones []string `json:"dnsZones,omitempty"` +} + +// ACMEChallengeSolverHTTP01 contains configuration detailing how to solve +// HTTP01 challenges within a Kubernetes cluster. +// Typically this is accomplished through creating 'routes' of some description +// that configure ingress controllers to direct traffic to 'solver pods', which +// are responsible for responding to the ACME server's HTTP requests. +type ACMEChallengeSolverHTTP01 struct { + // The ingress based HTTP01 challenge solver will solve challenges by + // creating or modifying Ingress resources in order to route requests for + // '/.well-known/acme-challenge/XYZ' to 'challenge solver' pods that are + // provisioned by cert-manager for each Challenge to be completed. + // +optional + Ingress *ACMEChallengeSolverHTTP01Ingress `json:"ingress"` +} + +type ACMEChallengeSolverHTTP01Ingress struct { + // Optional service type for Kubernetes solver service + // +optional + ServiceType corev1.ServiceType `json:"serviceType,omitempty"` + + // The ingress class to use when creating Ingress resources to solve ACME + // challenges that use this challenge solver. + // Only one of 'class' or 'name' may be specified. + // +optional + Class *string `json:"class,omitempty"` + + // The name of the ingress resource that should have ACME challenge solving + // routes inserted into it in order to solve HTTP01 challenges. + // This is typically used in conjunction with ingress controllers like + // ingress-gce, which maintains a 1:1 mapping between external IPs and + // ingress resources. + // +optional + Name string `json:"name,omitempty"` + + // Optional pod template used to configure the ACME challenge solver pods + // used for HTTP01 challenges + // +optional + PodTemplate *ACMEChallengeSolverHTTP01IngressPodTemplate `json:"podTemplate,omitempty"` +} + +type ACMEChallengeSolverHTTP01IngressPodTemplate struct { + // ObjectMeta overrides for the pod used to solve HTTP01 challenges. + // Only the 'labels' and 'annotations' fields may be set. + // If labels or annotations overlap with in-built values, the values here + // will override the in-built values. + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // PodSpec defines overrides for the HTTP01 challenge solver pod. + // Only the 'nodeSelector', 'affinity' and 'tolerations' fields are + // supported currently. All other fields will be ignored. + // +optional + Spec ACMEChallengeSolverHTTP01IngressPodSpec `json:"spec,omitempty"` +} + +type ACMEChallengeSolverHTTP01IngressPodSpec struct { + // NodeSelector is a selector which must be true for the pod to fit on a node. + // Selector which must match a node's labels for the pod to be scheduled on that node. + // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ + // +optional + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + + // If specified, the pod's scheduling constraints + // +optional + Affinity *corev1.Affinity `json:"affinity,omitempty"` + + // If specified, the pod's tolerations. + // +optional + Tolerations []corev1.Toleration `json:"tolerations,omitempty"` +} + +type ACMEChallengeSolverDNS01 struct { + // CNAMEStrategy configures how the DNS01 provider should handle CNAME + // records when found in DNS zones. + // +optional + CNAMEStrategy CNAMEStrategy `json:"cnameStrategy,omitempty"` + + // +optional + Akamai *ACMEIssuerDNS01ProviderAkamai `json:"akamai,omitempty"` + + // +optional + CloudDNS *ACMEIssuerDNS01ProviderCloudDNS `json:"clouddns,omitempty"` + + // +optional + Cloudflare *ACMEIssuerDNS01ProviderCloudflare `json:"cloudflare,omitempty"` + + // +optional + Route53 *ACMEIssuerDNS01ProviderRoute53 `json:"route53,omitempty"` + + // +optional + AzureDNS *ACMEIssuerDNS01ProviderAzureDNS `json:"azuredns,omitempty"` + + // +optional + DigitalOcean *ACMEIssuerDNS01ProviderDigitalOcean `json:"digitalocean,omitempty"` + + // +optional + AcmeDNS *ACMEIssuerDNS01ProviderAcmeDNS `json:"acmedns,omitempty"` + + // +optional + RFC2136 *ACMEIssuerDNS01ProviderRFC2136 `json:"rfc2136,omitempty"` + + // +optional + Webhook *ACMEIssuerDNS01ProviderWebhook `json:"webhook,omitempty"` +} + +// CNAMEStrategy configures how the DNS01 provider should handle CNAME records +// when found in DNS zones. +// By default, the None strategy will be applied (i.e. do not follow CNAMEs). +// +kubebuilder:validation:Enum=None;Follow +type CNAMEStrategy string + +const ( + // NoneStrategy indicates that no CNAME resolution strategy should be used + // when determining which DNS zone to update during DNS01 challenges. + NoneStrategy = "None" + + // FollowStrategy will cause cert-manager to recurse through CNAMEs in + // order to determine which DNS zone to update during DNS01 challenges. + // This is useful if you do not want to grant cert-manager access to your + // root DNS zone, and instead delegate the _acme-challenge.example.com + // subdomain to some other, less privileged domain. + FollowStrategy = "Follow" +) + +// ACMEIssuerDNS01ProviderAkamai is a structure containing the DNS +// configuration for Akamai DNS—Zone Record Management API +type ACMEIssuerDNS01ProviderAkamai struct { + ServiceConsumerDomain string `json:"serviceConsumerDomain"` + ClientToken cmmeta.SecretKeySelector `json:"clientTokenSecretRef"` + ClientSecret cmmeta.SecretKeySelector `json:"clientSecretSecretRef"` + AccessToken cmmeta.SecretKeySelector `json:"accessTokenSecretRef"` +} + +// ACMEIssuerDNS01ProviderCloudDNS is a structure containing the DNS +// configuration for Google Cloud DNS +type ACMEIssuerDNS01ProviderCloudDNS struct { + ServiceAccount cmmeta.SecretKeySelector `json:"serviceAccountSecretRef"` + Project string `json:"project"` +} + +// ACMEIssuerDNS01ProviderCloudflare is a structure containing the DNS +// configuration for Cloudflare +type ACMEIssuerDNS01ProviderCloudflare struct { + Email string `json:"email"` + APIKey cmmeta.SecretKeySelector `json:"apiKeySecretRef"` +} + +// ACMEIssuerDNS01ProviderDigitalOcean is a structure containing the DNS +// configuration for DigitalOcean Domains +type ACMEIssuerDNS01ProviderDigitalOcean struct { + Token cmmeta.SecretKeySelector `json:"tokenSecretRef"` +} + +// ACMEIssuerDNS01ProviderRoute53 is a structure containing the Route 53 +// configuration for AWS +type ACMEIssuerDNS01ProviderRoute53 struct { + // The AccessKeyID is used for authentication. If not set we fall-back to using env vars, shared credentials file or AWS Instance metadata + // see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials + // +optional + AccessKeyID string `json:"accessKeyID"` + + // The SecretAccessKey is used for authentication. If not set we fall-back to using env vars, shared credentials file or AWS Instance metadata + // https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials + // +optional + SecretAccessKey cmmeta.SecretKeySelector `json:"secretAccessKeySecretRef"` + + // Role is a Role ARN which the Route53 provider will assume using either the explicit credentials AccessKeyID/SecretAccessKey + // or the inferred credentials from environment variables, shared credentials file or AWS Instance metadata + // +optional + Role string `json:"role"` + + // If set, the provider will manage only this zone in Route53 and will not do an lookup using the route53:ListHostedZonesByName api call. + // +optional + HostedZoneID string `json:"hostedZoneID,omitempty"` + + // Always set the region when using AccessKeyID and SecretAccessKey + Region string `json:"region"` +} + +// ACMEIssuerDNS01ProviderAzureDNS is a structure containing the +// configuration for Azure DNS +type ACMEIssuerDNS01ProviderAzureDNS struct { + ClientID string `json:"clientID"` + + ClientSecret cmmeta.SecretKeySelector `json:"clientSecretSecretRef"` + + SubscriptionID string `json:"subscriptionID"` + + TenantID string `json:"tenantID"` + + ResourceGroupName string `json:"resourceGroupName"` + + // +optional + HostedZoneName string `json:"hostedZoneName,omitempty"` + + // +optional + Environment AzureDNSEnvironment `json:"environment,omitempty"` +} + +// +kubebuilder:validation:Enum=AzurePublicCloud;AzureChinaCloud;AzureGermanCloud;AzureUSGovernmentCloud +type AzureDNSEnvironment string + +const ( + AzurePublicCloud AzureDNSEnvironment = "AzurePublicCloud" + AzureChinaCloud AzureDNSEnvironment = "AzureChinaCloud" + AzureGermanCloud AzureDNSEnvironment = "AzureGermanCloud" + AzureUSGovernmentCloud AzureDNSEnvironment = "AzureUSGovernmentCloud" +) + +// ACMEIssuerDNS01ProviderAcmeDNS is a structure containing the +// configuration for ACME-DNS servers +type ACMEIssuerDNS01ProviderAcmeDNS struct { + Host string `json:"host"` + + AccountSecret cmmeta.SecretKeySelector `json:"accountSecretRef"` +} + +// ACMEIssuerDNS01ProviderRFC2136 is a structure containing the +// configuration for RFC2136 DNS +type ACMEIssuerDNS01ProviderRFC2136 struct { + // The IP address of the DNS supporting RFC2136. Required. + // Note: FQDN is not a valid value, only IP. + Nameserver string `json:"nameserver"` + + // The name of the secret containing the TSIG value. + // If ``tsigKeyName`` is defined, this field is required. + // +optional + TSIGSecret cmmeta.SecretKeySelector `json:"tsigSecretSecretRef,omitempty"` + + // The TSIG Key name configured in the DNS. + // If ``tsigSecretSecretRef`` is defined, this field is required. + // +optional + TSIGKeyName string `json:"tsigKeyName,omitempty"` + + // The TSIG Algorithm configured in the DNS supporting RFC2136. Used only + // when ``tsigSecretSecretRef`` and ``tsigKeyName`` are defined. + // Supported values are (case-insensitive): ``HMACMD5`` (default), + // ``HMACSHA1``, ``HMACSHA256`` or ``HMACSHA512``. + // +optional + TSIGAlgorithm string `json:"tsigAlgorithm,omitempty"` +} + +// ACMEIssuerDNS01ProviderWebhook specifies configuration for a webhook DNS01 +// provider, including where to POST ChallengePayload resources. +type ACMEIssuerDNS01ProviderWebhook struct { + // The API group name that should be used when POSTing ChallengePayload + // resources to the webhook apiserver. + // This should be the same as the GroupName specified in the webhook + // provider implementation. + GroupName string `json:"groupName"` + + // The name of the solver to use, as defined in the webhook provider + // implementation. + // This will typically be the name of the provider, e.g. 'cloudflare'. + SolverName string `json:"solverName"` + + // Additional configuration that should be passed to the webhook apiserver + // when challenges are processed. + // This can contain arbitrary JSON data. + // Secret values should not be specified in this stanza. + // If secret values are needed (e.g. credentials for a DNS service), you + // should use a SecretKeySelector to reference a Secret resource. + // For details on the schema of this field, consult the webhook provider + // implementation's documentation. + // +optional + Config *apiext.JSON `json:"config,omitempty"` +} + +type ACMEIssuerStatus struct { + // URI is the unique account identifier, which can also be used to retrieve + // account details from the CA + // +optional + URI string `json:"uri,omitempty"` + + // LastRegisteredEmail is the email associated with the latest registered + // ACME account, in order to track changes made to registered account + // associated with the Issuer + // +optional + LastRegisteredEmail string `json:"lastRegisteredEmail,omitempty"` +} diff --git a/pkg/apis/certmanager/v1alpha2/types_order.go b/pkg/apis/acme/v1alpha2/types_order.go similarity index 100% rename from pkg/apis/certmanager/v1alpha2/types_order.go rename to pkg/apis/acme/v1alpha2/types_order.go diff --git a/pkg/apis/acme/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/acme/v1alpha2/zz_generated.deepcopy.go new file mode 100644 index 00000000000..e61688a2b95 --- /dev/null +++ b/pkg/apis/acme/v1alpha2/zz_generated.deepcopy.go @@ -0,0 +1,707 @@ +// +build !ignore_autogenerated + +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "k8s.io/api/core/v1" + v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEAuthorization) DeepCopyInto(out *ACMEAuthorization) { + *out = *in + if in.Challenges != nil { + in, out := &in.Challenges, &out.Challenges + *out = make([]ACMEChallenge, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEAuthorization. +func (in *ACMEAuthorization) DeepCopy() *ACMEAuthorization { + if in == nil { + return nil + } + out := new(ACMEAuthorization) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEChallenge) DeepCopyInto(out *ACMEChallenge) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallenge. +func (in *ACMEChallenge) DeepCopy() *ACMEChallenge { + if in == nil { + return nil + } + out := new(ACMEChallenge) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEChallengeSolver) DeepCopyInto(out *ACMEChallengeSolver) { + *out = *in + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = new(CertificateDNSNameSelector) + (*in).DeepCopyInto(*out) + } + if in.HTTP01 != nil { + in, out := &in.HTTP01, &out.HTTP01 + *out = new(ACMEChallengeSolverHTTP01) + (*in).DeepCopyInto(*out) + } + if in.DNS01 != nil { + in, out := &in.DNS01, &out.DNS01 + *out = new(ACMEChallengeSolverDNS01) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolver. +func (in *ACMEChallengeSolver) DeepCopy() *ACMEChallengeSolver { + if in == nil { + return nil + } + out := new(ACMEChallengeSolver) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEChallengeSolverDNS01) DeepCopyInto(out *ACMEChallengeSolverDNS01) { + *out = *in + if in.Akamai != nil { + in, out := &in.Akamai, &out.Akamai + *out = new(ACMEIssuerDNS01ProviderAkamai) + **out = **in + } + if in.CloudDNS != nil { + in, out := &in.CloudDNS, &out.CloudDNS + *out = new(ACMEIssuerDNS01ProviderCloudDNS) + **out = **in + } + if in.Cloudflare != nil { + in, out := &in.Cloudflare, &out.Cloudflare + *out = new(ACMEIssuerDNS01ProviderCloudflare) + **out = **in + } + if in.Route53 != nil { + in, out := &in.Route53, &out.Route53 + *out = new(ACMEIssuerDNS01ProviderRoute53) + **out = **in + } + if in.AzureDNS != nil { + in, out := &in.AzureDNS, &out.AzureDNS + *out = new(ACMEIssuerDNS01ProviderAzureDNS) + **out = **in + } + if in.DigitalOcean != nil { + in, out := &in.DigitalOcean, &out.DigitalOcean + *out = new(ACMEIssuerDNS01ProviderDigitalOcean) + **out = **in + } + if in.AcmeDNS != nil { + in, out := &in.AcmeDNS, &out.AcmeDNS + *out = new(ACMEIssuerDNS01ProviderAcmeDNS) + **out = **in + } + if in.RFC2136 != nil { + in, out := &in.RFC2136, &out.RFC2136 + *out = new(ACMEIssuerDNS01ProviderRFC2136) + **out = **in + } + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = new(ACMEIssuerDNS01ProviderWebhook) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolverDNS01. +func (in *ACMEChallengeSolverDNS01) DeepCopy() *ACMEChallengeSolverDNS01 { + if in == nil { + return nil + } + out := new(ACMEChallengeSolverDNS01) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEChallengeSolverHTTP01) DeepCopyInto(out *ACMEChallengeSolverHTTP01) { + *out = *in + if in.Ingress != nil { + in, out := &in.Ingress, &out.Ingress + *out = new(ACMEChallengeSolverHTTP01Ingress) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolverHTTP01. +func (in *ACMEChallengeSolverHTTP01) DeepCopy() *ACMEChallengeSolverHTTP01 { + if in == nil { + return nil + } + out := new(ACMEChallengeSolverHTTP01) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEChallengeSolverHTTP01Ingress) DeepCopyInto(out *ACMEChallengeSolverHTTP01Ingress) { + *out = *in + if in.Class != nil { + in, out := &in.Class, &out.Class + *out = new(string) + **out = **in + } + if in.PodTemplate != nil { + in, out := &in.PodTemplate, &out.PodTemplate + *out = new(ACMEChallengeSolverHTTP01IngressPodTemplate) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolverHTTP01Ingress. +func (in *ACMEChallengeSolverHTTP01Ingress) DeepCopy() *ACMEChallengeSolverHTTP01Ingress { + if in == nil { + return nil + } + out := new(ACMEChallengeSolverHTTP01Ingress) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEChallengeSolverHTTP01IngressPodSpec) DeepCopyInto(out *ACMEChallengeSolverHTTP01IngressPodSpec) { + *out = *in + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Affinity != nil { + in, out := &in.Affinity, &out.Affinity + *out = new(v1.Affinity) + (*in).DeepCopyInto(*out) + } + if in.Tolerations != nil { + in, out := &in.Tolerations, &out.Tolerations + *out = make([]v1.Toleration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolverHTTP01IngressPodSpec. +func (in *ACMEChallengeSolverHTTP01IngressPodSpec) DeepCopy() *ACMEChallengeSolverHTTP01IngressPodSpec { + if in == nil { + return nil + } + out := new(ACMEChallengeSolverHTTP01IngressPodSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEChallengeSolverHTTP01IngressPodTemplate) DeepCopyInto(out *ACMEChallengeSolverHTTP01IngressPodTemplate) { + *out = *in + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolverHTTP01IngressPodTemplate. +func (in *ACMEChallengeSolverHTTP01IngressPodTemplate) DeepCopy() *ACMEChallengeSolverHTTP01IngressPodTemplate { + if in == nil { + return nil + } + out := new(ACMEChallengeSolverHTTP01IngressPodTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuer) DeepCopyInto(out *ACMEIssuer) { + *out = *in + out.PrivateKey = in.PrivateKey + if in.Solvers != nil { + in, out := &in.Solvers, &out.Solvers + *out = make([]ACMEChallengeSolver, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuer. +func (in *ACMEIssuer) DeepCopy() *ACMEIssuer { + if in == nil { + return nil + } + out := new(ACMEIssuer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuerDNS01ProviderAcmeDNS) DeepCopyInto(out *ACMEIssuerDNS01ProviderAcmeDNS) { + *out = *in + out.AccountSecret = in.AccountSecret + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderAcmeDNS. +func (in *ACMEIssuerDNS01ProviderAcmeDNS) DeepCopy() *ACMEIssuerDNS01ProviderAcmeDNS { + if in == nil { + return nil + } + out := new(ACMEIssuerDNS01ProviderAcmeDNS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuerDNS01ProviderAkamai) DeepCopyInto(out *ACMEIssuerDNS01ProviderAkamai) { + *out = *in + out.ClientToken = in.ClientToken + out.ClientSecret = in.ClientSecret + out.AccessToken = in.AccessToken + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderAkamai. +func (in *ACMEIssuerDNS01ProviderAkamai) DeepCopy() *ACMEIssuerDNS01ProviderAkamai { + if in == nil { + return nil + } + out := new(ACMEIssuerDNS01ProviderAkamai) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuerDNS01ProviderAzureDNS) DeepCopyInto(out *ACMEIssuerDNS01ProviderAzureDNS) { + *out = *in + out.ClientSecret = in.ClientSecret + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderAzureDNS. +func (in *ACMEIssuerDNS01ProviderAzureDNS) DeepCopy() *ACMEIssuerDNS01ProviderAzureDNS { + if in == nil { + return nil + } + out := new(ACMEIssuerDNS01ProviderAzureDNS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuerDNS01ProviderCloudDNS) DeepCopyInto(out *ACMEIssuerDNS01ProviderCloudDNS) { + *out = *in + out.ServiceAccount = in.ServiceAccount + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderCloudDNS. +func (in *ACMEIssuerDNS01ProviderCloudDNS) DeepCopy() *ACMEIssuerDNS01ProviderCloudDNS { + if in == nil { + return nil + } + out := new(ACMEIssuerDNS01ProviderCloudDNS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuerDNS01ProviderCloudflare) DeepCopyInto(out *ACMEIssuerDNS01ProviderCloudflare) { + *out = *in + out.APIKey = in.APIKey + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderCloudflare. +func (in *ACMEIssuerDNS01ProviderCloudflare) DeepCopy() *ACMEIssuerDNS01ProviderCloudflare { + if in == nil { + return nil + } + out := new(ACMEIssuerDNS01ProviderCloudflare) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuerDNS01ProviderDigitalOcean) DeepCopyInto(out *ACMEIssuerDNS01ProviderDigitalOcean) { + *out = *in + out.Token = in.Token + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderDigitalOcean. +func (in *ACMEIssuerDNS01ProviderDigitalOcean) DeepCopy() *ACMEIssuerDNS01ProviderDigitalOcean { + if in == nil { + return nil + } + out := new(ACMEIssuerDNS01ProviderDigitalOcean) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuerDNS01ProviderRFC2136) DeepCopyInto(out *ACMEIssuerDNS01ProviderRFC2136) { + *out = *in + out.TSIGSecret = in.TSIGSecret + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderRFC2136. +func (in *ACMEIssuerDNS01ProviderRFC2136) DeepCopy() *ACMEIssuerDNS01ProviderRFC2136 { + if in == nil { + return nil + } + out := new(ACMEIssuerDNS01ProviderRFC2136) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuerDNS01ProviderRoute53) DeepCopyInto(out *ACMEIssuerDNS01ProviderRoute53) { + *out = *in + out.SecretAccessKey = in.SecretAccessKey + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderRoute53. +func (in *ACMEIssuerDNS01ProviderRoute53) DeepCopy() *ACMEIssuerDNS01ProviderRoute53 { + if in == nil { + return nil + } + out := new(ACMEIssuerDNS01ProviderRoute53) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuerDNS01ProviderWebhook) DeepCopyInto(out *ACMEIssuerDNS01ProviderWebhook) { + *out = *in + if in.Config != nil { + in, out := &in.Config, &out.Config + *out = new(v1beta1.JSON) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderWebhook. +func (in *ACMEIssuerDNS01ProviderWebhook) DeepCopy() *ACMEIssuerDNS01ProviderWebhook { + if in == nil { + return nil + } + out := new(ACMEIssuerDNS01ProviderWebhook) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuerStatus) DeepCopyInto(out *ACMEIssuerStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerStatus. +func (in *ACMEIssuerStatus) DeepCopy() *ACMEIssuerStatus { + if in == nil { + return nil + } + out := new(ACMEIssuerStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateDNSNameSelector) DeepCopyInto(out *CertificateDNSNameSelector) { + *out = *in + if in.MatchLabels != nil { + in, out := &in.MatchLabels, &out.MatchLabels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.DNSNames != nil { + in, out := &in.DNSNames, &out.DNSNames + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.DNSZones != nil { + in, out := &in.DNSZones, &out.DNSZones + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateDNSNameSelector. +func (in *CertificateDNSNameSelector) DeepCopy() *CertificateDNSNameSelector { + if in == nil { + return nil + } + out := new(CertificateDNSNameSelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Challenge) DeepCopyInto(out *Challenge) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Challenge. +func (in *Challenge) DeepCopy() *Challenge { + if in == nil { + return nil + } + out := new(Challenge) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Challenge) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ChallengeList) DeepCopyInto(out *ChallengeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Challenge, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChallengeList. +func (in *ChallengeList) DeepCopy() *ChallengeList { + if in == nil { + return nil + } + out := new(ChallengeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ChallengeList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ChallengeSpec) DeepCopyInto(out *ChallengeSpec) { + *out = *in + if in.Solver != nil { + in, out := &in.Solver, &out.Solver + *out = new(ACMEChallengeSolver) + (*in).DeepCopyInto(*out) + } + out.IssuerRef = in.IssuerRef + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChallengeSpec. +func (in *ChallengeSpec) DeepCopy() *ChallengeSpec { + if in == nil { + return nil + } + out := new(ChallengeSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ChallengeStatus) DeepCopyInto(out *ChallengeStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChallengeStatus. +func (in *ChallengeStatus) DeepCopy() *ChallengeStatus { + if in == nil { + return nil + } + out := new(ChallengeStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Order) DeepCopyInto(out *Order) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Order. +func (in *Order) DeepCopy() *Order { + if in == nil { + return nil + } + out := new(Order) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Order) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OrderList) DeepCopyInto(out *OrderList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Order, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OrderList. +func (in *OrderList) DeepCopy() *OrderList { + if in == nil { + return nil + } + out := new(OrderList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OrderList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OrderSpec) DeepCopyInto(out *OrderSpec) { + *out = *in + if in.CSR != nil { + in, out := &in.CSR, &out.CSR + *out = make([]byte, len(*in)) + copy(*out, *in) + } + out.IssuerRef = in.IssuerRef + if in.DNSNames != nil { + in, out := &in.DNSNames, &out.DNSNames + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OrderSpec. +func (in *OrderSpec) DeepCopy() *OrderSpec { + if in == nil { + return nil + } + out := new(OrderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OrderStatus) DeepCopyInto(out *OrderStatus) { + *out = *in + if in.Authorizations != nil { + in, out := &in.Authorizations, &out.Authorizations + *out = make([]ACMEAuthorization, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Certificate != nil { + in, out := &in.Certificate, &out.Certificate + *out = make([]byte, len(*in)) + copy(*out, *in) + } + if in.FailureTime != nil { + in, out := &in.FailureTime, &out.FailureTime + *out = (*in).DeepCopy() + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OrderStatus. +func (in *OrderStatus) DeepCopy() *OrderStatus { + if in == nil { + return nil + } + out := new(OrderStatus) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/apis/certmanager/v1alpha2/BUILD.bazel b/pkg/apis/certmanager/v1alpha2/BUILD.bazel index fcaa213f486..ed6195e5105 100644 --- a/pkg/apis/certmanager/v1alpha2/BUILD.bazel +++ b/pkg/apis/certmanager/v1alpha2/BUILD.bazel @@ -10,18 +10,15 @@ go_library( "types.go", "types_certificate.go", "types_certificaterequest.go", - "types_challenge.go", "types_issuer.go", - "types_order.go", "zz_generated.deepcopy.go", ], importpath = "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2", visibility = ["//visibility:public"], deps = [ + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager:go_default_library", "//pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", diff --git a/pkg/apis/certmanager/v1alpha2/const.go b/pkg/apis/certmanager/v1alpha2/const.go index 86c9d63d327..88e443c924f 100644 --- a/pkg/apis/certmanager/v1alpha2/const.go +++ b/pkg/apis/certmanager/v1alpha2/const.go @@ -31,7 +31,3 @@ const ( // Default duration before certificate expiration if Issuer.spec.renewBefore is not set DefaultRenewBefore = time.Hour * 24 * 30 ) - -const ( - ACMEFinalizer = "finalizer.acme.cert-manager.io" -) diff --git a/pkg/apis/certmanager/v1alpha2/generic_issuer.go b/pkg/apis/certmanager/v1alpha2/generic_issuer.go index ecf20adc15c..0588a45e733 100644 --- a/pkg/apis/certmanager/v1alpha2/generic_issuer.go +++ b/pkg/apis/certmanager/v1alpha2/generic_issuer.go @@ -19,6 +19,8 @@ package v1alpha2 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" ) type GenericIssuer interface { @@ -71,13 +73,13 @@ func (c *Issuer) Copy() GenericIssuer { } // TODO: refactor these functions away -func (i *IssuerStatus) ACMEStatus() *ACMEIssuerStatus { +func (i *IssuerStatus) ACMEStatus() *cmacme.ACMEIssuerStatus { // this is an edge case, but this will prevent panics if i == nil { - return &ACMEIssuerStatus{} + return &cmacme.ACMEIssuerStatus{} } if i.ACME == nil { - i.ACME = &ACMEIssuerStatus{} + i.ACME = &cmacme.ACMEIssuerStatus{} } return i.ACME } diff --git a/pkg/apis/certmanager/v1alpha2/register.go b/pkg/apis/certmanager/v1alpha2/register.go index e1dc7d893fd..c521fc1dcff 100644 --- a/pkg/apis/certmanager/v1alpha2/register.go +++ b/pkg/apis/certmanager/v1alpha2/register.go @@ -56,10 +56,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { &ClusterIssuerList{}, &CertificateRequest{}, &CertificateRequestList{}, - &Order{}, - &OrderList{}, - &Challenge{}, - &ChallengeList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil diff --git a/pkg/apis/certmanager/v1alpha2/types.go b/pkg/apis/certmanager/v1alpha2/types.go index 1bd9d2f2f20..78c3ecdda54 100644 --- a/pkg/apis/certmanager/v1alpha2/types.go +++ b/pkg/apis/certmanager/v1alpha2/types.go @@ -29,21 +29,6 @@ const ( // Annotation names for CertificateRequests const ( CRPrivateKeyAnnotationKey = "certmanager.k8s.io/private-key-secret-name" - - // If this annotation is specified on a Certificate or Order resource when - // using the HTTP01 solver type, the ingress.name field of the HTTP01 - // solver's configuration will be set to the value given here. - // This is especially useful for users of Ingress controllers that maintain - // a 1:1 mapping between endpoint IP and Ingress resource. - ACMECertificateHTTP01IngressNameOverride = "acme.certmanager.k8s.io/http01-override-ingress-name" - - // If this annotation is specified on a Certificate or Order resource when - // using the HTTP01 solver type, the ingress.class field of the HTTP01 - // solver's configuration will be set to the value given here. - // This is especially useful for users deploying many different ingress - // classes into a single cluster that want to be able to re-use a single - // solver for each ingress class. - ACMECertificateHTTP01IngressClassOverride = "acme.certmanager.k8s.io/http01-override-ingress-class" ) const ( @@ -60,7 +45,6 @@ const ( IssuerKind = "Issuer" CertificateKind = "Certificate" CertificateRequestKind = "CertificateRequest" - OrderKind = "Order" ) const ( diff --git a/pkg/apis/certmanager/v1alpha2/types_issuer.go b/pkg/apis/certmanager/v1alpha2/types_issuer.go index 231b5f3ae5a..a83f51d9a93 100644 --- a/pkg/apis/certmanager/v1alpha2/types_issuer.go +++ b/pkg/apis/certmanager/v1alpha2/types_issuer.go @@ -17,10 +17,9 @@ limitations under the License. package v1alpha2 import ( - corev1 "k8s.io/api/core/v1" - apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" ) @@ -79,7 +78,7 @@ type IssuerSpec struct { type IssuerConfig struct { // +optional - ACME *ACMEIssuer `json:"acme,omitempty"` + ACME *cmacme.ACMEIssuer `json:"acme,omitempty"` // +optional CA *CAIssuer `json:"ca,omitempty"` @@ -190,361 +189,13 @@ type CAIssuer struct { SecretName string `json:"secretName"` } -// ACMEIssuer contains the specification for an ACME issuer -type ACMEIssuer struct { - // Email is the email for this account - // +optional - Email string `json:"email,omitempty"` - - // Server is the ACME server URL - Server string `json:"server"` - - // If true, skip verifying the ACME server TLS certificate - // +optional - SkipTLSVerify bool `json:"skipTLSVerify,omitempty"` - - // PrivateKey is the name of a secret containing the private key for this - // user account. - PrivateKey cmmeta.SecretKeySelector `json:"privateKeySecretRef"` - - // Solvers is a list of challenge solvers that will be used to solve - // ACME challenges for the matching domains. - // +optional - Solvers []ACMEChallengeSolver `json:"solvers,omitempty"` -} - -type ACMEChallengeSolver struct { - // Selector selects a set of DNSNames on the Certificate resource that - // should be solved using this challenge solver. - Selector *CertificateDNSNameSelector `json:"selector,omitempty"` - - // +optional - HTTP01 *ACMEChallengeSolverHTTP01 `json:"http01,omitempty"` - - // +optional - DNS01 *ACMEChallengeSolverDNS01 `json:"dns01,omitempty"` -} - -// CertificateDomainSelector selects certificates using a label selector, and -// can optionally select individual DNS names within those certificates. -// If both MatchLabels and DNSNames are empty, this selector will match all -// certificates and DNS names within them. -type CertificateDNSNameSelector struct { - // A label selector that is used to refine the set of certificate's that - // this challenge solver will apply to. - // +optional - MatchLabels map[string]string `json:"matchLabels,omitempty"` - - // List of DNSNames that this solver will be used to solve. - // If specified and a match is found, a dnsNames selector will take - // precedence over a dnsZones selector. - // If multiple solvers match with the same dnsNames value, the solver - // with the most matching labels in matchLabels will be selected. - // If neither has more matches, the solver defined earlier in the list - // will be selected. - // +optional - DNSNames []string `json:"dnsNames,omitempty"` - - // List of DNSZones that this solver will be used to solve. - // The most specific DNS zone match specified here will take precedence - // over other DNS zone matches, so a solver specifying sys.example.com - // will be selected over one specifying example.com for the domain - // www.sys.example.com. - // If multiple solvers match with the same dnsZones value, the solver - // with the most matching labels in matchLabels will be selected. - // If neither has more matches, the solver defined earlier in the list - // will be selected. - // +optional - DNSZones []string `json:"dnsZones,omitempty"` -} - -// ACMEChallengeSolverHTTP01 contains configuration detailing how to solve -// HTTP01 challenges within a Kubernetes cluster. -// Typically this is accomplished through creating 'routes' of some description -// that configure ingress controllers to direct traffic to 'solver pods', which -// are responsible for responding to the ACME server's HTTP requests. -type ACMEChallengeSolverHTTP01 struct { - // The ingress based HTTP01 challenge solver will solve challenges by - // creating or modifying Ingress resources in order to route requests for - // '/.well-known/acme-challenge/XYZ' to 'challenge solver' pods that are - // provisioned by cert-manager for each Challenge to be completed. - // +optional - Ingress *ACMEChallengeSolverHTTP01Ingress `json:"ingress"` -} - -type ACMEChallengeSolverHTTP01Ingress struct { - // Optional service type for Kubernetes solver service - // +optional - ServiceType corev1.ServiceType `json:"serviceType,omitempty"` - - // The ingress class to use when creating Ingress resources to solve ACME - // challenges that use this challenge solver. - // Only one of 'class' or 'name' may be specified. - // +optional - Class *string `json:"class,omitempty"` - - // The name of the ingress resource that should have ACME challenge solving - // routes inserted into it in order to solve HTTP01 challenges. - // This is typically used in conjunction with ingress controllers like - // ingress-gce, which maintains a 1:1 mapping between external IPs and - // ingress resources. - // +optional - Name string `json:"name,omitempty"` - - // Optional pod template used to configure the ACME challenge solver pods - // used for HTTP01 challenges - // +optional - PodTemplate *ACMEChallengeSolverHTTP01IngressPodTemplate `json:"podTemplate,omitempty"` -} - -type ACMEChallengeSolverHTTP01IngressPodTemplate struct { - // ObjectMeta overrides for the pod used to solve HTTP01 challenges. - // Only the 'labels' and 'annotations' fields may be set. - // If labels or annotations overlap with in-built values, the values here - // will override the in-built values. - // +optional - metav1.ObjectMeta `json:"metadata,omitempty"` - - // PodSpec defines overrides for the HTTP01 challenge solver pod. - // Only the 'nodeSelector', 'affinity' and 'tolerations' fields are - // supported currently. All other fields will be ignored. - // +optional - Spec ACMEChallengeSolverHTTP01IngressPodSpec `json:"spec,omitempty"` -} - -type ACMEChallengeSolverHTTP01IngressPodSpec struct { - // NodeSelector is a selector which must be true for the pod to fit on a node. - // Selector which must match a node's labels for the pod to be scheduled on that node. - // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ - // +optional - NodeSelector map[string]string `json:"nodeSelector,omitempty"` - - // If specified, the pod's scheduling constraints - // +optional - Affinity *corev1.Affinity `json:"affinity,omitempty"` - - // If specified, the pod's tolerations. - // +optional - Tolerations []corev1.Toleration `json:"tolerations,omitempty"` -} - -type ACMEChallengeSolverDNS01 struct { - // CNAMEStrategy configures how the DNS01 provider should handle CNAME - // records when found in DNS zones. - // +optional - CNAMEStrategy CNAMEStrategy `json:"cnameStrategy,omitempty"` - - // +optional - Akamai *ACMEIssuerDNS01ProviderAkamai `json:"akamai,omitempty"` - - // +optional - CloudDNS *ACMEIssuerDNS01ProviderCloudDNS `json:"clouddns,omitempty"` - - // +optional - Cloudflare *ACMEIssuerDNS01ProviderCloudflare `json:"cloudflare,omitempty"` - - // +optional - Route53 *ACMEIssuerDNS01ProviderRoute53 `json:"route53,omitempty"` - - // +optional - AzureDNS *ACMEIssuerDNS01ProviderAzureDNS `json:"azuredns,omitempty"` - - // +optional - DigitalOcean *ACMEIssuerDNS01ProviderDigitalOcean `json:"digitalocean,omitempty"` - - // +optional - AcmeDNS *ACMEIssuerDNS01ProviderAcmeDNS `json:"acmedns,omitempty"` - - // +optional - RFC2136 *ACMEIssuerDNS01ProviderRFC2136 `json:"rfc2136,omitempty"` - - // +optional - Webhook *ACMEIssuerDNS01ProviderWebhook `json:"webhook,omitempty"` -} - -// CNAMEStrategy configures how the DNS01 provider should handle CNAME records -// when found in DNS zones. -// By default, the None strategy will be applied (i.e. do not follow CNAMEs). -// +kubebuilder:validation:Enum=None;Follow -type CNAMEStrategy string - -const ( - // NoneStrategy indicates that no CNAME resolution strategy should be used - // when determining which DNS zone to update during DNS01 challenges. - NoneStrategy = "None" - - // FollowStrategy will cause cert-manager to recurse through CNAMEs in - // order to determine which DNS zone to update during DNS01 challenges. - // This is useful if you do not want to grant cert-manager access to your - // root DNS zone, and instead delegate the _acme-challenge.example.com - // subdomain to some other, less privileged domain. - FollowStrategy = "Follow" -) - -// ACMEIssuerDNS01ProviderAkamai is a structure containing the DNS -// configuration for Akamai DNS—Zone Record Management API -type ACMEIssuerDNS01ProviderAkamai struct { - ServiceConsumerDomain string `json:"serviceConsumerDomain"` - ClientToken cmmeta.SecretKeySelector `json:"clientTokenSecretRef"` - ClientSecret cmmeta.SecretKeySelector `json:"clientSecretSecretRef"` - AccessToken cmmeta.SecretKeySelector `json:"accessTokenSecretRef"` -} - -// ACMEIssuerDNS01ProviderCloudDNS is a structure containing the DNS -// configuration for Google Cloud DNS -type ACMEIssuerDNS01ProviderCloudDNS struct { - ServiceAccount cmmeta.SecretKeySelector `json:"serviceAccountSecretRef"` - Project string `json:"project"` -} - -// ACMEIssuerDNS01ProviderCloudflare is a structure containing the DNS -// configuration for Cloudflare -type ACMEIssuerDNS01ProviderCloudflare struct { - Email string `json:"email"` - APIKey cmmeta.SecretKeySelector `json:"apiKeySecretRef"` -} - -// ACMEIssuerDNS01ProviderDigitalOcean is a structure containing the DNS -// configuration for DigitalOcean Domains -type ACMEIssuerDNS01ProviderDigitalOcean struct { - Token cmmeta.SecretKeySelector `json:"tokenSecretRef"` -} - -// ACMEIssuerDNS01ProviderRoute53 is a structure containing the Route 53 -// configuration for AWS -type ACMEIssuerDNS01ProviderRoute53 struct { - // The AccessKeyID is used for authentication. If not set we fall-back to using env vars, shared credentials file or AWS Instance metadata - // see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials - // +optional - AccessKeyID string `json:"accessKeyID"` - - // The SecretAccessKey is used for authentication. If not set we fall-back to using env vars, shared credentials file or AWS Instance metadata - // https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials - // +optional - SecretAccessKey cmmeta.SecretKeySelector `json:"secretAccessKeySecretRef"` - - // Role is a Role ARN which the Route53 provider will assume using either the explicit credentials AccessKeyID/SecretAccessKey - // or the inferred credentials from environment variables, shared credentials file or AWS Instance metadata - // +optional - Role string `json:"role"` - - // If set, the provider will manage only this zone in Route53 and will not do an lookup using the route53:ListHostedZonesByName api call. - // +optional - HostedZoneID string `json:"hostedZoneID,omitempty"` - - // Always set the region when using AccessKeyID and SecretAccessKey - Region string `json:"region"` -} - -// ACMEIssuerDNS01ProviderAzureDNS is a structure containing the -// configuration for Azure DNS -type ACMEIssuerDNS01ProviderAzureDNS struct { - ClientID string `json:"clientID"` - - ClientSecret cmmeta.SecretKeySelector `json:"clientSecretSecretRef"` - - SubscriptionID string `json:"subscriptionID"` - - TenantID string `json:"tenantID"` - - ResourceGroupName string `json:"resourceGroupName"` - - // +optional - HostedZoneName string `json:"hostedZoneName,omitempty"` - - // +optional - Environment AzureDNSEnvironment `json:"environment,omitempty"` -} - -// +kubebuilder:validation:Enum=AzurePublicCloud;AzureChinaCloud;AzureGermanCloud;AzureUSGovernmentCloud -type AzureDNSEnvironment string - -const ( - AzurePublicCloud AzureDNSEnvironment = "AzurePublicCloud" - AzureChinaCloud AzureDNSEnvironment = "AzureChinaCloud" - AzureGermanCloud AzureDNSEnvironment = "AzureGermanCloud" - AzureUSGovernmentCloud AzureDNSEnvironment = "AzureUSGovernmentCloud" -) - -// ACMEIssuerDNS01ProviderAcmeDNS is a structure containing the -// configuration for ACME-DNS servers -type ACMEIssuerDNS01ProviderAcmeDNS struct { - Host string `json:"host"` - - AccountSecret cmmeta.SecretKeySelector `json:"accountSecretRef"` -} - -// ACMEIssuerDNS01ProviderRFC2136 is a structure containing the -// configuration for RFC2136 DNS -type ACMEIssuerDNS01ProviderRFC2136 struct { - // The IP address of the DNS supporting RFC2136. Required. - // Note: FQDN is not a valid value, only IP. - Nameserver string `json:"nameserver"` - - // The name of the secret containing the TSIG value. - // If ``tsigKeyName`` is defined, this field is required. - // +optional - TSIGSecret cmmeta.SecretKeySelector `json:"tsigSecretSecretRef,omitempty"` - - // The TSIG Key name configured in the DNS. - // If ``tsigSecretSecretRef`` is defined, this field is required. - // +optional - TSIGKeyName string `json:"tsigKeyName,omitempty"` - - // The TSIG Algorithm configured in the DNS supporting RFC2136. Used only - // when ``tsigSecretSecretRef`` and ``tsigKeyName`` are defined. - // Supported values are (case-insensitive): ``HMACMD5`` (default), - // ``HMACSHA1``, ``HMACSHA256`` or ``HMACSHA512``. - // +optional - TSIGAlgorithm string `json:"tsigAlgorithm,omitempty"` -} - -// ACMEIssuerDNS01ProviderWebhook specifies configuration for a webhook DNS01 -// provider, including where to POST ChallengePayload resources. -type ACMEIssuerDNS01ProviderWebhook struct { - // The API group name that should be used when POSTing ChallengePayload - // resources to the webhook apiserver. - // This should be the same as the GroupName specified in the webhook - // provider implementation. - GroupName string `json:"groupName"` - - // The name of the solver to use, as defined in the webhook provider - // implementation. - // This will typically be the name of the provider, e.g. 'cloudflare'. - SolverName string `json:"solverName"` - - // Additional configuration that should be passed to the webhook apiserver - // when challenges are processed. - // This can contain arbitrary JSON data. - // Secret values should not be specified in this stanza. - // If secret values are needed (e.g. credentials for a DNS service), you - // should use a SecretKeySelector to reference a Secret resource. - // For details on the schema of this field, consult the webhook provider - // implementation's documentation. - // +optional - Config *apiext.JSON `json:"config,omitempty"` -} - // IssuerStatus contains status information about an Issuer type IssuerStatus struct { // +optional Conditions []IssuerCondition `json:"conditions,omitempty"` // +optional - ACME *ACMEIssuerStatus `json:"acme,omitempty"` -} - -type ACMEIssuerStatus struct { - // URI is the unique account identifier, which can also be used to retrieve - // account details from the CA - // +optional - URI string `json:"uri,omitempty"` - - // LastRegisteredEmail is the email associated with the latest registered - // ACME account, in order to track changes made to registered account - // associated with the Issuer - // +optional - LastRegisteredEmail string `json:"lastRegisteredEmail,omitempty"` + ACME *cmacme.ACMEIssuerStatus `json:"acme,omitempty"` } // IssuerCondition contains condition information for an Issuer. diff --git a/pkg/apis/certmanager/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/certmanager/v1alpha2/zz_generated.deepcopy.go index 5ff1711e4a5..81a06e9431f 100644 --- a/pkg/apis/certmanager/v1alpha2/zz_generated.deepcopy.go +++ b/pkg/apis/certmanager/v1alpha2/zz_generated.deepcopy.go @@ -21,440 +21,11 @@ limitations under the License. package v1alpha2 import ( - v1 "k8s.io/api/core/v1" - v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + acmev1alpha2 "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEAuthorization) DeepCopyInto(out *ACMEAuthorization) { - *out = *in - if in.Challenges != nil { - in, out := &in.Challenges, &out.Challenges - *out = make([]ACMEChallenge, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEAuthorization. -func (in *ACMEAuthorization) DeepCopy() *ACMEAuthorization { - if in == nil { - return nil - } - out := new(ACMEAuthorization) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEChallenge) DeepCopyInto(out *ACMEChallenge) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallenge. -func (in *ACMEChallenge) DeepCopy() *ACMEChallenge { - if in == nil { - return nil - } - out := new(ACMEChallenge) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEChallengeSolver) DeepCopyInto(out *ACMEChallengeSolver) { - *out = *in - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = new(CertificateDNSNameSelector) - (*in).DeepCopyInto(*out) - } - if in.HTTP01 != nil { - in, out := &in.HTTP01, &out.HTTP01 - *out = new(ACMEChallengeSolverHTTP01) - (*in).DeepCopyInto(*out) - } - if in.DNS01 != nil { - in, out := &in.DNS01, &out.DNS01 - *out = new(ACMEChallengeSolverDNS01) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolver. -func (in *ACMEChallengeSolver) DeepCopy() *ACMEChallengeSolver { - if in == nil { - return nil - } - out := new(ACMEChallengeSolver) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEChallengeSolverDNS01) DeepCopyInto(out *ACMEChallengeSolverDNS01) { - *out = *in - if in.Akamai != nil { - in, out := &in.Akamai, &out.Akamai - *out = new(ACMEIssuerDNS01ProviderAkamai) - **out = **in - } - if in.CloudDNS != nil { - in, out := &in.CloudDNS, &out.CloudDNS - *out = new(ACMEIssuerDNS01ProviderCloudDNS) - **out = **in - } - if in.Cloudflare != nil { - in, out := &in.Cloudflare, &out.Cloudflare - *out = new(ACMEIssuerDNS01ProviderCloudflare) - **out = **in - } - if in.Route53 != nil { - in, out := &in.Route53, &out.Route53 - *out = new(ACMEIssuerDNS01ProviderRoute53) - **out = **in - } - if in.AzureDNS != nil { - in, out := &in.AzureDNS, &out.AzureDNS - *out = new(ACMEIssuerDNS01ProviderAzureDNS) - **out = **in - } - if in.DigitalOcean != nil { - in, out := &in.DigitalOcean, &out.DigitalOcean - *out = new(ACMEIssuerDNS01ProviderDigitalOcean) - **out = **in - } - if in.AcmeDNS != nil { - in, out := &in.AcmeDNS, &out.AcmeDNS - *out = new(ACMEIssuerDNS01ProviderAcmeDNS) - **out = **in - } - if in.RFC2136 != nil { - in, out := &in.RFC2136, &out.RFC2136 - *out = new(ACMEIssuerDNS01ProviderRFC2136) - **out = **in - } - if in.Webhook != nil { - in, out := &in.Webhook, &out.Webhook - *out = new(ACMEIssuerDNS01ProviderWebhook) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolverDNS01. -func (in *ACMEChallengeSolverDNS01) DeepCopy() *ACMEChallengeSolverDNS01 { - if in == nil { - return nil - } - out := new(ACMEChallengeSolverDNS01) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEChallengeSolverHTTP01) DeepCopyInto(out *ACMEChallengeSolverHTTP01) { - *out = *in - if in.Ingress != nil { - in, out := &in.Ingress, &out.Ingress - *out = new(ACMEChallengeSolverHTTP01Ingress) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolverHTTP01. -func (in *ACMEChallengeSolverHTTP01) DeepCopy() *ACMEChallengeSolverHTTP01 { - if in == nil { - return nil - } - out := new(ACMEChallengeSolverHTTP01) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEChallengeSolverHTTP01Ingress) DeepCopyInto(out *ACMEChallengeSolverHTTP01Ingress) { - *out = *in - if in.Class != nil { - in, out := &in.Class, &out.Class - *out = new(string) - **out = **in - } - if in.PodTemplate != nil { - in, out := &in.PodTemplate, &out.PodTemplate - *out = new(ACMEChallengeSolverHTTP01IngressPodTemplate) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolverHTTP01Ingress. -func (in *ACMEChallengeSolverHTTP01Ingress) DeepCopy() *ACMEChallengeSolverHTTP01Ingress { - if in == nil { - return nil - } - out := new(ACMEChallengeSolverHTTP01Ingress) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEChallengeSolverHTTP01IngressPodSpec) DeepCopyInto(out *ACMEChallengeSolverHTTP01IngressPodSpec) { - *out = *in - if in.NodeSelector != nil { - in, out := &in.NodeSelector, &out.NodeSelector - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Affinity != nil { - in, out := &in.Affinity, &out.Affinity - *out = new(v1.Affinity) - (*in).DeepCopyInto(*out) - } - if in.Tolerations != nil { - in, out := &in.Tolerations, &out.Tolerations - *out = make([]v1.Toleration, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolverHTTP01IngressPodSpec. -func (in *ACMEChallengeSolverHTTP01IngressPodSpec) DeepCopy() *ACMEChallengeSolverHTTP01IngressPodSpec { - if in == nil { - return nil - } - out := new(ACMEChallengeSolverHTTP01IngressPodSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEChallengeSolverHTTP01IngressPodTemplate) DeepCopyInto(out *ACMEChallengeSolverHTTP01IngressPodTemplate) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolverHTTP01IngressPodTemplate. -func (in *ACMEChallengeSolverHTTP01IngressPodTemplate) DeepCopy() *ACMEChallengeSolverHTTP01IngressPodTemplate { - if in == nil { - return nil - } - out := new(ACMEChallengeSolverHTTP01IngressPodTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuer) DeepCopyInto(out *ACMEIssuer) { - *out = *in - out.PrivateKey = in.PrivateKey - if in.Solvers != nil { - in, out := &in.Solvers, &out.Solvers - *out = make([]ACMEChallengeSolver, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuer. -func (in *ACMEIssuer) DeepCopy() *ACMEIssuer { - if in == nil { - return nil - } - out := new(ACMEIssuer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuerDNS01ProviderAcmeDNS) DeepCopyInto(out *ACMEIssuerDNS01ProviderAcmeDNS) { - *out = *in - out.AccountSecret = in.AccountSecret - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderAcmeDNS. -func (in *ACMEIssuerDNS01ProviderAcmeDNS) DeepCopy() *ACMEIssuerDNS01ProviderAcmeDNS { - if in == nil { - return nil - } - out := new(ACMEIssuerDNS01ProviderAcmeDNS) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuerDNS01ProviderAkamai) DeepCopyInto(out *ACMEIssuerDNS01ProviderAkamai) { - *out = *in - out.ClientToken = in.ClientToken - out.ClientSecret = in.ClientSecret - out.AccessToken = in.AccessToken - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderAkamai. -func (in *ACMEIssuerDNS01ProviderAkamai) DeepCopy() *ACMEIssuerDNS01ProviderAkamai { - if in == nil { - return nil - } - out := new(ACMEIssuerDNS01ProviderAkamai) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuerDNS01ProviderAzureDNS) DeepCopyInto(out *ACMEIssuerDNS01ProviderAzureDNS) { - *out = *in - out.ClientSecret = in.ClientSecret - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderAzureDNS. -func (in *ACMEIssuerDNS01ProviderAzureDNS) DeepCopy() *ACMEIssuerDNS01ProviderAzureDNS { - if in == nil { - return nil - } - out := new(ACMEIssuerDNS01ProviderAzureDNS) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuerDNS01ProviderCloudDNS) DeepCopyInto(out *ACMEIssuerDNS01ProviderCloudDNS) { - *out = *in - out.ServiceAccount = in.ServiceAccount - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderCloudDNS. -func (in *ACMEIssuerDNS01ProviderCloudDNS) DeepCopy() *ACMEIssuerDNS01ProviderCloudDNS { - if in == nil { - return nil - } - out := new(ACMEIssuerDNS01ProviderCloudDNS) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuerDNS01ProviderCloudflare) DeepCopyInto(out *ACMEIssuerDNS01ProviderCloudflare) { - *out = *in - out.APIKey = in.APIKey - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderCloudflare. -func (in *ACMEIssuerDNS01ProviderCloudflare) DeepCopy() *ACMEIssuerDNS01ProviderCloudflare { - if in == nil { - return nil - } - out := new(ACMEIssuerDNS01ProviderCloudflare) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuerDNS01ProviderDigitalOcean) DeepCopyInto(out *ACMEIssuerDNS01ProviderDigitalOcean) { - *out = *in - out.Token = in.Token - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderDigitalOcean. -func (in *ACMEIssuerDNS01ProviderDigitalOcean) DeepCopy() *ACMEIssuerDNS01ProviderDigitalOcean { - if in == nil { - return nil - } - out := new(ACMEIssuerDNS01ProviderDigitalOcean) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuerDNS01ProviderRFC2136) DeepCopyInto(out *ACMEIssuerDNS01ProviderRFC2136) { - *out = *in - out.TSIGSecret = in.TSIGSecret - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderRFC2136. -func (in *ACMEIssuerDNS01ProviderRFC2136) DeepCopy() *ACMEIssuerDNS01ProviderRFC2136 { - if in == nil { - return nil - } - out := new(ACMEIssuerDNS01ProviderRFC2136) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuerDNS01ProviderRoute53) DeepCopyInto(out *ACMEIssuerDNS01ProviderRoute53) { - *out = *in - out.SecretAccessKey = in.SecretAccessKey - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderRoute53. -func (in *ACMEIssuerDNS01ProviderRoute53) DeepCopy() *ACMEIssuerDNS01ProviderRoute53 { - if in == nil { - return nil - } - out := new(ACMEIssuerDNS01ProviderRoute53) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuerDNS01ProviderWebhook) DeepCopyInto(out *ACMEIssuerDNS01ProviderWebhook) { - *out = *in - if in.Config != nil { - in, out := &in.Config, &out.Config - *out = new(v1beta1.JSON) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderWebhook. -func (in *ACMEIssuerDNS01ProviderWebhook) DeepCopy() *ACMEIssuerDNS01ProviderWebhook { - if in == nil { - return nil - } - out := new(ACMEIssuerDNS01ProviderWebhook) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuerStatus) DeepCopyInto(out *ACMEIssuerStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerStatus. -func (in *ACMEIssuerStatus) DeepCopy() *ACMEIssuerStatus { - if in == nil { - return nil - } - out := new(ACMEIssuerStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CAIssuer) DeepCopyInto(out *CAIssuer) { *out = *in @@ -519,39 +90,6 @@ func (in *CertificateCondition) DeepCopy() *CertificateCondition { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CertificateDNSNameSelector) DeepCopyInto(out *CertificateDNSNameSelector) { - *out = *in - if in.MatchLabels != nil { - in, out := &in.MatchLabels, &out.MatchLabels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.DNSNames != nil { - in, out := &in.DNSNames, &out.DNSNames - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.DNSZones != nil { - in, out := &in.DNSZones, &out.DNSZones - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateDNSNameSelector. -func (in *CertificateDNSNameSelector) DeepCopy() *CertificateDNSNameSelector { - if in == nil { - return nil - } - out := new(CertificateDNSNameSelector) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CertificateList) DeepCopyInto(out *CertificateList) { *out = *in @@ -671,7 +209,7 @@ func (in *CertificateRequestSpec) DeepCopyInto(out *CertificateRequestSpec) { *out = *in if in.Duration != nil { in, out := &in.Duration, &out.Duration - *out = new(metav1.Duration) + *out = new(v1.Duration) (*in).DeepCopyInto(*out) } out.IssuerRef = in.IssuerRef @@ -745,12 +283,12 @@ func (in *CertificateSpec) DeepCopyInto(out *CertificateSpec) { } if in.Duration != nil { in, out := &in.Duration, &out.Duration - *out = new(metav1.Duration) + *out = new(v1.Duration) (*in).DeepCopyInto(*out) } if in.RenewBefore != nil { in, out := &in.RenewBefore, &out.RenewBefore - *out = new(metav1.Duration) + *out = new(v1.Duration) (*in).DeepCopyInto(*out) } if in.DNSNames != nil { @@ -813,105 +351,6 @@ func (in *CertificateStatus) DeepCopy() *CertificateStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Challenge) DeepCopyInto(out *Challenge) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Challenge. -func (in *Challenge) DeepCopy() *Challenge { - if in == nil { - return nil - } - out := new(Challenge) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Challenge) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ChallengeList) DeepCopyInto(out *ChallengeList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Challenge, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChallengeList. -func (in *ChallengeList) DeepCopy() *ChallengeList { - if in == nil { - return nil - } - out := new(ChallengeList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ChallengeList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ChallengeSpec) DeepCopyInto(out *ChallengeSpec) { - *out = *in - if in.Solver != nil { - in, out := &in.Solver, &out.Solver - *out = new(ACMEChallengeSolver) - (*in).DeepCopyInto(*out) - } - out.IssuerRef = in.IssuerRef - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChallengeSpec. -func (in *ChallengeSpec) DeepCopy() *ChallengeSpec { - if in == nil { - return nil - } - out := new(ChallengeSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ChallengeStatus) DeepCopyInto(out *ChallengeStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChallengeStatus. -func (in *ChallengeStatus) DeepCopy() *ChallengeStatus { - if in == nil { - return nil - } - out := new(ChallengeStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterIssuer) DeepCopyInto(out *ClusterIssuer) { *out = *in @@ -1026,7 +465,7 @@ func (in *IssuerConfig) DeepCopyInto(out *IssuerConfig) { *out = *in if in.ACME != nil { in, out := &in.ACME, &out.ACME - *out = new(ACMEIssuer) + *out = new(acmev1alpha2.ACMEIssuer) (*in).DeepCopyInto(*out) } if in.CA != nil { @@ -1124,7 +563,7 @@ func (in *IssuerStatus) DeepCopyInto(out *IssuerStatus) { } if in.ACME != nil { in, out := &in.ACME, &out.ACME - *out = new(ACMEIssuerStatus) + *out = new(acmev1alpha2.ACMEIssuerStatus) **out = **in } return @@ -1140,126 +579,6 @@ func (in *IssuerStatus) DeepCopy() *IssuerStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Order) DeepCopyInto(out *Order) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Order. -func (in *Order) DeepCopy() *Order { - if in == nil { - return nil - } - out := new(Order) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Order) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OrderList) DeepCopyInto(out *OrderList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Order, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OrderList. -func (in *OrderList) DeepCopy() *OrderList { - if in == nil { - return nil - } - out := new(OrderList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OrderList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OrderSpec) DeepCopyInto(out *OrderSpec) { - *out = *in - if in.CSR != nil { - in, out := &in.CSR, &out.CSR - *out = make([]byte, len(*in)) - copy(*out, *in) - } - out.IssuerRef = in.IssuerRef - if in.DNSNames != nil { - in, out := &in.DNSNames, &out.DNSNames - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OrderSpec. -func (in *OrderSpec) DeepCopy() *OrderSpec { - if in == nil { - return nil - } - out := new(OrderSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OrderStatus) DeepCopyInto(out *OrderStatus) { - *out = *in - if in.Authorizations != nil { - in, out := &in.Authorizations, &out.Authorizations - *out = make([]ACMEAuthorization, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Certificate != nil { - in, out := &in.Certificate, &out.Certificate - *out = make([]byte, len(*in)) - copy(*out, *in) - } - if in.FailureTime != nil { - in, out := &in.FailureTime, &out.FailureTime - *out = (*in).DeepCopy() - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OrderStatus. -func (in *OrderStatus) DeepCopy() *OrderStatus { - if in == nil { - return nil - } - out := new(OrderStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SelfSignedIssuer) DeepCopyInto(out *SelfSignedIssuer) { *out = *in diff --git a/pkg/client/clientset/versioned/BUILD.bazel b/pkg/client/clientset/versioned/BUILD.bazel index 4d238bc9884..58dc955869d 100644 --- a/pkg/client/clientset/versioned/BUILD.bazel +++ b/pkg/client/clientset/versioned/BUILD.bazel @@ -9,6 +9,7 @@ go_library( importpath = "github.com/jetstack/cert-manager/pkg/client/clientset/versioned", visibility = ["//visibility:public"], deps = [ + "//pkg/client/clientset/versioned/typed/acme/v1alpha2:go_default_library", "//pkg/client/clientset/versioned/typed/certmanager/v1alpha2:go_default_library", "//vendor/k8s.io/client-go/discovery:go_default_library", "//vendor/k8s.io/client-go/rest:go_default_library", @@ -29,6 +30,7 @@ filegroup( ":package-srcs", "//pkg/client/clientset/versioned/fake:all-srcs", "//pkg/client/clientset/versioned/scheme:all-srcs", + "//pkg/client/clientset/versioned/typed/acme/v1alpha2:all-srcs", "//pkg/client/clientset/versioned/typed/certmanager/v1alpha2:all-srcs", ], tags = ["automanaged"], diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 780e6f9342e..0297277583b 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -21,6 +21,7 @@ package versioned import ( "fmt" + acmev1alpha2 "github.com/jetstack/cert-manager/pkg/client/clientset/versioned/typed/acme/v1alpha2" certmanagerv1alpha2 "github.com/jetstack/cert-manager/pkg/client/clientset/versioned/typed/certmanager/v1alpha2" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" @@ -29,6 +30,7 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface + AcmeV1alpha2() acmev1alpha2.AcmeV1alpha2Interface CertmanagerV1alpha2() certmanagerv1alpha2.CertmanagerV1alpha2Interface } @@ -36,9 +38,15 @@ type Interface interface { // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient + acmeV1alpha2 *acmev1alpha2.AcmeV1alpha2Client certmanagerV1alpha2 *certmanagerv1alpha2.CertmanagerV1alpha2Client } +// AcmeV1alpha2 retrieves the AcmeV1alpha2Client +func (c *Clientset) AcmeV1alpha2() acmev1alpha2.AcmeV1alpha2Interface { + return c.acmeV1alpha2 +} + // CertmanagerV1alpha2 retrieves the CertmanagerV1alpha2Client func (c *Clientset) CertmanagerV1alpha2() certmanagerv1alpha2.CertmanagerV1alpha2Interface { return c.certmanagerV1alpha2 @@ -65,6 +73,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { } var cs Clientset var err error + cs.acmeV1alpha2, err = acmev1alpha2.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } cs.certmanagerV1alpha2, err = certmanagerv1alpha2.NewForConfig(&configShallowCopy) if err != nil { return nil, err @@ -81,6 +93,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *Clientset { var cs Clientset + cs.acmeV1alpha2 = acmev1alpha2.NewForConfigOrDie(c) cs.certmanagerV1alpha2 = certmanagerv1alpha2.NewForConfigOrDie(c) cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) @@ -90,6 +103,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset + cs.acmeV1alpha2 = acmev1alpha2.New(c) cs.certmanagerV1alpha2 = certmanagerv1alpha2.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) diff --git a/pkg/client/clientset/versioned/fake/BUILD.bazel b/pkg/client/clientset/versioned/fake/BUILD.bazel index fd94d69d06d..c99dd60c68c 100644 --- a/pkg/client/clientset/versioned/fake/BUILD.bazel +++ b/pkg/client/clientset/versioned/fake/BUILD.bazel @@ -10,8 +10,11 @@ go_library( importpath = "github.com/jetstack/cert-manager/pkg/client/clientset/versioned/fake", visibility = ["//visibility:public"], deps = [ + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/client/clientset/versioned:go_default_library", + "//pkg/client/clientset/versioned/typed/acme/v1alpha2:go_default_library", + "//pkg/client/clientset/versioned/typed/acme/v1alpha2/fake:go_default_library", "//pkg/client/clientset/versioned/typed/certmanager/v1alpha2:go_default_library", "//pkg/client/clientset/versioned/typed/certmanager/v1alpha2/fake:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index 438e9f89c39..aa960a0062b 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -20,6 +20,8 @@ package fake import ( clientset "github.com/jetstack/cert-manager/pkg/client/clientset/versioned" + acmev1alpha2 "github.com/jetstack/cert-manager/pkg/client/clientset/versioned/typed/acme/v1alpha2" + fakeacmev1alpha2 "github.com/jetstack/cert-manager/pkg/client/clientset/versioned/typed/acme/v1alpha2/fake" certmanagerv1alpha2 "github.com/jetstack/cert-manager/pkg/client/clientset/versioned/typed/certmanager/v1alpha2" fakecertmanagerv1alpha2 "github.com/jetstack/cert-manager/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/fake" "k8s.io/apimachinery/pkg/runtime" @@ -76,6 +78,11 @@ func (c *Clientset) Tracker() testing.ObjectTracker { var _ clientset.Interface = &Clientset{} +// AcmeV1alpha2 retrieves the AcmeV1alpha2Client +func (c *Clientset) AcmeV1alpha2() acmev1alpha2.AcmeV1alpha2Interface { + return &fakeacmev1alpha2.FakeAcmeV1alpha2{Fake: &c.Fake} +} + // CertmanagerV1alpha2 retrieves the CertmanagerV1alpha2Client func (c *Clientset) CertmanagerV1alpha2() certmanagerv1alpha2.CertmanagerV1alpha2Interface { return &fakecertmanagerv1alpha2.FakeCertmanagerV1alpha2{Fake: &c.Fake} diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 42651f3926a..fc6855c915d 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -19,6 +19,7 @@ limitations under the License. package fake import ( + acmev1alpha2 "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" certmanagerv1alpha2 "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -31,6 +32,7 @@ var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) var parameterCodec = runtime.NewParameterCodec(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ + acmev1alpha2.AddToScheme, certmanagerv1alpha2.AddToScheme, } diff --git a/pkg/client/clientset/versioned/scheme/BUILD.bazel b/pkg/client/clientset/versioned/scheme/BUILD.bazel index 143a60fc466..8b76f61e873 100644 --- a/pkg/client/clientset/versioned/scheme/BUILD.bazel +++ b/pkg/client/clientset/versioned/scheme/BUILD.bazel @@ -9,6 +9,7 @@ go_library( importpath = "github.com/jetstack/cert-manager/pkg/client/clientset/versioned/scheme", visibility = ["//visibility:public"], deps = [ + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index 391285939b9..2795b2c7f86 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -19,6 +19,7 @@ limitations under the License. package scheme import ( + acmev1alpha2 "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" certmanagerv1alpha2 "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -31,6 +32,7 @@ var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ + acmev1alpha2.AddToScheme, certmanagerv1alpha2.AddToScheme, } diff --git a/pkg/client/clientset/versioned/typed/acme/v1alpha2/BUILD.bazel b/pkg/client/clientset/versioned/typed/acme/v1alpha2/BUILD.bazel new file mode 100644 index 00000000000..d0fe7a61477 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/acme/v1alpha2/BUILD.bazel @@ -0,0 +1,39 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "acme_client.go", + "challenge.go", + "doc.go", + "generated_expansion.go", + "order.go", + ], + importpath = "github.com/jetstack/cert-manager/pkg/client/clientset/versioned/typed/acme/v1alpha2", + visibility = ["//visibility:public"], + deps = [ + "//pkg/apis/acme/v1alpha2:go_default_library", + "//pkg/client/clientset/versioned/scheme:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", + "//vendor/k8s.io/client-go/rest:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [ + ":package-srcs", + "//pkg/client/clientset/versioned/typed/acme/v1alpha2/fake:all-srcs", + ], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/pkg/client/clientset/versioned/typed/acme/v1alpha2/acme_client.go b/pkg/client/clientset/versioned/typed/acme/v1alpha2/acme_client.go new file mode 100644 index 00000000000..a6fb039f1d7 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/acme/v1alpha2/acme_client.go @@ -0,0 +1,94 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1alpha2 "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" + "github.com/jetstack/cert-manager/pkg/client/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type AcmeV1alpha2Interface interface { + RESTClient() rest.Interface + ChallengesGetter + OrdersGetter +} + +// AcmeV1alpha2Client is used to interact with features provided by the acme.cert-manager.io group. +type AcmeV1alpha2Client struct { + restClient rest.Interface +} + +func (c *AcmeV1alpha2Client) Challenges(namespace string) ChallengeInterface { + return newChallenges(c, namespace) +} + +func (c *AcmeV1alpha2Client) Orders(namespace string) OrderInterface { + return newOrders(c, namespace) +} + +// NewForConfig creates a new AcmeV1alpha2Client for the given config. +func NewForConfig(c *rest.Config) (*AcmeV1alpha2Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &AcmeV1alpha2Client{client}, nil +} + +// NewForConfigOrDie creates a new AcmeV1alpha2Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *AcmeV1alpha2Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new AcmeV1alpha2Client for the given RESTClient. +func New(c rest.Interface) *AcmeV1alpha2Client { + return &AcmeV1alpha2Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha2.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *AcmeV1alpha2Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/challenge.go b/pkg/client/clientset/versioned/typed/acme/v1alpha2/challenge.go similarity index 97% rename from pkg/client/clientset/versioned/typed/certmanager/v1alpha2/challenge.go rename to pkg/client/clientset/versioned/typed/acme/v1alpha2/challenge.go index 8ea4597f9d1..36ff2769925 100644 --- a/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/challenge.go +++ b/pkg/client/clientset/versioned/typed/acme/v1alpha2/challenge.go @@ -21,7 +21,7 @@ package v1alpha2 import ( "time" - v1alpha2 "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + v1alpha2 "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" scheme "github.com/jetstack/cert-manager/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -56,7 +56,7 @@ type challenges struct { } // newChallenges returns a Challenges -func newChallenges(c *CertmanagerV1alpha2Client, namespace string) *challenges { +func newChallenges(c *AcmeV1alpha2Client, namespace string) *challenges { return &challenges{ client: c.RESTClient(), ns: namespace, diff --git a/pkg/client/clientset/versioned/typed/acme/v1alpha2/doc.go b/pkg/client/clientset/versioned/typed/acme/v1alpha2/doc.go new file mode 100644 index 00000000000..18a30036cdb --- /dev/null +++ b/pkg/client/clientset/versioned/typed/acme/v1alpha2/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha2 diff --git a/pkg/client/clientset/versioned/typed/acme/v1alpha2/fake/BUILD.bazel b/pkg/client/clientset/versioned/typed/acme/v1alpha2/fake/BUILD.bazel new file mode 100644 index 00000000000..444ca981f59 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/acme/v1alpha2/fake/BUILD.bazel @@ -0,0 +1,38 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "doc.go", + "fake_acme_client.go", + "fake_challenge.go", + "fake_order.go", + ], + importpath = "github.com/jetstack/cert-manager/pkg/client/clientset/versioned/typed/acme/v1alpha2/fake", + visibility = ["//visibility:public"], + deps = [ + "//pkg/apis/acme/v1alpha2:go_default_library", + "//pkg/client/clientset/versioned/typed/acme/v1alpha2:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", + "//vendor/k8s.io/client-go/rest:go_default_library", + "//vendor/k8s.io/client-go/testing:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/pkg/client/clientset/versioned/typed/acme/v1alpha2/fake/doc.go b/pkg/client/clientset/versioned/typed/acme/v1alpha2/fake/doc.go new file mode 100644 index 00000000000..1999bfee55f --- /dev/null +++ b/pkg/client/clientset/versioned/typed/acme/v1alpha2/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/client/clientset/versioned/typed/acme/v1alpha2/fake/fake_acme_client.go b/pkg/client/clientset/versioned/typed/acme/v1alpha2/fake/fake_acme_client.go new file mode 100644 index 00000000000..1392508dda2 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/acme/v1alpha2/fake/fake_acme_client.go @@ -0,0 +1,44 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha2 "github.com/jetstack/cert-manager/pkg/client/clientset/versioned/typed/acme/v1alpha2" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeAcmeV1alpha2 struct { + *testing.Fake +} + +func (c *FakeAcmeV1alpha2) Challenges(namespace string) v1alpha2.ChallengeInterface { + return &FakeChallenges{c, namespace} +} + +func (c *FakeAcmeV1alpha2) Orders(namespace string) v1alpha2.OrderInterface { + return &FakeOrders{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeAcmeV1alpha2) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/fake/fake_challenge.go b/pkg/client/clientset/versioned/typed/acme/v1alpha2/fake/fake_challenge.go similarity index 93% rename from pkg/client/clientset/versioned/typed/certmanager/v1alpha2/fake/fake_challenge.go rename to pkg/client/clientset/versioned/typed/acme/v1alpha2/fake/fake_challenge.go index 9fd914a6358..cf8b5f3f98d 100644 --- a/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/fake/fake_challenge.go +++ b/pkg/client/clientset/versioned/typed/acme/v1alpha2/fake/fake_challenge.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - v1alpha2 "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + v1alpha2 "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,13 +30,13 @@ import ( // FakeChallenges implements ChallengeInterface type FakeChallenges struct { - Fake *FakeCertmanagerV1alpha2 + Fake *FakeAcmeV1alpha2 ns string } -var challengesResource = schema.GroupVersionResource{Group: "certmanager.k8s.io", Version: "v1alpha2", Resource: "challenges"} +var challengesResource = schema.GroupVersionResource{Group: "acme.cert-manager.io", Version: "v1alpha2", Resource: "challenges"} -var challengesKind = schema.GroupVersionKind{Group: "certmanager.k8s.io", Version: "v1alpha2", Kind: "Challenge"} +var challengesKind = schema.GroupVersionKind{Group: "acme.cert-manager.io", Version: "v1alpha2", Kind: "Challenge"} // Get takes name of the challenge, and returns the corresponding challenge object, and an error if there is any. func (c *FakeChallenges) Get(name string, options v1.GetOptions) (result *v1alpha2.Challenge, err error) { diff --git a/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/fake/fake_order.go b/pkg/client/clientset/versioned/typed/acme/v1alpha2/fake/fake_order.go similarity index 93% rename from pkg/client/clientset/versioned/typed/certmanager/v1alpha2/fake/fake_order.go rename to pkg/client/clientset/versioned/typed/acme/v1alpha2/fake/fake_order.go index 533bbbf75b7..bc656bea3d7 100644 --- a/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/fake/fake_order.go +++ b/pkg/client/clientset/versioned/typed/acme/v1alpha2/fake/fake_order.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - v1alpha2 "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + v1alpha2 "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,13 +30,13 @@ import ( // FakeOrders implements OrderInterface type FakeOrders struct { - Fake *FakeCertmanagerV1alpha2 + Fake *FakeAcmeV1alpha2 ns string } -var ordersResource = schema.GroupVersionResource{Group: "certmanager.k8s.io", Version: "v1alpha2", Resource: "orders"} +var ordersResource = schema.GroupVersionResource{Group: "acme.cert-manager.io", Version: "v1alpha2", Resource: "orders"} -var ordersKind = schema.GroupVersionKind{Group: "certmanager.k8s.io", Version: "v1alpha2", Kind: "Order"} +var ordersKind = schema.GroupVersionKind{Group: "acme.cert-manager.io", Version: "v1alpha2", Kind: "Order"} // Get takes name of the order, and returns the corresponding order object, and an error if there is any. func (c *FakeOrders) Get(name string, options v1.GetOptions) (result *v1alpha2.Order, err error) { diff --git a/pkg/client/clientset/versioned/typed/acme/v1alpha2/generated_expansion.go b/pkg/client/clientset/versioned/typed/acme/v1alpha2/generated_expansion.go new file mode 100644 index 00000000000..646daa575cb --- /dev/null +++ b/pkg/client/clientset/versioned/typed/acme/v1alpha2/generated_expansion.go @@ -0,0 +1,23 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha2 + +type ChallengeExpansion interface{} + +type OrderExpansion interface{} diff --git a/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/order.go b/pkg/client/clientset/versioned/typed/acme/v1alpha2/order.go similarity index 97% rename from pkg/client/clientset/versioned/typed/certmanager/v1alpha2/order.go rename to pkg/client/clientset/versioned/typed/acme/v1alpha2/order.go index 57b739cfc84..d4af84997b5 100644 --- a/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/order.go +++ b/pkg/client/clientset/versioned/typed/acme/v1alpha2/order.go @@ -21,7 +21,7 @@ package v1alpha2 import ( "time" - v1alpha2 "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + v1alpha2 "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" scheme "github.com/jetstack/cert-manager/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -56,7 +56,7 @@ type orders struct { } // newOrders returns a Orders -func newOrders(c *CertmanagerV1alpha2Client, namespace string) *orders { +func newOrders(c *AcmeV1alpha2Client, namespace string) *orders { return &orders{ client: c.RESTClient(), ns: namespace, diff --git a/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/BUILD.bazel b/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/BUILD.bazel index 7b8aed99b66..ee75298389f 100644 --- a/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/BUILD.bazel +++ b/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/BUILD.bazel @@ -6,12 +6,10 @@ go_library( "certificate.go", "certificaterequest.go", "certmanager_client.go", - "challenge.go", "clusterissuer.go", "doc.go", "generated_expansion.go", "issuer.go", - "order.go", ], importpath = "github.com/jetstack/cert-manager/pkg/client/clientset/versioned/typed/certmanager/v1alpha2", visibility = ["//visibility:public"], diff --git a/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/certmanager_client.go b/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/certmanager_client.go index 657e10dee98..953e7d8bffe 100644 --- a/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/certmanager_client.go +++ b/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/certmanager_client.go @@ -28,10 +28,8 @@ type CertmanagerV1alpha2Interface interface { RESTClient() rest.Interface CertificatesGetter CertificateRequestsGetter - ChallengesGetter ClusterIssuersGetter IssuersGetter - OrdersGetter } // CertmanagerV1alpha2Client is used to interact with features provided by the certmanager.k8s.io group. @@ -47,10 +45,6 @@ func (c *CertmanagerV1alpha2Client) CertificateRequests(namespace string) Certif return newCertificateRequests(c, namespace) } -func (c *CertmanagerV1alpha2Client) Challenges(namespace string) ChallengeInterface { - return newChallenges(c, namespace) -} - func (c *CertmanagerV1alpha2Client) ClusterIssuers() ClusterIssuerInterface { return newClusterIssuers(c) } @@ -59,10 +53,6 @@ func (c *CertmanagerV1alpha2Client) Issuers(namespace string) IssuerInterface { return newIssuers(c, namespace) } -func (c *CertmanagerV1alpha2Client) Orders(namespace string) OrderInterface { - return newOrders(c, namespace) -} - // NewForConfig creates a new CertmanagerV1alpha2Client for the given config. func NewForConfig(c *rest.Config) (*CertmanagerV1alpha2Client, error) { config := *c diff --git a/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/fake/BUILD.bazel b/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/fake/BUILD.bazel index 0d4dda12735..89ac8519174 100644 --- a/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/fake/BUILD.bazel +++ b/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/fake/BUILD.bazel @@ -7,10 +7,8 @@ go_library( "fake_certificate.go", "fake_certificaterequest.go", "fake_certmanager_client.go", - "fake_challenge.go", "fake_clusterissuer.go", "fake_issuer.go", - "fake_order.go", ], importpath = "github.com/jetstack/cert-manager/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/fake", visibility = ["//visibility:public"], diff --git a/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/fake/fake_certmanager_client.go b/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/fake/fake_certmanager_client.go index 8bef0ed6a6e..b1749f4fc53 100644 --- a/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/fake/fake_certmanager_client.go +++ b/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/fake/fake_certmanager_client.go @@ -36,10 +36,6 @@ func (c *FakeCertmanagerV1alpha2) CertificateRequests(namespace string) v1alpha2 return &FakeCertificateRequests{c, namespace} } -func (c *FakeCertmanagerV1alpha2) Challenges(namespace string) v1alpha2.ChallengeInterface { - return &FakeChallenges{c, namespace} -} - func (c *FakeCertmanagerV1alpha2) ClusterIssuers() v1alpha2.ClusterIssuerInterface { return &FakeClusterIssuers{c} } @@ -48,10 +44,6 @@ func (c *FakeCertmanagerV1alpha2) Issuers(namespace string) v1alpha2.IssuerInter return &FakeIssuers{c, namespace} } -func (c *FakeCertmanagerV1alpha2) Orders(namespace string) v1alpha2.OrderInterface { - return &FakeOrders{c, namespace} -} - // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeCertmanagerV1alpha2) RESTClient() rest.Interface { diff --git a/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/generated_expansion.go b/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/generated_expansion.go index ee14a2d940d..fc6a5b9078f 100644 --- a/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/certmanager/v1alpha2/generated_expansion.go @@ -22,10 +22,6 @@ type CertificateExpansion interface{} type CertificateRequestExpansion interface{} -type ChallengeExpansion interface{} - type ClusterIssuerExpansion interface{} type IssuerExpansion interface{} - -type OrderExpansion interface{} diff --git a/pkg/client/informers/externalversions/BUILD.bazel b/pkg/client/informers/externalversions/BUILD.bazel index 83f710d9818..3ac222fc4d3 100644 --- a/pkg/client/informers/externalversions/BUILD.bazel +++ b/pkg/client/informers/externalversions/BUILD.bazel @@ -9,8 +9,10 @@ go_library( importpath = "github.com/jetstack/cert-manager/pkg/client/informers/externalversions", visibility = ["//visibility:public"], deps = [ + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/client/clientset/versioned:go_default_library", + "//pkg/client/informers/externalversions/acme:go_default_library", "//pkg/client/informers/externalversions/certmanager:go_default_library", "//pkg/client/informers/externalversions/internalinterfaces:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", @@ -31,6 +33,7 @@ filegroup( name = "all-srcs", srcs = [ ":package-srcs", + "//pkg/client/informers/externalversions/acme:all-srcs", "//pkg/client/informers/externalversions/certmanager:all-srcs", "//pkg/client/informers/externalversions/internalinterfaces:all-srcs", ], diff --git a/pkg/client/informers/externalversions/acme/BUILD.bazel b/pkg/client/informers/externalversions/acme/BUILD.bazel new file mode 100644 index 00000000000..4b2fdc6016c --- /dev/null +++ b/pkg/client/informers/externalversions/acme/BUILD.bazel @@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["interface.go"], + importpath = "github.com/jetstack/cert-manager/pkg/client/informers/externalversions/acme", + visibility = ["//visibility:public"], + deps = [ + "//pkg/client/informers/externalversions/acme/v1alpha2:go_default_library", + "//pkg/client/informers/externalversions/internalinterfaces:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [ + ":package-srcs", + "//pkg/client/informers/externalversions/acme/v1alpha2:all-srcs", + ], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/pkg/client/informers/externalversions/acme/interface.go b/pkg/client/informers/externalversions/acme/interface.go new file mode 100644 index 00000000000..828b6bd8a22 --- /dev/null +++ b/pkg/client/informers/externalversions/acme/interface.go @@ -0,0 +1,46 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package acme + +import ( + v1alpha2 "github.com/jetstack/cert-manager/pkg/client/informers/externalversions/acme/v1alpha2" + internalinterfaces "github.com/jetstack/cert-manager/pkg/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1alpha2 provides access to shared informers for resources in V1alpha2. + V1alpha2() v1alpha2.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1alpha2 returns a new v1alpha2.Interface. +func (g *group) V1alpha2() v1alpha2.Interface { + return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/pkg/client/informers/externalversions/acme/v1alpha2/BUILD.bazel b/pkg/client/informers/externalversions/acme/v1alpha2/BUILD.bazel new file mode 100644 index 00000000000..114d0dbbe8c --- /dev/null +++ b/pkg/client/informers/externalversions/acme/v1alpha2/BUILD.bazel @@ -0,0 +1,36 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "challenge.go", + "interface.go", + "order.go", + ], + importpath = "github.com/jetstack/cert-manager/pkg/client/informers/externalversions/acme/v1alpha2", + visibility = ["//visibility:public"], + deps = [ + "//pkg/apis/acme/v1alpha2:go_default_library", + "//pkg/client/clientset/versioned:go_default_library", + "//pkg/client/informers/externalversions/internalinterfaces:go_default_library", + "//pkg/client/listers/acme/v1alpha2:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", + "//vendor/k8s.io/client-go/tools/cache:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/pkg/client/informers/externalversions/certmanager/v1alpha2/challenge.go b/pkg/client/informers/externalversions/acme/v1alpha2/challenge.go similarity index 88% rename from pkg/client/informers/externalversions/certmanager/v1alpha2/challenge.go rename to pkg/client/informers/externalversions/acme/v1alpha2/challenge.go index 6f0b7aeb6db..9ae0e4b149b 100644 --- a/pkg/client/informers/externalversions/certmanager/v1alpha2/challenge.go +++ b/pkg/client/informers/externalversions/acme/v1alpha2/challenge.go @@ -21,10 +21,10 @@ package v1alpha2 import ( time "time" - certmanagerv1alpha2 "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + acmev1alpha2 "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" versioned "github.com/jetstack/cert-manager/pkg/client/clientset/versioned" internalinterfaces "github.com/jetstack/cert-manager/pkg/client/informers/externalversions/internalinterfaces" - v1alpha2 "github.com/jetstack/cert-manager/pkg/client/listers/certmanager/v1alpha2" + v1alpha2 "github.com/jetstack/cert-manager/pkg/client/listers/acme/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -61,16 +61,16 @@ func NewFilteredChallengeInformer(client versioned.Interface, namespace string, if tweakListOptions != nil { tweakListOptions(&options) } - return client.CertmanagerV1alpha2().Challenges(namespace).List(options) + return client.AcmeV1alpha2().Challenges(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CertmanagerV1alpha2().Challenges(namespace).Watch(options) + return client.AcmeV1alpha2().Challenges(namespace).Watch(options) }, }, - &certmanagerv1alpha2.Challenge{}, + &acmev1alpha2.Challenge{}, resyncPeriod, indexers, ) @@ -81,7 +81,7 @@ func (f *challengeInformer) defaultInformer(client versioned.Interface, resyncPe } func (f *challengeInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&certmanagerv1alpha2.Challenge{}, f.defaultInformer) + return f.factory.InformerFor(&acmev1alpha2.Challenge{}, f.defaultInformer) } func (f *challengeInformer) Lister() v1alpha2.ChallengeLister { diff --git a/pkg/client/informers/externalversions/acme/v1alpha2/interface.go b/pkg/client/informers/externalversions/acme/v1alpha2/interface.go new file mode 100644 index 00000000000..4628a90efcf --- /dev/null +++ b/pkg/client/informers/externalversions/acme/v1alpha2/interface.go @@ -0,0 +1,52 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + internalinterfaces "github.com/jetstack/cert-manager/pkg/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // Challenges returns a ChallengeInformer. + Challenges() ChallengeInformer + // Orders returns a OrderInformer. + Orders() OrderInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// Challenges returns a ChallengeInformer. +func (v *version) Challenges() ChallengeInformer { + return &challengeInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// Orders returns a OrderInformer. +func (v *version) Orders() OrderInformer { + return &orderInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/pkg/client/informers/externalversions/certmanager/v1alpha2/order.go b/pkg/client/informers/externalversions/acme/v1alpha2/order.go similarity index 88% rename from pkg/client/informers/externalversions/certmanager/v1alpha2/order.go rename to pkg/client/informers/externalversions/acme/v1alpha2/order.go index 2274ddb48f9..4de1073c15f 100644 --- a/pkg/client/informers/externalversions/certmanager/v1alpha2/order.go +++ b/pkg/client/informers/externalversions/acme/v1alpha2/order.go @@ -21,10 +21,10 @@ package v1alpha2 import ( time "time" - certmanagerv1alpha2 "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + acmev1alpha2 "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" versioned "github.com/jetstack/cert-manager/pkg/client/clientset/versioned" internalinterfaces "github.com/jetstack/cert-manager/pkg/client/informers/externalversions/internalinterfaces" - v1alpha2 "github.com/jetstack/cert-manager/pkg/client/listers/certmanager/v1alpha2" + v1alpha2 "github.com/jetstack/cert-manager/pkg/client/listers/acme/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -61,16 +61,16 @@ func NewFilteredOrderInformer(client versioned.Interface, namespace string, resy if tweakListOptions != nil { tweakListOptions(&options) } - return client.CertmanagerV1alpha2().Orders(namespace).List(options) + return client.AcmeV1alpha2().Orders(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CertmanagerV1alpha2().Orders(namespace).Watch(options) + return client.AcmeV1alpha2().Orders(namespace).Watch(options) }, }, - &certmanagerv1alpha2.Order{}, + &acmev1alpha2.Order{}, resyncPeriod, indexers, ) @@ -81,7 +81,7 @@ func (f *orderInformer) defaultInformer(client versioned.Interface, resyncPeriod } func (f *orderInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&certmanagerv1alpha2.Order{}, f.defaultInformer) + return f.factory.InformerFor(&acmev1alpha2.Order{}, f.defaultInformer) } func (f *orderInformer) Lister() v1alpha2.OrderLister { diff --git a/pkg/client/informers/externalversions/certmanager/v1alpha2/BUILD.bazel b/pkg/client/informers/externalversions/certmanager/v1alpha2/BUILD.bazel index 304fa31aea4..cf78059e775 100644 --- a/pkg/client/informers/externalversions/certmanager/v1alpha2/BUILD.bazel +++ b/pkg/client/informers/externalversions/certmanager/v1alpha2/BUILD.bazel @@ -5,11 +5,9 @@ go_library( srcs = [ "certificate.go", "certificaterequest.go", - "challenge.go", "clusterissuer.go", "interface.go", "issuer.go", - "order.go", ], importpath = "github.com/jetstack/cert-manager/pkg/client/informers/externalversions/certmanager/v1alpha2", visibility = ["//visibility:public"], diff --git a/pkg/client/informers/externalversions/certmanager/v1alpha2/interface.go b/pkg/client/informers/externalversions/certmanager/v1alpha2/interface.go index 43fd331bf76..55383974711 100644 --- a/pkg/client/informers/externalversions/certmanager/v1alpha2/interface.go +++ b/pkg/client/informers/externalversions/certmanager/v1alpha2/interface.go @@ -28,14 +28,10 @@ type Interface interface { Certificates() CertificateInformer // CertificateRequests returns a CertificateRequestInformer. CertificateRequests() CertificateRequestInformer - // Challenges returns a ChallengeInformer. - Challenges() ChallengeInformer // ClusterIssuers returns a ClusterIssuerInformer. ClusterIssuers() ClusterIssuerInformer // Issuers returns a IssuerInformer. Issuers() IssuerInformer - // Orders returns a OrderInformer. - Orders() OrderInformer } type version struct { @@ -59,11 +55,6 @@ func (v *version) CertificateRequests() CertificateRequestInformer { return &certificateRequestInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// Challenges returns a ChallengeInformer. -func (v *version) Challenges() ChallengeInformer { - return &challengeInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - // ClusterIssuers returns a ClusterIssuerInformer. func (v *version) ClusterIssuers() ClusterIssuerInformer { return &clusterIssuerInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} @@ -73,8 +64,3 @@ func (v *version) ClusterIssuers() ClusterIssuerInformer { func (v *version) Issuers() IssuerInformer { return &issuerInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } - -// Orders returns a OrderInformer. -func (v *version) Orders() OrderInformer { - return &orderInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index 1c55d501967..cf8c5362cc1 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -24,6 +24,7 @@ import ( time "time" versioned "github.com/jetstack/cert-manager/pkg/client/clientset/versioned" + acme "github.com/jetstack/cert-manager/pkg/client/informers/externalversions/acme" certmanager "github.com/jetstack/cert-manager/pkg/client/informers/externalversions/certmanager" internalinterfaces "github.com/jetstack/cert-manager/pkg/client/informers/externalversions/internalinterfaces" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -172,9 +173,14 @@ type SharedInformerFactory interface { ForResource(resource schema.GroupVersionResource) (GenericInformer, error) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + Acme() acme.Interface Certmanager() certmanager.Interface } +func (f *sharedInformerFactory) Acme() acme.Interface { + return acme.New(f, f.namespace, f.tweakListOptions) +} + func (f *sharedInformerFactory) Certmanager() certmanager.Interface { return certmanager.New(f, f.namespace, f.tweakListOptions) } diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index 94c24e34b73..9be416ae339 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -21,7 +21,8 @@ package externalversions import ( "fmt" - v1alpha2 "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + v1alpha2 "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" + certmanagerv1alpha2 "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) @@ -52,19 +53,21 @@ func (f *genericInformer) Lister() cache.GenericLister { // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { - // Group=certmanager.k8s.io, Version=v1alpha2 - case v1alpha2.SchemeGroupVersion.WithResource("certificates"): + // Group=acme.cert-manager.io, Version=v1alpha2 + case v1alpha2.SchemeGroupVersion.WithResource("challenges"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Acme().V1alpha2().Challenges().Informer()}, nil + case v1alpha2.SchemeGroupVersion.WithResource("orders"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Acme().V1alpha2().Orders().Informer()}, nil + + // Group=certmanager.k8s.io, Version=v1alpha2 + case certmanagerv1alpha2.SchemeGroupVersion.WithResource("certificates"): return &genericInformer{resource: resource.GroupResource(), informer: f.Certmanager().V1alpha2().Certificates().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("certificaterequests"): + case certmanagerv1alpha2.SchemeGroupVersion.WithResource("certificaterequests"): return &genericInformer{resource: resource.GroupResource(), informer: f.Certmanager().V1alpha2().CertificateRequests().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("challenges"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Certmanager().V1alpha2().Challenges().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("clusterissuers"): + case certmanagerv1alpha2.SchemeGroupVersion.WithResource("clusterissuers"): return &genericInformer{resource: resource.GroupResource(), informer: f.Certmanager().V1alpha2().ClusterIssuers().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("issuers"): + case certmanagerv1alpha2.SchemeGroupVersion.WithResource("issuers"): return &genericInformer{resource: resource.GroupResource(), informer: f.Certmanager().V1alpha2().Issuers().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("orders"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Certmanager().V1alpha2().Orders().Informer()}, nil } diff --git a/pkg/client/listers/acme/v1alpha2/BUILD.bazel b/pkg/client/listers/acme/v1alpha2/BUILD.bazel new file mode 100644 index 00000000000..e80295b655e --- /dev/null +++ b/pkg/client/listers/acme/v1alpha2/BUILD.bazel @@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "challenge.go", + "expansion_generated.go", + "order.go", + ], + importpath = "github.com/jetstack/cert-manager/pkg/client/listers/acme/v1alpha2", + visibility = ["//visibility:public"], + deps = [ + "//pkg/apis/acme/v1alpha2:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", + "//vendor/k8s.io/client-go/tools/cache:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/pkg/client/listers/certmanager/v1alpha2/challenge.go b/pkg/client/listers/acme/v1alpha2/challenge.go similarity index 97% rename from pkg/client/listers/certmanager/v1alpha2/challenge.go rename to pkg/client/listers/acme/v1alpha2/challenge.go index 9f4bb6cb1cd..059b315f6e2 100644 --- a/pkg/client/listers/certmanager/v1alpha2/challenge.go +++ b/pkg/client/listers/acme/v1alpha2/challenge.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha2 import ( - v1alpha2 "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + v1alpha2 "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/acme/v1alpha2/expansion_generated.go b/pkg/client/listers/acme/v1alpha2/expansion_generated.go new file mode 100644 index 00000000000..cca6da3ba74 --- /dev/null +++ b/pkg/client/listers/acme/v1alpha2/expansion_generated.go @@ -0,0 +1,35 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha2 + +// ChallengeListerExpansion allows custom methods to be added to +// ChallengeLister. +type ChallengeListerExpansion interface{} + +// ChallengeNamespaceListerExpansion allows custom methods to be added to +// ChallengeNamespaceLister. +type ChallengeNamespaceListerExpansion interface{} + +// OrderListerExpansion allows custom methods to be added to +// OrderLister. +type OrderListerExpansion interface{} + +// OrderNamespaceListerExpansion allows custom methods to be added to +// OrderNamespaceLister. +type OrderNamespaceListerExpansion interface{} diff --git a/pkg/client/listers/certmanager/v1alpha2/order.go b/pkg/client/listers/acme/v1alpha2/order.go similarity index 97% rename from pkg/client/listers/certmanager/v1alpha2/order.go rename to pkg/client/listers/acme/v1alpha2/order.go index 28abc5e9e20..5b1f566db31 100644 --- a/pkg/client/listers/certmanager/v1alpha2/order.go +++ b/pkg/client/listers/acme/v1alpha2/order.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha2 import ( - v1alpha2 "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + v1alpha2 "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/certmanager/v1alpha2/BUILD.bazel b/pkg/client/listers/certmanager/v1alpha2/BUILD.bazel index d1621c3e718..f71a143e464 100644 --- a/pkg/client/listers/certmanager/v1alpha2/BUILD.bazel +++ b/pkg/client/listers/certmanager/v1alpha2/BUILD.bazel @@ -5,11 +5,9 @@ go_library( srcs = [ "certificate.go", "certificaterequest.go", - "challenge.go", "clusterissuer.go", "expansion_generated.go", "issuer.go", - "order.go", ], importpath = "github.com/jetstack/cert-manager/pkg/client/listers/certmanager/v1alpha2", visibility = ["//visibility:public"], diff --git a/pkg/client/listers/certmanager/v1alpha2/expansion_generated.go b/pkg/client/listers/certmanager/v1alpha2/expansion_generated.go index 1553878f555..996d14fd8a0 100644 --- a/pkg/client/listers/certmanager/v1alpha2/expansion_generated.go +++ b/pkg/client/listers/certmanager/v1alpha2/expansion_generated.go @@ -34,14 +34,6 @@ type CertificateRequestListerExpansion interface{} // CertificateRequestNamespaceLister. type CertificateRequestNamespaceListerExpansion interface{} -// ChallengeListerExpansion allows custom methods to be added to -// ChallengeLister. -type ChallengeListerExpansion interface{} - -// ChallengeNamespaceListerExpansion allows custom methods to be added to -// ChallengeNamespaceLister. -type ChallengeNamespaceListerExpansion interface{} - // ClusterIssuerListerExpansion allows custom methods to be added to // ClusterIssuerLister. type ClusterIssuerListerExpansion interface{} @@ -53,11 +45,3 @@ type IssuerListerExpansion interface{} // IssuerNamespaceListerExpansion allows custom methods to be added to // IssuerNamespaceLister. type IssuerNamespaceListerExpansion interface{} - -// OrderListerExpansion allows custom methods to be added to -// OrderLister. -type OrderListerExpansion interface{} - -// OrderNamespaceListerExpansion allows custom methods to be added to -// OrderNamespaceLister. -type OrderNamespaceListerExpansion interface{} diff --git a/pkg/controller/acmechallenges/BUILD.bazel b/pkg/controller/acmechallenges/BUILD.bazel index 18670a77423..eabb2fb0515 100644 --- a/pkg/controller/acmechallenges/BUILD.bazel +++ b/pkg/controller/acmechallenges/BUILD.bazel @@ -12,8 +12,10 @@ go_library( deps = [ "//pkg/acme:go_default_library", "//pkg/acme/client:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/client/clientset/versioned:go_default_library", + "//pkg/client/listers/acme/v1alpha2:go_default_library", "//pkg/client/listers/certmanager/v1alpha2:go_default_library", "//pkg/controller:go_default_library", "//pkg/controller/acmechallenges/scheduler:go_default_library", @@ -44,6 +46,7 @@ go_test( deps = [ "//pkg/acme/client:go_default_library", "//pkg/acme/fake:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", "//pkg/controller/test:go_default_library", diff --git a/pkg/controller/acmechallenges/controller.go b/pkg/controller/acmechallenges/controller.go index b5972cc2539..030bdc31bb7 100644 --- a/pkg/controller/acmechallenges/controller.go +++ b/pkg/controller/acmechallenges/controller.go @@ -30,6 +30,7 @@ import ( "github.com/jetstack/cert-manager/pkg/acme" cmclient "github.com/jetstack/cert-manager/pkg/client/clientset/versioned" + cmacmelisters "github.com/jetstack/cert-manager/pkg/client/listers/acme/v1alpha2" cmlisters "github.com/jetstack/cert-manager/pkg/client/listers/certmanager/v1alpha2" controllerpkg "github.com/jetstack/cert-manager/pkg/controller" "github.com/jetstack/cert-manager/pkg/controller/acmechallenges/scheduler" @@ -46,7 +47,7 @@ type controller struct { acmeHelper acme.Helper // all the listers used by this controller - challengeLister cmlisters.ChallengeLister + challengeLister cmacmelisters.ChallengeLister issuerLister cmlisters.IssuerLister clusterIssuerLister cmlisters.ClusterIssuerLister secretLister corelisters.SecretLister @@ -84,7 +85,7 @@ func (c *controller) Register(ctx *controllerpkg.Context) (workqueue.RateLimitin c.queue = workqueue.NewNamedRateLimitingQueue(workqueue.NewItemExponentialFailureRateLimiter(time.Second*5, time.Minute*30), ControllerName) // obtain references to all the informers used by this controller - challengeInformer := ctx.SharedInformerFactory.Certmanager().V1alpha2().Challenges() + challengeInformer := ctx.SharedInformerFactory.Acme().V1alpha2().Challenges() issuerInformer := ctx.SharedInformerFactory.Certmanager().V1alpha2().Issuers() secretInformer := ctx.KubeSharedInformerFactory.Core().V1().Secrets() // we register these informers here so the HTTP01 solver has a synced @@ -163,7 +164,7 @@ func (c *controller) runScheduler(ctx context.Context) { ch = ch.DeepCopy() ch.Status.Processing = true - _, err := c.cmClient.CertmanagerV1alpha2().Challenges(ch.Namespace).Update(ch) + _, err := c.cmClient.AcmeV1alpha2().Challenges(ch.Namespace).Update(ch) if err != nil { log.Error(err, "error scheduling challenge for processing") return diff --git a/pkg/controller/acmechallenges/scheduler/BUILD.bazel b/pkg/controller/acmechallenges/scheduler/BUILD.bazel index 0bc0f926cd7..b8d5683a338 100644 --- a/pkg/controller/acmechallenges/scheduler/BUILD.bazel +++ b/pkg/controller/acmechallenges/scheduler/BUILD.bazel @@ -7,8 +7,8 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/acme:go_default_library", - "//pkg/apis/certmanager/v1alpha2:go_default_library", - "//pkg/client/listers/certmanager/v1alpha2:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", + "//pkg/client/listers/acme/v1alpha2:go_default_library", "//pkg/logs:go_default_library", "//vendor/github.com/go-logr/logr:go_default_library", "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", @@ -20,7 +20,7 @@ go_test( srcs = ["scheduler_test.go"], embed = [":go_default_library"], deps = [ - "//pkg/apis/certmanager/v1alpha2:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/client/clientset/versioned/fake:go_default_library", "//pkg/client/informers/externalversions:go_default_library", "//pkg/util:go_default_library", diff --git a/pkg/controller/acmechallenges/scheduler/scheduler.go b/pkg/controller/acmechallenges/scheduler/scheduler.go index e79c6430e70..ba5fdfe8af7 100644 --- a/pkg/controller/acmechallenges/scheduler/scheduler.go +++ b/pkg/controller/acmechallenges/scheduler/scheduler.go @@ -24,8 +24,8 @@ import ( "k8s.io/apimachinery/pkg/labels" "github.com/jetstack/cert-manager/pkg/acme" - cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" - cmlisters "github.com/jetstack/cert-manager/pkg/client/listers/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" + cmacmelisters "github.com/jetstack/cert-manager/pkg/client/listers/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/logs" ) @@ -34,12 +34,12 @@ import ( // processing at a given time. type Scheduler struct { log logr.Logger - challengeLister cmlisters.ChallengeLister + challengeLister cmacmelisters.ChallengeLister maxConcurrentChallenges int } // New will construct a new instance of a scheduler -func New(ctx context.Context, l cmlisters.ChallengeLister, maxConcurrentChallenges int) *Scheduler { +func New(ctx context.Context, l cmacmelisters.ChallengeLister, maxConcurrentChallenges int) *Scheduler { log := logs.FromContext(ctx, "challenge-scheduler") return &Scheduler{log: log, challengeLister: l, maxConcurrentChallenges: maxConcurrentChallenges} } @@ -48,7 +48,7 @@ func New(ctx context.Context, l cmlisters.ChallengeLister, maxConcurrentChalleng // scheduled for processing. // It may return an empty list if there are no challenges that can/should be // scheduled. -func (s *Scheduler) ScheduleN(n int) ([]*cmapi.Challenge, error) { +func (s *Scheduler) ScheduleN(n int) ([]*cmacme.Challenge, error) { // Get a list of all challenges from the cache allChallenges, err := s.challengeLister.List(labels.Everything()) if err != nil { @@ -58,7 +58,7 @@ func (s *Scheduler) ScheduleN(n int) ([]*cmapi.Challenge, error) { return s.scheduleN(n, allChallenges) } -func (s *Scheduler) scheduleN(n int, allChallenges []*cmapi.Challenge) ([]*cmapi.Challenge, error) { +func (s *Scheduler) scheduleN(n int, allChallenges []*cmacme.Challenge) ([]*cmacme.Challenge, error) { // Determine the list of challenges that could feasibly be scheduled on // this pass of the scheduler. // This function returns a list of candidates sorted by creation timestamp. @@ -84,7 +84,7 @@ func (s *Scheduler) scheduleN(n int, allChallenges []*cmapi.Challenge) ([]*cmapi // selectChallengesToSchedule will apply some sorting heuristic to the allowed // challenge candidates and return a maximum of N challenges that should be // scheduled for processing. -func (s *Scheduler) selectChallengesToSchedule(candidates []*cmapi.Challenge, n int) ([]*cmapi.Challenge, error) { +func (s *Scheduler) selectChallengesToSchedule(candidates []*cmacme.Challenge, n int) ([]*cmacme.Challenge, error) { // Trim the candidates returned to 'n' if len(candidates) > n { candidates = candidates[:n] @@ -97,7 +97,7 @@ func (s *Scheduler) selectChallengesToSchedule(candidates []*cmapi.Challenge, n // processing. // The returned challenges will be sorted in ascending order based on timestamp // (i.e. the oldest challenge will be element zero). -func (s *Scheduler) determineChallengeCandidates(allChallenges []*cmapi.Challenge) ([]*cmapi.Challenge, int, error) { +func (s *Scheduler) determineChallengeCandidates(allChallenges []*cmacme.Challenge) ([]*cmacme.Challenge, int, error) { // consider the entire set of challenges for 'in progress', in case a challenge // has processing=true whilst still being in a 'final' state inProgress := processingChallenges(allChallenges) @@ -108,7 +108,7 @@ func (s *Scheduler) determineChallengeCandidates(allChallenges []*cmapi.Challeng // hit the maximum number of challenges. if inProgressChallengeCount >= s.maxConcurrentChallenges { s.log.V(logs.DebugLevel).Info("hit maximum concurrent challenge limit. refusing to schedule more challenges.", "in_progress", len(inProgress), "max_concurrent", s.maxConcurrentChallenges) - return []*cmapi.Challenge{}, inProgressChallengeCount, nil + return []*cmacme.Challenge{}, inProgressChallengeCount, nil } // Calculate incomplete challenges @@ -123,7 +123,7 @@ func (s *Scheduler) determineChallengeCandidates(allChallenges []*cmapi.Challeng // If there are any already in-progress challenges for a domain and type, // filter them out. - candidates := filterChallenges(dedupedCandidates, func(ch *cmapi.Challenge) bool { + candidates := filterChallenges(dedupedCandidates, func(ch *cmacme.Challenge) bool { for _, inPCh := range inProgress { if compareChallenges(ch, inPCh) == 0 { s.log.V(logs.DebugLevel).Info("there is already a challenge processing with this domain", "domain", ch.Spec.DNSName, "type", ch.Spec.Type) @@ -139,7 +139,7 @@ func (s *Scheduler) determineChallengeCandidates(allChallenges []*cmapi.Challeng return candidates, inProgressChallengeCount, nil } -func sortChallengesByTimestamp(chs []*cmapi.Challenge) { +func sortChallengesByTimestamp(chs []*cmacme.Challenge) { sort.Slice(chs, func(i, j int) bool { return chs[i].CreationTimestamp.Before(&chs[j].CreationTimestamp) }) @@ -147,30 +147,30 @@ func sortChallengesByTimestamp(chs []*cmapi.Challenge) { // notProcessingChallenges will filter out challenges from the given slice // that have status.processing set to true. -func notProcessingChallenges(chs []*cmapi.Challenge) []*cmapi.Challenge { - return filterChallenges(chs, func(ch *cmapi.Challenge) bool { +func notProcessingChallenges(chs []*cmacme.Challenge) []*cmacme.Challenge { + return filterChallenges(chs, func(ch *cmacme.Challenge) bool { return !ch.Status.Processing }) } // processingChallenges will filter out challenges from the given slice // that have status.processing set to false. -func processingChallenges(chs []*cmapi.Challenge) []*cmapi.Challenge { - return filterChallenges(chs, func(ch *cmapi.Challenge) bool { +func processingChallenges(chs []*cmacme.Challenge) []*cmacme.Challenge { + return filterChallenges(chs, func(ch *cmacme.Challenge) bool { return ch.Status.Processing }) } // incompleteChallenges will filter out challenges from the given slice // that are in a 'final' state -func incompleteChallenges(chs []*cmapi.Challenge) []*cmapi.Challenge { - return filterChallenges(chs, func(ch *cmapi.Challenge) bool { +func incompleteChallenges(chs []*cmacme.Challenge) []*cmacme.Challenge { + return filterChallenges(chs, func(ch *cmacme.Challenge) bool { return !acme.IsFinalState(ch.Status.State) }) } -func filterChallenges(chs []*cmapi.Challenge, fn func(ch *cmapi.Challenge) bool) []*cmapi.Challenge { - ret := []*cmapi.Challenge{} +func filterChallenges(chs []*cmacme.Challenge, fn func(ch *cmacme.Challenge) bool) []*cmacme.Challenge { + ret := []*cmacme.Challenge{} for _, ch := range chs { if fn(ch) { ret = append(ret, ch) @@ -182,7 +182,7 @@ func filterChallenges(chs []*cmapi.Challenge, fn func(ch *cmapi.Challenge) bool) // compareChallenges is used to compare two challenge resources. // If two resources are 'equal', they will not be scheduled at the same time // as they could cause a conflict. -func compareChallenges(l, r *cmapi.Challenge) int { +func compareChallenges(l, r *cmacme.Challenge) int { if l.Spec.DNSName < r.Spec.DNSName { return -1 } @@ -209,7 +209,7 @@ func compareChallenges(l, r *cmapi.Challenge) int { // sortChallenges will sort the provided list of challenges according to the // schedulers sorting heuristics. // This is used to make deduplication of list items efficient (see dedupeChallenges) -func sortChallenges(chs []*cmapi.Challenge) { +func sortChallenges(chs []*cmacme.Challenge) { sort.Slice(chs, func(i, j int) bool { cmp := compareChallenges(chs[i], chs[j]) if cmp != 0 { @@ -230,7 +230,7 @@ func sortChallenges(chs []*cmapi.Challenge) { } // https://github.com/golang/go/wiki/SliceTricks#In-place-deduplicate-comparable -func dedupeChallenges(in []*cmapi.Challenge) []*cmapi.Challenge { +func dedupeChallenges(in []*cmacme.Challenge) []*cmacme.Challenge { sortChallenges(in) j := 0 for i := 1; i < len(in); i++ { diff --git a/pkg/controller/acmechallenges/scheduler/scheduler_test.go b/pkg/controller/acmechallenges/scheduler/scheduler_test.go index 4dc21cfa0f7..0624e84506f 100644 --- a/pkg/controller/acmechallenges/scheduler/scheduler_test.go +++ b/pkg/controller/acmechallenges/scheduler/scheduler_test.go @@ -26,7 +26,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/diff" - cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/client/clientset/versioned/fake" cminformers "github.com/jetstack/cert-manager/pkg/client/informers/externalversions" "github.com/jetstack/cert-manager/pkg/util" @@ -35,7 +35,7 @@ import ( const maxConcurrentChallenges = 60 -func randomChallenge(rand int) *cmapi.Challenge { +func randomChallenge(rand int) *cmacme.Challenge { if rand == 0 { rand = 10 } @@ -44,16 +44,16 @@ func randomChallenge(rand int) *cmapi.Challenge { gen.SetChallengeType("http-01")) } -func randomChallengeN(n int, rand int) []*cmapi.Challenge { - chs := make([]*cmapi.Challenge, n) +func randomChallengeN(n int, rand int) []*cmacme.Challenge { + chs := make([]*cmacme.Challenge, n) for i := range chs { chs[i] = randomChallenge(rand) } return chs } -func ascendingChallengeN(n int, mods ...gen.ChallengeModifier) []*cmapi.Challenge { - chs := make([]*cmapi.Challenge, n) +func ascendingChallengeN(n int, mods ...gen.ChallengeModifier) []*cmacme.Challenge { + chs := make([]*cmacme.Challenge, n) for i := range chs { name := fmt.Sprintf("test-%d", i) chs[i] = gen.Challenge(name, @@ -67,8 +67,8 @@ func ascendingChallengeN(n int, mods ...gen.ChallengeModifier) []*cmapi.Challeng return chs } -func withCreationTimestamp(i int64) func(*cmapi.Challenge) { - return func(ch *cmapi.Challenge) { +func withCreationTimestamp(i int64) func(*cmacme.Challenge) { + return func(ch *cmacme.Challenge) { ch.CreationTimestamp.Time = time.Unix(i, 0) } } @@ -119,8 +119,8 @@ func TestScheduleN(t *testing.T) { tests := []struct { name string n int - challenges []*cmapi.Challenge - expected []*cmapi.Challenge + challenges []*cmacme.Challenge + expected []*cmacme.Challenge err bool }{ { @@ -144,14 +144,14 @@ func TestScheduleN(t *testing.T) { { name: "schedule duplicate challenge if second challenge is in a final state", n: 5, - challenges: []*cmapi.Challenge{ + challenges: []*cmacme.Challenge{ gen.Challenge("test", gen.SetChallengeDNSName("example.com")), gen.Challenge("test2", gen.SetChallengeDNSName("example.com"), - gen.SetChallengeState(cmapi.Valid)), + gen.SetChallengeState(cmacme.Valid)), }, - expected: []*cmapi.Challenge{ + expected: []*cmacme.Challenge{ gen.Challenge("test", gen.SetChallengeDNSName("example.com")), }, @@ -159,7 +159,7 @@ func TestScheduleN(t *testing.T) { { name: "schedule a single duplicate in CreationTimestamp order", n: 5, - challenges: []*cmapi.Challenge{ + challenges: []*cmacme.Challenge{ gen.Challenge("test", gen.SetChallengeDNSName("example.com"), withCreationTimestamp(2)), @@ -167,7 +167,7 @@ func TestScheduleN(t *testing.T) { gen.SetChallengeDNSName("example.com"), withCreationTimestamp(1)), }, - expected: []*cmapi.Challenge{ + expected: []*cmacme.Challenge{ gen.Challenge("test2", gen.SetChallengeDNSName("example.com"), withCreationTimestamp(1)), @@ -176,7 +176,7 @@ func TestScheduleN(t *testing.T) { { name: "schedule duplicate in CreationTimestamp order (inverted input)", n: 5, - challenges: []*cmapi.Challenge{ + challenges: []*cmacme.Challenge{ gen.Challenge("test2", gen.SetChallengeDNSName("example.com"), withCreationTimestamp(1)), @@ -184,7 +184,7 @@ func TestScheduleN(t *testing.T) { gen.SetChallengeDNSName("example.com"), withCreationTimestamp(2)), }, - expected: []*cmapi.Challenge{ + expected: []*cmacme.Challenge{ gen.Challenge("test2", gen.SetChallengeDNSName("example.com"), withCreationTimestamp(1)), @@ -193,7 +193,7 @@ func TestScheduleN(t *testing.T) { { name: "schedule duplicate challenges for the same domain if they have a different type", n: 5, - challenges: []*cmapi.Challenge{ + challenges: []*cmacme.Challenge{ gen.Challenge("test1", gen.SetChallengeDNSName("example.com"), gen.SetChallengeType("dns01")), @@ -201,7 +201,7 @@ func TestScheduleN(t *testing.T) { gen.SetChallengeDNSName("example.com"), gen.SetChallengeType("http01")), }, - expected: []*cmapi.Challenge{ + expected: []*cmacme.Challenge{ gen.Challenge("test1", gen.SetChallengeDNSName("example.com"), gen.SetChallengeType("dns01")), @@ -213,7 +213,7 @@ func TestScheduleN(t *testing.T) { { name: "schedule duplicate challenges for the same domain if they have a different type (inverted input)", n: 5, - challenges: []*cmapi.Challenge{ + challenges: []*cmacme.Challenge{ gen.Challenge("test2", gen.SetChallengeDNSName("example.com"), gen.SetChallengeType("http01")), @@ -221,7 +221,7 @@ func TestScheduleN(t *testing.T) { gen.SetChallengeDNSName("example.com"), gen.SetChallengeType("dns01")), }, - expected: []*cmapi.Challenge{ + expected: []*cmacme.Challenge{ gen.Challenge("test1", gen.SetChallengeDNSName("example.com"), gen.SetChallengeType("dns01")), @@ -234,7 +234,7 @@ func TestScheduleN(t *testing.T) { { name: "schedule a challenge when other challenges are already in progress", n: 5, - challenges: []*cmapi.Challenge{ + challenges: []*cmacme.Challenge{ gen.Challenge("test1-0", gen.SetChallengeDNSName("rvrko.certmanager.kubernetes.network"), gen.SetChallengeType("dns-01"), @@ -250,7 +250,7 @@ func TestScheduleN(t *testing.T) { gen.SetChallengeType("dns-01"), gen.SetChallengeWildcard(true)), }, - expected: []*cmapi.Challenge{ + expected: []*cmacme.Challenge{ gen.Challenge("should-schedule", gen.SetChallengeDNSName("aodob.certmanager.kubernetes.network"), gen.SetChallengeType("dns-01"), @@ -268,7 +268,7 @@ func TestScheduleN(t *testing.T) { { name: "don't schedule challenge if another one with the same dnsName exists", n: 5, - challenges: []*cmapi.Challenge{ + challenges: []*cmacme.Challenge{ gen.Challenge("test", gen.SetChallengeDNSName("example.com")), gen.Challenge("test2", @@ -279,7 +279,7 @@ func TestScheduleN(t *testing.T) { { name: "don't schedule anything if all challenges are processing", n: 5, - challenges: []*cmapi.Challenge{ + challenges: []*cmacme.Challenge{ gen.Challenge("test", gen.SetChallengeDNSName("example.com"), gen.SetChallengeProcessing(true)), @@ -291,10 +291,10 @@ func TestScheduleN(t *testing.T) { { name: "don't schedule anything if all challenges are in a final state", n: 5, - challenges: []*cmapi.Challenge{ + challenges: []*cmacme.Challenge{ gen.Challenge("test2", gen.SetChallengeDNSName("example.com"), - gen.SetChallengeState(cmapi.Valid)), + gen.SetChallengeState(cmacme.Valid)), }, }, } @@ -303,7 +303,7 @@ func TestScheduleN(t *testing.T) { t.Run(test.name, func(t *testing.T) { cl := fake.NewSimpleClientset() factory := cminformers.NewSharedInformerFactory(cl, 0) - challengesInformer := factory.Certmanager().V1alpha2().Challenges() + challengesInformer := factory.Acme().V1alpha2().Challenges() for _, ch := range test.challenges { challengesInformer.Informer().GetIndexer().Add(ch) } @@ -311,7 +311,7 @@ func TestScheduleN(t *testing.T) { s := New(context.Background(), challengesInformer.Lister(), maxConcurrentChallenges) if test.expected == nil { - test.expected = []*cmapi.Challenge{} + test.expected = []*cmacme.Challenge{} } chs, err := s.ScheduleN(test.n) if err != nil && !test.err { diff --git a/pkg/controller/acmechallenges/sync.go b/pkg/controller/acmechallenges/sync.go index 842d9884060..f18d9e160a8 100644 --- a/pkg/controller/acmechallenges/sync.go +++ b/pkg/controller/acmechallenges/sync.go @@ -27,6 +27,7 @@ import ( "github.com/jetstack/cert-manager/pkg/acme" acmecl "github.com/jetstack/cert-manager/pkg/acme/client" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" controllerpkg "github.com/jetstack/cert-manager/pkg/controller" "github.com/jetstack/cert-manager/pkg/feature" @@ -45,18 +46,18 @@ const ( // appropriate way given the config in the Issuer and Certificate. type solver interface { // Present the challenge value with the given solver. - Present(ctx context.Context, issuer cmapi.GenericIssuer, ch *cmapi.Challenge) error + Present(ctx context.Context, issuer cmapi.GenericIssuer, ch *cmacme.Challenge) error // Check returns an Error if the propagation check didn't succeed. - Check(ctx context.Context, issuer cmapi.GenericIssuer, ch *cmapi.Challenge) error + Check(ctx context.Context, issuer cmapi.GenericIssuer, ch *cmacme.Challenge) error // CleanUp will remove challenge records for a given solver. // This may involve deleting resources in the Kubernetes API Server, or // communicating with other external components (e.g. DNS providers). - CleanUp(ctx context.Context, issuer cmapi.GenericIssuer, ch *cmapi.Challenge) error + CleanUp(ctx context.Context, issuer cmapi.GenericIssuer, ch *cmacme.Challenge) error } // Sync will process this ACME Challenge. // It is the core control function for ACME challenges. -func (c *controller) Sync(ctx context.Context, ch *cmapi.Challenge) (err error) { +func (c *controller) Sync(ctx context.Context, ch *cmacme.Challenge) (err error) { metrics.Default.IncrementSyncCallCount(ControllerName) log := logf.FromContext(ctx).WithValues("dnsName", ch.Spec.DNSName, "type", ch.Spec.Type) @@ -69,7 +70,7 @@ func (c *controller) Sync(ctx context.Context, ch *cmapi.Challenge) (err error) if reflect.DeepEqual(oldChal.Status, ch.Status) && len(oldChal.Finalizers) == len(ch.Finalizers) { return } - _, updateErr := c.cmClient.CertmanagerV1alpha2().Challenges(ch.Namespace).Update(ch) + _, updateErr := c.cmClient.AcmeV1alpha2().Challenges(ch.Namespace).Update(ch) if err != nil { err = utilerrors.NewAggregate([]error{err, updateErr}) } @@ -206,7 +207,7 @@ func (c *controller) Sync(ctx context.Context, ch *cmapi.Challenge) (err error) // handleError will handle ACME error types, updating the challenge resource // with any new information found whilst inspecting the error response. // This may include marking the challenge as expired. -func handleError(ch *cmapi.Challenge, err error) error { +func handleError(ch *cmacme.Challenge, err error) error { if err == nil { return nil } @@ -224,7 +225,7 @@ func handleError(ch *cmapi.Challenge, err error) error { // TODO: don't mark *all* malformed errors as expired, we may be able to be // more informative to the user by further inspecting the Error response. case "urn:ietf:params:acme:error:malformed": - ch.Status.State = cmapi.Expired + ch.Status.State = cmacme.Expired // absorb the error as updating the challenge's status will trigger a sync return nil } @@ -232,12 +233,12 @@ func handleError(ch *cmapi.Challenge, err error) error { return err } -func (c *controller) handleFinalizer(ctx context.Context, ch *cmapi.Challenge) error { +func (c *controller) handleFinalizer(ctx context.Context, ch *cmacme.Challenge) error { log := logf.FromContext(ctx, "finalizer") if len(ch.Finalizers) == 0 { return nil } - if ch.Finalizers[0] != cmapi.ACMEFinalizer { + if ch.Finalizers[0] != cmacme.ACMEFinalizer { log.V(logf.DebugLevel).Info("waiting to run challenge finalization...") return nil } @@ -272,7 +273,7 @@ func (c *controller) handleFinalizer(ctx context.Context, ch *cmapi.Challenge) e // syncChallengeStatus will communicate with the ACME server to retrieve the current // state of the Challenge. It will then update the Challenge's status block with the new // state of the Challenge. -func (c *controller) syncChallengeStatus(ctx context.Context, cl acmecl.Interface, ch *cmapi.Challenge) error { +func (c *controller) syncChallengeStatus(ctx context.Context, cl acmecl.Interface, ch *cmacme.Challenge) error { if ch.Spec.URL == "" { return fmt.Errorf("challenge URL is blank - challenge has not been created yet") } @@ -283,7 +284,7 @@ func (c *controller) syncChallengeStatus(ctx context.Context, cl acmecl.Interfac } // TODO: should we validate the State returned by the ACME server here? - cmState := cmapi.State(acmeChallenge.Status) + cmState := cmacme.State(acmeChallenge.Status) // be nice to our users and check if there is an error that we // can tell them about in the reason field // TODO(dmo): problems may be compound and they may be tagged with @@ -304,7 +305,7 @@ func (c *controller) syncChallengeStatus(ctx context.Context, cl acmecl.Interfac // It will update the challenge's status to reflect the final state of the // challenge if it failed, or the final state of the challenge's authorization // if accepting the challenge succeeds. -func (c *controller) acceptChallenge(ctx context.Context, cl acmecl.Interface, ch *cmapi.Challenge) error { +func (c *controller) acceptChallenge(ctx context.Context, cl acmecl.Interface, ch *cmacme.Challenge) error { log := logf.FromContext(ctx, "acceptChallenge") log.Info("accepting challenge with ACME server") @@ -316,7 +317,7 @@ func (c *controller) acceptChallenge(ctx context.Context, cl acmecl.Interface, c } acmeChal, err := cl.AcceptChallenge(ctx, acmeChal) if acmeChal != nil { - ch.Status.State = cmapi.State(acmeChal.Status) + ch.Status.State = cmacme.State(acmeChal.Status) } if err != nil { log.Error(err, "error accepting challenge") @@ -334,7 +335,7 @@ func (c *controller) acceptChallenge(ctx context.Context, cl acmecl.Interface, c return handleError(ch, err) } - ch.Status.State = cmapi.State(authErr.Authorization.Status) + ch.Status.State = cmacme.State(authErr.Authorization.Status) ch.Status.Reason = fmt.Sprintf("Error accepting authorization: %v", authErr) c.recorder.Eventf(ch, corev1.EventTypeWarning, "Failed", "Accepting challenge authorization failed: %v", authErr) @@ -344,14 +345,14 @@ func (c *controller) acceptChallenge(ctx context.Context, cl acmecl.Interface, c return nil } - ch.Status.State = cmapi.State(authorization.Status) + ch.Status.State = cmacme.State(authorization.Status) ch.Status.Reason = "Successfully authorized domain" c.recorder.Eventf(ch, corev1.EventTypeNormal, reasonDomainVerified, "Domain %q verified with %q validation", ch.Spec.DNSName, ch.Spec.Type) return nil } -func (c *controller) solverFor(challengeType cmapi.ACMEChallengeType) (solver, error) { +func (c *controller) solverFor(challengeType cmacme.ACMEChallengeType) (solver, error) { switch challengeType { case "http-01": return c.httpSolver, nil diff --git a/pkg/controller/acmechallenges/sync_test.go b/pkg/controller/acmechallenges/sync_test.go index f3894b7c78b..81dd0cf621e 100644 --- a/pkg/controller/acmechallenges/sync_test.go +++ b/pkg/controller/acmechallenges/sync_test.go @@ -26,6 +26,7 @@ import ( acmecl "github.com/jetstack/cert-manager/pkg/acme/client" acmefake "github.com/jetstack/cert-manager/pkg/acme/fake" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" testpkg "github.com/jetstack/cert-manager/pkg/controller/test" @@ -35,32 +36,32 @@ import ( ) // Present the challenge value with the given solver. -func (f *fakeSolver) Present(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *v1alpha2.Challenge) error { +func (f *fakeSolver) Present(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *cmacme.Challenge) error { return f.fakePresent(ctx, issuer, ch) } // Check should return Error only if propagation check cannot be performed. // It MUST return `false, nil` if can contact all relevant services and all is // doing is waiting for propagation -func (f *fakeSolver) Check(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *v1alpha2.Challenge) error { +func (f *fakeSolver) Check(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *cmacme.Challenge) error { return f.fakeCheck(ctx, issuer, ch) } // CleanUp will remove challenge records for a given solver. // This may involve deleting resources in the Kubernetes API Server, or // communicating with other external components (e.g. DNS providers). -func (f *fakeSolver) CleanUp(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *v1alpha2.Challenge) error { +func (f *fakeSolver) CleanUp(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *cmacme.Challenge) error { return f.fakeCleanUp(ctx, issuer, ch) } type fakeSolver struct { - fakePresent func(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *v1alpha2.Challenge) error - fakeCheck func(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *v1alpha2.Challenge) error - fakeCleanUp func(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *v1alpha2.Challenge) error + fakePresent func(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *cmacme.Challenge) error + fakeCheck func(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *cmacme.Challenge) error + fakeCleanUp func(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *cmacme.Challenge) error } type testT struct { - challenge *v1alpha2.Challenge + challenge *cmacme.Challenge builder *testpkg.Builder httpSolver *fakeSolver dnsSolver *fakeSolver @@ -69,11 +70,11 @@ type testT struct { } func TestSyncHappyPath(t *testing.T) { - testIssuerHTTP01Enabled := gen.Issuer("testissuer", gen.SetIssuerACME(v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + testIssuerHTTP01Enabled := gen.Issuer("testissuer", gen.SetIssuerACME(cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ { - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{}, + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{}, }, }, }, @@ -96,11 +97,11 @@ func TestSyncHappyPath(t *testing.T) { gen.SetChallengeURL("testurl"), ), testIssuerHTTP01Enabled}, ExpectedActions: []testpkg.Action{ - testpkg.NewAction(coretesting.NewUpdateAction(v1alpha2.SchemeGroupVersion.WithResource("challenges"), gen.DefaultTestNamespace, + testpkg.NewAction(coretesting.NewUpdateAction(cmacme.SchemeGroupVersion.WithResource("challenges"), gen.DefaultTestNamespace, gen.ChallengeFrom(baseChallenge, gen.SetChallengeProcessing(true), gen.SetChallengeURL("testurl"), - gen.SetChallengeState(v1alpha2.Pending), + gen.SetChallengeState(cmacme.Pending), ))), }, }, @@ -114,14 +115,14 @@ func TestSyncHappyPath(t *testing.T) { challenge: gen.ChallengeFrom(baseChallenge, gen.SetChallengeProcessing(true), gen.SetChallengeURL("testurl"), - gen.SetChallengeState(v1alpha2.Pending), + gen.SetChallengeState(cmacme.Pending), gen.SetChallengeType("http-01"), ), httpSolver: &fakeSolver{ - fakePresent: func(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *v1alpha2.Challenge) error { + fakePresent: func(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *cmacme.Challenge) error { return nil }, - fakeCheck: func(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *v1alpha2.Challenge) error { + fakeCheck: func(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *cmacme.Challenge) error { return fmt.Errorf("some error") }, }, @@ -129,15 +130,15 @@ func TestSyncHappyPath(t *testing.T) { CertManagerObjects: []runtime.Object{gen.ChallengeFrom(baseChallenge, gen.SetChallengeProcessing(true), gen.SetChallengeURL("testurl"), - gen.SetChallengeState(v1alpha2.Pending), + gen.SetChallengeState(cmacme.Pending), gen.SetChallengeType("http-01"), ), testIssuerHTTP01Enabled}, ExpectedActions: []testpkg.Action{ - testpkg.NewAction(coretesting.NewUpdateAction(v1alpha2.SchemeGroupVersion.WithResource("challenges"), gen.DefaultTestNamespace, + testpkg.NewAction(coretesting.NewUpdateAction(cmacme.SchemeGroupVersion.WithResource("challenges"), gen.DefaultTestNamespace, gen.ChallengeFrom(baseChallenge, gen.SetChallengeProcessing(true), gen.SetChallengeURL("testurl"), - gen.SetChallengeState(v1alpha2.Pending), + gen.SetChallengeState(cmacme.Pending), gen.SetChallengePresented(true), gen.SetChallengeType("http-01"), gen.SetChallengeReason("Waiting for http-01 challenge propagation: some error"), @@ -153,15 +154,15 @@ func TestSyncHappyPath(t *testing.T) { gen.SetChallengeProcessing(true), gen.SetChallengeURL("testurl"), gen.SetChallengeDNSName("test.com"), - gen.SetChallengeState(v1alpha2.Pending), + gen.SetChallengeState(cmacme.Pending), gen.SetChallengeType("http-01"), gen.SetChallengePresented(true), ), httpSolver: &fakeSolver{ - fakeCheck: func(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *v1alpha2.Challenge) error { + fakeCheck: func(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *cmacme.Challenge) error { return nil }, - fakeCleanUp: func(context.Context, v1alpha2.GenericIssuer, *v1alpha2.Challenge) error { + fakeCleanUp: func(context.Context, v1alpha2.GenericIssuer, *cmacme.Challenge) error { return nil }, }, @@ -170,17 +171,17 @@ func TestSyncHappyPath(t *testing.T) { gen.SetChallengeProcessing(true), gen.SetChallengeURL("testurl"), gen.SetChallengeDNSName("test.com"), - gen.SetChallengeState(v1alpha2.Pending), + gen.SetChallengeState(cmacme.Pending), gen.SetChallengeType("http-01"), gen.SetChallengePresented(true), ), testIssuerHTTP01Enabled}, ExpectedActions: []testpkg.Action{ - testpkg.NewAction(coretesting.NewUpdateAction(v1alpha2.SchemeGroupVersion.WithResource("challenges"), gen.DefaultTestNamespace, + testpkg.NewAction(coretesting.NewUpdateAction(cmacme.SchemeGroupVersion.WithResource("challenges"), gen.DefaultTestNamespace, gen.ChallengeFrom(baseChallenge, gen.SetChallengeProcessing(true), gen.SetChallengeURL("testurl"), gen.SetChallengeDNSName("test.com"), - gen.SetChallengeState(v1alpha2.Valid), + gen.SetChallengeState(cmacme.Valid), gen.SetChallengeType("http-01"), gen.SetChallengePresented(true), gen.SetChallengeReason("Successfully authorized domain"), @@ -206,15 +207,15 @@ func TestSyncHappyPath(t *testing.T) { challenge: gen.ChallengeFrom(baseChallenge, gen.SetChallengeProcessing(true), gen.SetChallengeURL("testurl"), - gen.SetChallengeState(v1alpha2.Pending), + gen.SetChallengeState(cmacme.Pending), gen.SetChallengeType("http-01"), gen.SetChallengePresented(true), ), httpSolver: &fakeSolver{ - fakeCheck: func(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *v1alpha2.Challenge) error { + fakeCheck: func(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *cmacme.Challenge) error { return nil }, - fakeCleanUp: func(context.Context, v1alpha2.GenericIssuer, *v1alpha2.Challenge) error { + fakeCleanUp: func(context.Context, v1alpha2.GenericIssuer, *cmacme.Challenge) error { return nil }, }, @@ -222,16 +223,16 @@ func TestSyncHappyPath(t *testing.T) { CertManagerObjects: []runtime.Object{gen.ChallengeFrom(baseChallenge, gen.SetChallengeProcessing(true), gen.SetChallengeURL("testurl"), - gen.SetChallengeState(v1alpha2.Pending), + gen.SetChallengeState(cmacme.Pending), gen.SetChallengeType("http-01"), gen.SetChallengePresented(true), ), testIssuerHTTP01Enabled}, ExpectedActions: []testpkg.Action{ - testpkg.NewAction(coretesting.NewUpdateAction(v1alpha2.SchemeGroupVersion.WithResource("challenges"), gen.DefaultTestNamespace, + testpkg.NewAction(coretesting.NewUpdateAction(cmacme.SchemeGroupVersion.WithResource("challenges"), gen.DefaultTestNamespace, gen.ChallengeFrom(baseChallenge, gen.SetChallengeProcessing(true), gen.SetChallengeURL("testurl"), - gen.SetChallengeState(v1alpha2.Invalid), + gen.SetChallengeState(cmacme.Invalid), gen.SetChallengeType("http-01"), gen.SetChallengePresented(true), gen.SetChallengeReason("Error accepting authorization: acme: authorization for identifier example.com is invalid"), @@ -264,12 +265,12 @@ func TestSyncHappyPath(t *testing.T) { challenge: gen.ChallengeFrom(baseChallenge, gen.SetChallengeProcessing(true), gen.SetChallengeURL("testurl"), - gen.SetChallengeState(v1alpha2.Valid), + gen.SetChallengeState(cmacme.Valid), gen.SetChallengeType("http-01"), gen.SetChallengePresented(true), ), httpSolver: &fakeSolver{ - fakeCleanUp: func(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *v1alpha2.Challenge) error { + fakeCleanUp: func(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *cmacme.Challenge) error { return nil }, }, @@ -277,16 +278,16 @@ func TestSyncHappyPath(t *testing.T) { CertManagerObjects: []runtime.Object{gen.ChallengeFrom(baseChallenge, gen.SetChallengeProcessing(true), gen.SetChallengeURL("testurl"), - gen.SetChallengeState(v1alpha2.Valid), + gen.SetChallengeState(cmacme.Valid), gen.SetChallengeType("http-01"), gen.SetChallengePresented(true), ), testIssuerHTTP01Enabled}, ExpectedActions: []testpkg.Action{ - testpkg.NewAction(coretesting.NewUpdateAction(v1alpha2.SchemeGroupVersion.WithResource("challenges"), gen.DefaultTestNamespace, + testpkg.NewAction(coretesting.NewUpdateAction(cmacme.SchemeGroupVersion.WithResource("challenges"), gen.DefaultTestNamespace, gen.ChallengeFrom(baseChallenge, gen.SetChallengeProcessing(false), gen.SetChallengeURL("testurl"), - gen.SetChallengeState(v1alpha2.Valid), + gen.SetChallengeState(cmacme.Valid), gen.SetChallengeType("http-01"), gen.SetChallengePresented(false), ))), @@ -297,12 +298,12 @@ func TestSyncHappyPath(t *testing.T) { challenge: gen.ChallengeFrom(baseChallenge, gen.SetChallengeProcessing(true), gen.SetChallengeURL("testurl"), - gen.SetChallengeState(v1alpha2.Invalid), + gen.SetChallengeState(cmacme.Invalid), gen.SetChallengeType("http-01"), gen.SetChallengePresented(true), ), httpSolver: &fakeSolver{ - fakeCleanUp: func(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *v1alpha2.Challenge) error { + fakeCleanUp: func(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *cmacme.Challenge) error { return nil }, }, @@ -310,16 +311,16 @@ func TestSyncHappyPath(t *testing.T) { CertManagerObjects: []runtime.Object{gen.ChallengeFrom(baseChallenge, gen.SetChallengeProcessing(true), gen.SetChallengeURL("testurl"), - gen.SetChallengeState(v1alpha2.Invalid), + gen.SetChallengeState(cmacme.Invalid), gen.SetChallengeType("http-01"), gen.SetChallengePresented(true), ), testIssuerHTTP01Enabled}, ExpectedActions: []testpkg.Action{ - testpkg.NewAction(coretesting.NewUpdateAction(v1alpha2.SchemeGroupVersion.WithResource("challenges"), gen.DefaultTestNamespace, + testpkg.NewAction(coretesting.NewUpdateAction(cmacme.SchemeGroupVersion.WithResource("challenges"), gen.DefaultTestNamespace, gen.ChallengeFrom(baseChallenge, gen.SetChallengeProcessing(false), gen.SetChallengeURL("testurl"), - gen.SetChallengeState(v1alpha2.Invalid), + gen.SetChallengeState(cmacme.Invalid), gen.SetChallengeType("http-01"), gen.SetChallengePresented(false), ))), diff --git a/pkg/controller/acmeorders/BUILD.bazel b/pkg/controller/acmeorders/BUILD.bazel index 54566c5d825..a6c33ed69f9 100644 --- a/pkg/controller/acmeorders/BUILD.bazel +++ b/pkg/controller/acmeorders/BUILD.bazel @@ -13,8 +13,10 @@ go_library( deps = [ "//pkg/acme:go_default_library", "//pkg/acme/client:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/client/clientset/versioned:go_default_library", + "//pkg/client/listers/acme/v1alpha2:go_default_library", "//pkg/client/listers/certmanager/v1alpha2:go_default_library", "//pkg/controller:go_default_library", "//pkg/controller/acmeorders/selectors:go_default_library", @@ -65,6 +67,7 @@ go_test( deps = [ "//pkg/acme/client:go_default_library", "//pkg/acme/fake:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", "//pkg/controller/test:go_default_library", diff --git a/pkg/controller/acmeorders/checks.go b/pkg/controller/acmeorders/checks.go index 6dc87a8bf9e..d4872e36375 100644 --- a/pkg/controller/acmeorders/checks.go +++ b/pkg/controller/acmeorders/checks.go @@ -19,6 +19,7 @@ package acmeorders import ( "fmt" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/runtime" @@ -46,7 +47,7 @@ func (c *controller) handleGenericIssuer(obj interface{}) { } } -func (c *controller) ordersForGenericIssuer(iss cmapi.GenericIssuer) ([]*cmapi.Order, error) { +func (c *controller) ordersForGenericIssuer(iss cmapi.GenericIssuer) ([]*cmacme.Order, error) { orders, err := c.orderLister.List(labels.NewSelector()) if err != nil { @@ -55,7 +56,7 @@ func (c *controller) ordersForGenericIssuer(iss cmapi.GenericIssuer) ([]*cmapi.O _, isClusterIssuer := iss.(*cmapi.ClusterIssuer) - var affected []*cmapi.Order + var affected []*cmacme.Order for _, o := range orders { if isClusterIssuer && o.Spec.IssuerRef.Kind != cmapi.ClusterIssuerKind { continue diff --git a/pkg/controller/acmeorders/controller.go b/pkg/controller/acmeorders/controller.go index 5efcc9390a8..291b299599a 100644 --- a/pkg/controller/acmeorders/controller.go +++ b/pkg/controller/acmeorders/controller.go @@ -30,6 +30,7 @@ import ( "github.com/jetstack/cert-manager/pkg/acme" cmclient "github.com/jetstack/cert-manager/pkg/client/clientset/versioned" + cmacmelisters "github.com/jetstack/cert-manager/pkg/client/listers/acme/v1alpha2" cmlisters "github.com/jetstack/cert-manager/pkg/client/listers/certmanager/v1alpha2" controllerpkg "github.com/jetstack/cert-manager/pkg/controller" "github.com/jetstack/cert-manager/pkg/issuer" @@ -43,8 +44,8 @@ type controller struct { acmeHelper acme.Helper // all the listers used by this controller - orderLister cmlisters.OrderLister - challengeLister cmlisters.ChallengeLister + orderLister cmacmelisters.OrderLister + challengeLister cmacmelisters.ChallengeLister issuerLister cmlisters.IssuerLister clusterIssuerLister cmlisters.ClusterIssuerLister secretLister corelisters.SecretLister @@ -75,9 +76,9 @@ func (c *controller) Register(ctx *controllerpkg.Context) (workqueue.RateLimitin c.queue = workqueue.NewNamedRateLimitingQueue(workqueue.NewItemExponentialFailureRateLimiter(time.Second*5, time.Minute*30), ControllerName) // obtain references to all the informers used by this controller - orderInformer := ctx.SharedInformerFactory.Certmanager().V1alpha2().Orders() + orderInformer := ctx.SharedInformerFactory.Acme().V1alpha2().Orders() issuerInformer := ctx.SharedInformerFactory.Certmanager().V1alpha2().Issuers() - challengeInformer := ctx.SharedInformerFactory.Certmanager().V1alpha2().Challenges() + challengeInformer := ctx.SharedInformerFactory.Acme().V1alpha2().Challenges() secretInformer := ctx.KubeSharedInformerFactory.Core().V1().Secrets() // build a list of InformerSynced functions that will be returned by the Register method. // the controller will only begin processing items once all of these informers have synced. diff --git a/pkg/controller/acmeorders/selectors/BUILD.bazel b/pkg/controller/acmeorders/selectors/BUILD.bazel index 1890a2e22d3..1d08c1a6356 100644 --- a/pkg/controller/acmeorders/selectors/BUILD.bazel +++ b/pkg/controller/acmeorders/selectors/BUILD.bazel @@ -11,7 +11,7 @@ go_library( importpath = "github.com/jetstack/cert-manager/pkg/controller/acmeorders/selectors", visibility = ["//visibility:public"], deps = [ - "//pkg/apis/certmanager/v1alpha2:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", "//vendor/github.com/miekg/dns:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", ], @@ -36,7 +36,7 @@ go_test( srcs = ["dns_zones_test.go"], embed = [":go_default_library"], deps = [ - "//pkg/apis/certmanager/v1alpha2:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", ], ) diff --git a/pkg/controller/acmeorders/selectors/dns_names.go b/pkg/controller/acmeorders/selectors/dns_names.go index e08417d6788..777a8ac7757 100644 --- a/pkg/controller/acmeorders/selectors/dns_names.go +++ b/pkg/controller/acmeorders/selectors/dns_names.go @@ -19,10 +19,10 @@ package selectors import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" ) -func DNSNames(sel cmapi.CertificateDNSNameSelector) Selector { +func DNSNames(sel cmacme.CertificateDNSNameSelector) Selector { return &dnsNamesSelector{ allowedDNSNames: sel.DNSNames, } diff --git a/pkg/controller/acmeorders/selectors/dns_zones.go b/pkg/controller/acmeorders/selectors/dns_zones.go index d65b060a85d..16438a1ce0e 100644 --- a/pkg/controller/acmeorders/selectors/dns_zones.go +++ b/pkg/controller/acmeorders/selectors/dns_zones.go @@ -20,10 +20,10 @@ import ( "github.com/miekg/dns" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" ) -func DNSZones(sel cmapi.CertificateDNSNameSelector) Selector { +func DNSZones(sel cmacme.CertificateDNSNameSelector) Selector { return &dnsZonesSelector{ allowedDNSZones: sel.DNSZones, } diff --git a/pkg/controller/acmeorders/selectors/dns_zones_test.go b/pkg/controller/acmeorders/selectors/dns_zones_test.go index 8968ac4902e..8f1953df26a 100644 --- a/pkg/controller/acmeorders/selectors/dns_zones_test.go +++ b/pkg/controller/acmeorders/selectors/dns_zones_test.go @@ -21,13 +21,13 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" ) func TestDNSZones(t *testing.T) { tests := []struct { name string - selector cmapi.CertificateDNSNameSelector + selector cmacme.CertificateDNSNameSelector meta metav1.ObjectMeta dnsName string matches bool @@ -35,14 +35,14 @@ func TestDNSZones(t *testing.T) { }{ { name: "matching a domain with an empty selector", - selector: cmapi.CertificateDNSNameSelector{}, + selector: cmacme.CertificateDNSNameSelector{}, dnsName: "www.example.com", matches: true, score: 0, }, { name: "matching a domain in a zone", - selector: cmapi.CertificateDNSNameSelector{ + selector: cmacme.CertificateDNSNameSelector{ DNSZones: []string{"example.com"}, }, dnsName: "www.example.com", @@ -51,7 +51,7 @@ func TestDNSZones(t *testing.T) { }, { name: "matching a wildcard domain in a zone", - selector: cmapi.CertificateDNSNameSelector{ + selector: cmacme.CertificateDNSNameSelector{ DNSZones: []string{"example.com"}, }, dnsName: "*.example.com", diff --git a/pkg/controller/acmeorders/selectors/labels.go b/pkg/controller/acmeorders/selectors/labels.go index dc75ca2e9f6..2ddc193d84b 100644 --- a/pkg/controller/acmeorders/selectors/labels.go +++ b/pkg/controller/acmeorders/selectors/labels.go @@ -19,10 +19,10 @@ package selectors import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" ) -func Labels(sel cmapi.CertificateDNSNameSelector) Selector { +func Labels(sel cmacme.CertificateDNSNameSelector) Selector { return &labelSelector{ requiredLabels: sel.MatchLabels, } diff --git a/pkg/controller/acmeorders/sync.go b/pkg/controller/acmeorders/sync.go index c8ca4730dac..8cd68c82e5c 100644 --- a/pkg/controller/acmeorders/sync.go +++ b/pkg/controller/acmeorders/sync.go @@ -32,13 +32,13 @@ import ( "github.com/jetstack/cert-manager/pkg/acme" acmecl "github.com/jetstack/cert-manager/pkg/acme/client" - cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" logf "github.com/jetstack/cert-manager/pkg/logs" "github.com/jetstack/cert-manager/pkg/metrics" acmeapi "github.com/jetstack/cert-manager/third_party/crypto/acme" ) -func (c *controller) Sync(ctx context.Context, o *cmapi.Order) (err error) { +func (c *controller) Sync(ctx context.Context, o *cmacme.Order) (err error) { log := logf.FromContext(ctx) dbg := log.V(logf.DebugLevel) @@ -54,7 +54,7 @@ func (c *controller) Sync(ctx context.Context, o *cmapi.Order) (err error) { return } log.Info("updating Order resource status") - _, updateErr := c.cmClient.CertmanagerV1alpha2().Orders(o.Namespace).Update(o) + _, updateErr := c.cmClient.AcmeV1alpha2().Orders(o.Namespace).Update(o) if err != nil { log.Error(err, "failed to update status") err = utilerrors.NewAggregate([]error{err, updateErr}) @@ -87,10 +87,10 @@ func (c *controller) Sync(ctx context.Context, o *cmapi.Order) (err error) { log.Info("Doing nothing as Order is in a failed state") // if the Order is failed there's nothing left for us to do, return nil return nil - case o.Status.State == cmapi.Valid && o.Status.Certificate == nil: + case o.Status.State == cmacme.Valid && o.Status.Certificate == nil: log.Info("Order is in a Valid state but the Certificate data is empty, fetching existing Certificate") return c.fetchCertificateData(ctx, cl, o) - case o.Status.State == cmapi.Valid && len(o.Status.Certificate) > 0: + case o.Status.State == cmacme.Valid && len(o.Status.Certificate) > 0: log.Info("Order has already been completed, cleaning up any owned Challenge resources") // if the Order is valid and the certificate data has been set, clean // up any owned Challenge resources and do nothing @@ -134,7 +134,7 @@ func (c *controller) Sync(ctx context.Context, o *cmapi.Order) (err error) { } switch { - case o.Status.State == cmapi.Ready: + case o.Status.State == cmacme.Ready: log.Info("Finalizing Order as order state is 'Ready'") return c.finalizeOrder(ctx, cl, o) case anyChallengesFailed(challenges): @@ -157,7 +157,7 @@ func (c *controller) Sync(ctx context.Context, o *cmapi.Order) (err error) { return nil } -func (c *controller) createOrder(ctx context.Context, cl acmecl.Interface, o *cmapi.Order) error { +func (c *controller) createOrder(ctx context.Context, cl acmecl.Interface, o *cmacme.Order) error { log := logf.FromContext(ctx) dbg := log.V(logf.DebugLevel) @@ -190,7 +190,7 @@ func (c *controller) createOrder(ctx context.Context, cl acmecl.Interface, o *cm return nil } -func (c *controller) updateOrderStatus(ctx context.Context, cl acmecl.Interface, o *cmapi.Order) (*acmeapi.Order, error) { +func (c *controller) updateOrderStatus(ctx context.Context, cl acmecl.Interface, o *cmacme.Order) (*acmeapi.Order, error) { log := logf.FromContext(ctx) if o.Status.URL == "" { return nil, fmt.Errorf("internal error: order URL not set") @@ -201,7 +201,7 @@ func (c *controller) updateOrderStatus(ctx context.Context, cl acmecl.Interface, if acmeErr, ok := err.(*acmeapi.Error); ok { if acmeErr.StatusCode >= 400 && acmeErr.StatusCode < 500 { log.Error(err, "failed to update Order status due to a 4xx error, marking Order as failed") - c.setOrderState(&o.Status, string(cmapi.Errored)) + c.setOrderState(&o.Status, string(cmacme.Errored)) o.Status.Reason = fmt.Sprintf("Failed to retrieve Order resource: %v", err) return nil, nil } @@ -227,8 +227,8 @@ func (c *controller) updateOrderStatus(ctx context.Context, cl acmecl.Interface, // setOrderState will set the 'State' field of the given Order to 's'. // It will set the Orders failureTime field if the state provided is classed as // a failure state. -func (c *controller) setOrderState(o *cmapi.OrderStatus, s string) { - o.State = cmapi.State(s) +func (c *controller) setOrderState(o *cmacme.OrderStatus, s string) { + o.State = cmacme.State(s) // if the order is in a failure state, we should set the `failureTime` field if acme.IsFailureState(o.State) { t := metav1.NewTime(c.clock.Now()) @@ -241,15 +241,15 @@ func (c *controller) setOrderState(o *cmapi.OrderStatus, s string) { // It does *not* perform a query against the ACME server for each authorization // named on the Order to fetch additional metadata, instead, use // populateAuthorization on each authorization in turn. -func constructAuthorizations(o *acmeapi.Order) []cmapi.ACMEAuthorization { - authzs := make([]cmapi.ACMEAuthorization, len(o.Authorizations)) +func constructAuthorizations(o *acmeapi.Order) []cmacme.ACMEAuthorization { + authzs := make([]cmacme.ACMEAuthorization, len(o.Authorizations)) for i, url := range o.Authorizations { authzs[i].URL = url } return authzs } -func anyAuthorizationsMissingMetadata(o *cmapi.Order) bool { +func anyAuthorizationsMissingMetadata(o *cmacme.Order) bool { for _, a := range o.Status.Authorizations { if a.Identifier == "" { return true @@ -258,7 +258,7 @@ func anyAuthorizationsMissingMetadata(o *cmapi.Order) bool { return false } -func (c *controller) fetchMetadataForAuthorizations(ctx context.Context, o *cmapi.Order, cl acmecl.Interface) error { +func (c *controller) fetchMetadataForAuthorizations(ctx context.Context, o *cmacme.Order, cl acmecl.Interface) error { log := logf.FromContext(ctx) for i, authz := range o.Status.Authorizations { // only fetch metadata for each authorization once @@ -270,7 +270,7 @@ func (c *controller) fetchMetadataForAuthorizations(ctx context.Context, o *cmap if acmeErr, ok := err.(*acmeapi.Error); ok { if acmeErr.StatusCode >= 400 && acmeErr.StatusCode < 500 { log.Error(err, "failed to fetch authorization metadata from acme server") - c.setOrderState(&o.Status, string(cmapi.Errored)) + c.setOrderState(&o.Status, string(cmacme.Errored)) o.Status.Reason = fmt.Sprintf("Failed to fetch authorization: %v", err) return nil } @@ -281,18 +281,18 @@ func (c *controller) fetchMetadataForAuthorizations(ctx context.Context, o *cmap authz.Identifier = acmeAuthz.Identifier.Value authz.Wildcard = acmeAuthz.Wildcard - authz.Challenges = make([]cmapi.ACMEChallenge, len(acmeAuthz.Challenges)) + authz.Challenges = make([]cmacme.ACMEChallenge, len(acmeAuthz.Challenges)) for i, acmech := range acmeAuthz.Challenges { authz.Challenges[i].URL = acmech.URL authz.Challenges[i].Token = acmech.Token - authz.Challenges[i].Type = cmapi.ACMEChallengeType(acmech.Type) + authz.Challenges[i].Type = cmacme.ACMEChallengeType(acmech.Type) } o.Status.Authorizations[i] = authz } return nil } -func (c *controller) anyRequiredChallengesDoNotExist(requiredChallenges []cmapi.Challenge) (bool, error) { +func (c *controller) anyRequiredChallengesDoNotExist(requiredChallenges []cmacme.Challenge) (bool, error) { for _, ch := range requiredChallenges { _, err := c.challengeLister.Challenges(ch.Namespace).Get(ch.Name) if apierrors.IsNotFound(err) { @@ -305,9 +305,9 @@ func (c *controller) anyRequiredChallengesDoNotExist(requiredChallenges []cmapi. return false, nil } -func (c *controller) createRequiredChallenges(o *cmapi.Order, requiredChallenges []cmapi.Challenge) error { +func (c *controller) createRequiredChallenges(o *cmacme.Order, requiredChallenges []cmacme.Challenge) error { for _, ch := range requiredChallenges { - _, err := c.cmClient.CertmanagerV1alpha2().Challenges(ch.Namespace).Create(&ch) + _, err := c.cmClient.AcmeV1alpha2().Challenges(ch.Namespace).Create(&ch) if apierrors.IsAlreadyExists(err) { continue } @@ -319,7 +319,7 @@ func (c *controller) createRequiredChallenges(o *cmapi.Order, requiredChallenges return nil } -func (c *controller) anyLeftoverChallengesExist(o *cmapi.Order, requiredChallenges []cmapi.Challenge) (bool, error) { +func (c *controller) anyLeftoverChallengesExist(o *cmacme.Order, requiredChallenges []cmacme.Challenge) (bool, error) { leftoverChallenges, err := c.determineLeftoverChallenges(o, requiredChallenges) if err != nil { return false, err @@ -328,14 +328,14 @@ func (c *controller) anyLeftoverChallengesExist(o *cmapi.Order, requiredChalleng return len(leftoverChallenges) > 0, nil } -func (c *controller) deleteLeftoverChallenges(o *cmapi.Order, requiredChallenges []cmapi.Challenge) error { +func (c *controller) deleteLeftoverChallenges(o *cmacme.Order, requiredChallenges []cmacme.Challenge) error { leftover, err := c.determineLeftoverChallenges(o, requiredChallenges) if err != nil { return err } for _, ch := range leftover { - if err := c.cmClient.CertmanagerV1alpha2().Challenges(ch.Namespace).Delete(ch.Name, nil); err != nil { + if err := c.cmClient.AcmeV1alpha2().Challenges(ch.Namespace).Delete(ch.Name, nil); err != nil { return err } } @@ -343,14 +343,14 @@ func (c *controller) deleteLeftoverChallenges(o *cmapi.Order, requiredChallenges return nil } -func (c *controller) deleteAllChallenges(o *cmapi.Order) error { +func (c *controller) deleteAllChallenges(o *cmacme.Order) error { challenges, err := c.listOwnedChallenges(o) if err != nil { return err } for _, ch := range challenges { - if err := c.cmClient.CertmanagerV1alpha2().Challenges(ch.Namespace).Delete(ch.Name, nil); err != nil { + if err := c.cmClient.AcmeV1alpha2().Challenges(ch.Namespace).Delete(ch.Name, nil); err != nil { return err } } @@ -358,7 +358,7 @@ func (c *controller) deleteAllChallenges(o *cmapi.Order) error { return nil } -func (c *controller) determineLeftoverChallenges(o *cmapi.Order, requiredChallenges []cmapi.Challenge) ([]*cmapi.Challenge, error) { +func (c *controller) determineLeftoverChallenges(o *cmacme.Order, requiredChallenges []cmacme.Challenge) ([]*cmacme.Challenge, error) { requiredNames := map[string]struct{}{} for _, ch := range requiredChallenges { requiredNames[ch.Name] = struct{}{} @@ -369,7 +369,7 @@ func (c *controller) determineLeftoverChallenges(o *cmapi.Order, requiredChallen return nil, err } - var leftover []*cmapi.Challenge + var leftover []*cmacme.Challenge for _, ch := range ownedChallenges { if _, ok := requiredNames[ch.Name]; ok { continue @@ -380,13 +380,13 @@ func (c *controller) determineLeftoverChallenges(o *cmapi.Order, requiredChallen return leftover, nil } -func (c *controller) listOwnedChallenges(o *cmapi.Order) ([]*cmapi.Challenge, error) { +func (c *controller) listOwnedChallenges(o *cmacme.Order) ([]*cmacme.Challenge, error) { chs, err := c.challengeLister.Challenges(o.Namespace).List(labels.Everything()) if err != nil { return nil, err } - var ownedChs []*cmapi.Challenge + var ownedChs []*cmacme.Challenge for _, ch := range chs { if !metav1.IsControlledBy(ch, o) { continue @@ -397,7 +397,7 @@ func (c *controller) listOwnedChallenges(o *cmapi.Order) ([]*cmapi.Challenge, er return ownedChs, nil } -func (c *controller) finalizeOrder(ctx context.Context, cl acmecl.Interface, o *cmapi.Order) error { +func (c *controller) finalizeOrder(ctx context.Context, cl acmecl.Interface, o *cmacme.Order) error { log := logf.FromContext(ctx) // Due to a bug in the initial release of this controller, we previously @@ -435,7 +435,7 @@ func (c *controller) finalizeOrder(ctx context.Context, cl acmecl.Interface, o * return c.storeCertificateOnStatus(ctx, o, certSlice) } -func (c *controller) storeCertificateOnStatus(ctx context.Context, o *cmapi.Order, certs [][]byte) error { +func (c *controller) storeCertificateOnStatus(ctx context.Context, o *cmacme.Order, certs [][]byte) error { log := logf.FromContext(ctx) // encode the retrieved certificates (including the chain) certBuffer := bytes.NewBuffer([]byte{}) @@ -443,7 +443,7 @@ func (c *controller) storeCertificateOnStatus(ctx context.Context, o *cmapi.Orde err := pem.Encode(certBuffer, &pem.Block{Type: "CERTIFICATE", Bytes: cert}) if err != nil { log.Error(err, "invalid certificate data returned by ACME server") - c.setOrderState(&o.Status, string(cmapi.Errored)) + c.setOrderState(&o.Status, string(cmacme.Errored)) o.Status.Reason = fmt.Sprintf("Invalid certificate retrieved from ACME server: %v", err) return nil } @@ -455,7 +455,7 @@ func (c *controller) storeCertificateOnStatus(ctx context.Context, o *cmapi.Orde return nil } -func (c *controller) fetchCertificateData(ctx context.Context, cl acmecl.Interface, o *cmapi.Order) error { +func (c *controller) fetchCertificateData(ctx context.Context, cl acmecl.Interface, o *cmacme.Order) error { log := logf.FromContext(ctx) acmeOrder, err := c.updateOrderStatus(ctx, cl, o) if err != nil { @@ -477,7 +477,7 @@ func (c *controller) fetchCertificateData(ctx context.Context, cl acmecl.Interfa if acmeErr, ok := err.(*acmeapi.Error); ok { if acmeErr.StatusCode >= 400 && acmeErr.StatusCode < 500 { log.Error(err, "failed to retrieve issued certificate from ACME server") - c.setOrderState(&o.Status, string(cmapi.Errored)) + c.setOrderState(&o.Status, string(cmacme.Errored)) o.Status.Reason = fmt.Sprintf("Failed to retrieve signed certificate: %v", err) return nil } diff --git a/pkg/controller/acmeorders/sync_test.go b/pkg/controller/acmeorders/sync_test.go index 5dbe7f78f76..fa592e3412e 100644 --- a/pkg/controller/acmeorders/sync_test.go +++ b/pkg/controller/acmeorders/sync_test.go @@ -28,6 +28,7 @@ import ( acmecl "github.com/jetstack/cert-manager/pkg/acme/client" acmefake "github.com/jetstack/cert-manager/pkg/acme/fake" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" testpkg "github.com/jetstack/cert-manager/pkg/controller/test" @@ -40,14 +41,14 @@ func TestSyncHappyPath(t *testing.T) { nowMetaTime := metav1.NewTime(nowTime) fixedClock := fakeclock.NewFakeClock(nowTime) - testIssuerHTTP01TestCom := gen.Issuer("testissuer", gen.SetIssuerACME(v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + testIssuerHTTP01TestCom := gen.Issuer("testissuer", gen.SetIssuerACME(cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ DNSNames: []string{"test.com"}, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{}, + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{}, }, }, }, @@ -59,19 +60,19 @@ func TestSyncHappyPath(t *testing.T) { }), ) - pendingStatus := v1alpha2.OrderStatus{ - State: v1alpha2.Pending, + pendingStatus := cmacme.OrderStatus{ + State: cmacme.Pending, URL: "http://testurl.com/abcde", FinalizeURL: "http://testurl.com/abcde/finalize", - Authorizations: []v1alpha2.ACMEAuthorization{ + Authorizations: []cmacme.ACMEAuthorization{ { URL: "http://authzurl", Identifier: "test.com", - Challenges: []v1alpha2.ACMEChallenge{ + Challenges: []cmacme.ACMEChallenge{ { URL: "http://chalurl", Token: "token", - Type: v1alpha2.ACMEChallengeTypeHTTP01, + Type: cmacme.ACMEChallengeTypeHTTP01, }, }, }, @@ -80,17 +81,17 @@ func TestSyncHappyPath(t *testing.T) { testOrderPending := gen.OrderFrom(testOrder, gen.SetOrderStatus(pendingStatus)) testOrderInvalid := testOrderPending.DeepCopy() - testOrderInvalid.Status.State = v1alpha2.Invalid + testOrderInvalid.Status.State = cmacme.Invalid testOrderInvalid.Status.FailureTime = &nowMetaTime testOrderValid := testOrderPending.DeepCopy() - testOrderValid.Status.State = v1alpha2.Valid + testOrderValid.Status.State = cmacme.Valid // pem encoded word 'test' testOrderValid.Status.Certificate = []byte(`-----BEGIN CERTIFICATE----- dGVzdA== -----END CERTIFICATE----- `) testOrderReady := testOrderPending.DeepCopy() - testOrderReady.Status.State = v1alpha2.Ready + testOrderReady.Status.State = cmacme.Ready fakeHTTP01ACMECl := &acmecl.FakeACME{ FakeHTTP01ChallengeResponse: func(s string) (string, error) { @@ -103,9 +104,9 @@ dGVzdA== t.Fatalf("error building Challenge resource test fixture: %v", err) } testAuthorizationChallengeValid := testAuthorizationChallenge.DeepCopy() - testAuthorizationChallengeValid.Status.State = v1alpha2.Valid + testAuthorizationChallengeValid.Status.State = cmacme.Valid testAuthorizationChallengeInvalid := testAuthorizationChallenge.DeepCopy() - testAuthorizationChallengeInvalid.Status.State = v1alpha2.Invalid + testAuthorizationChallengeInvalid.Status.State = cmacme.Invalid testACMEAuthorizationPending := &acmeapi.Authorization{ URL: "http://authzurl", @@ -152,12 +153,12 @@ dGVzdA== builder: &testpkg.Builder{ CertManagerObjects: []runtime.Object{testIssuerHTTP01TestCom, testOrder}, ExpectedActions: []testpkg.Action{ - testpkg.NewAction(coretesting.NewUpdateAction(v1alpha2.SchemeGroupVersion.WithResource("orders"), testOrderPending.Namespace, - gen.OrderFrom(testOrder, gen.SetOrderStatus(v1alpha2.OrderStatus{ - State: v1alpha2.Pending, + testpkg.NewAction(coretesting.NewUpdateAction(cmacme.SchemeGroupVersion.WithResource("orders"), testOrderPending.Namespace, + gen.OrderFrom(testOrder, gen.SetOrderStatus(cmacme.OrderStatus{ + State: cmacme.Pending, URL: "http://testurl.com/abcde", FinalizeURL: "http://testurl.com/abcde/finalize", - Authorizations: []v1alpha2.ACMEAuthorization{ + Authorizations: []cmacme.ACMEAuthorization{ { URL: "http://authzurl", }, @@ -184,7 +185,7 @@ dGVzdA== builder: &testpkg.Builder{ CertManagerObjects: []runtime.Object{testIssuerHTTP01TestCom, testOrderPending}, ExpectedActions: []testpkg.Action{ - testpkg.NewAction(coretesting.NewCreateAction(v1alpha2.SchemeGroupVersion.WithResource("challenges"), testAuthorizationChallenge.Namespace, testAuthorizationChallenge)), + testpkg.NewAction(coretesting.NewCreateAction(cmacme.SchemeGroupVersion.WithResource("challenges"), testAuthorizationChallenge.Namespace, testAuthorizationChallenge)), }, ExpectedEvents: []string{ `Normal Created Created Challenge resource "testorder-1335133199" for domain "test.com"`, @@ -215,7 +216,7 @@ dGVzdA== builder: &testpkg.Builder{ CertManagerObjects: []runtime.Object{testIssuerHTTP01TestCom, testOrderPending, testAuthorizationChallengeValid}, ExpectedActions: []testpkg.Action{ - testpkg.NewAction(coretesting.NewUpdateAction(v1alpha2.SchemeGroupVersion.WithResource("orders"), testOrderReady.Namespace, testOrderReady)), + testpkg.NewAction(coretesting.NewUpdateAction(cmacme.SchemeGroupVersion.WithResource("orders"), testOrderReady.Namespace, testOrderReady)), }, }, acmeClient: &acmecl.FakeACME{ @@ -233,7 +234,7 @@ dGVzdA== builder: &testpkg.Builder{ CertManagerObjects: []runtime.Object{testIssuerHTTP01TestCom, testOrderReady, testAuthorizationChallengeValid}, ExpectedActions: []testpkg.Action{ - testpkg.NewAction(coretesting.NewUpdateAction(v1alpha2.SchemeGroupVersion.WithResource("orders"), testOrderValid.Namespace, testOrderValid)), + testpkg.NewAction(coretesting.NewUpdateAction(cmacme.SchemeGroupVersion.WithResource("orders"), testOrderValid.Namespace, testOrderValid)), }, ExpectedEvents: []string{ "Normal Complete Order completed successfully", @@ -258,7 +259,7 @@ dGVzdA== builder: &testpkg.Builder{ CertManagerObjects: []runtime.Object{testIssuerHTTP01TestCom, testOrderPending, testAuthorizationChallengeInvalid}, ExpectedActions: []testpkg.Action{ - testpkg.NewAction(coretesting.NewUpdateAction(v1alpha2.SchemeGroupVersion.WithResource("orders"), testOrderInvalid.Namespace, testOrderInvalid)), + testpkg.NewAction(coretesting.NewUpdateAction(cmacme.SchemeGroupVersion.WithResource("orders"), testOrderInvalid.Namespace, testOrderInvalid)), }, }, acmeClient: &acmecl.FakeACME{ @@ -318,7 +319,7 @@ dGVzdA== } type testT struct { - order *v1alpha2.Order + order *cmacme.Order builder *testpkg.Builder acmeClient acmecl.Interface expectErr bool diff --git a/pkg/controller/acmeorders/util.go b/pkg/controller/acmeorders/util.go index 0de437cef88..a3698f205d1 100644 --- a/pkg/controller/acmeorders/util.go +++ b/pkg/controller/acmeorders/util.go @@ -26,6 +26,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" acmecl "github.com/jetstack/cert-manager/pkg/acme/client" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" "github.com/jetstack/cert-manager/pkg/controller/acmeorders/selectors" logf "github.com/jetstack/cert-manager/pkg/logs" @@ -35,8 +36,8 @@ var ( orderGvk = cmapi.SchemeGroupVersion.WithKind("Order") ) -func buildRequiredChallenges(ctx context.Context, cl acmecl.Interface, issuer cmapi.GenericIssuer, o *cmapi.Order) ([]cmapi.Challenge, error) { - chs := make([]cmapi.Challenge, len(o.Status.Authorizations)) +func buildRequiredChallenges(ctx context.Context, cl acmecl.Interface, issuer cmapi.GenericIssuer, o *cmacme.Order) ([]cmacme.Challenge, error) { + chs := make([]cmacme.Challenge, len(o.Status.Authorizations)) for i, a := range o.Status.Authorizations { ch, err := buildChallenge(ctx, cl, issuer, o, a) if err != nil { @@ -47,7 +48,7 @@ func buildRequiredChallenges(ctx context.Context, cl acmecl.Interface, issuer cm return chs, nil } -func buildChallenge(ctx context.Context, cl acmecl.Interface, issuer cmapi.GenericIssuer, o *cmapi.Order, authz cmapi.ACMEAuthorization) (*cmapi.Challenge, error) { +func buildChallenge(ctx context.Context, cl acmecl.Interface, issuer cmapi.GenericIssuer, o *cmacme.Order, authz cmacme.ACMEAuthorization) (*cmacme.Challenge, error) { chSpec, err := challengeSpecForAuthorization(ctx, cl, issuer, o, authz) if err != nil { // TODO: in this case, we should probably not return the error as it's @@ -60,18 +61,18 @@ func buildChallenge(ctx context.Context, cl acmecl.Interface, issuer cmapi.Gener return nil, err } - return &cmapi.Challenge{ + return &cmacme.Challenge{ ObjectMeta: metav1.ObjectMeta{ Name: chName, Namespace: o.Namespace, OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(o, orderGvk)}, - Finalizers: []string{cmapi.ACMEFinalizer}, + Finalizers: []string{cmacme.ACMEFinalizer}, }, Spec: *chSpec, }, nil } -func buildChallengeName(orderName string, chSpec cmapi.ChallengeSpec) (string, error) { +func buildChallengeName(orderName string, chSpec cmacme.ChallengeSpec) (string, error) { hash, err := hashChallenge(chSpec) if err != nil { return "", err @@ -80,7 +81,7 @@ func buildChallengeName(orderName string, chSpec cmapi.ChallengeSpec) (string, e return fmt.Sprintf("%s-%d", orderName, hash), nil } -func hashChallenge(spec cmapi.ChallengeSpec) (uint32, error) { +func hashChallenge(spec cmacme.ChallengeSpec) (uint32, error) { specBytes, err := json.Marshal(spec) if err != nil { return 0, err @@ -95,7 +96,7 @@ func hashChallenge(spec cmapi.ChallengeSpec) (uint32, error) { return hashF.Sum32(), nil } -func challengeSpecForAuthorization(ctx context.Context, cl acmecl.Interface, issuer cmapi.GenericIssuer, o *cmapi.Order, authz cmapi.ACMEAuthorization) (*cmapi.ChallengeSpec, error) { +func challengeSpecForAuthorization(ctx context.Context, cl acmecl.Interface, issuer cmapi.GenericIssuer, o *cmacme.Order, authz cmacme.ACMEAuthorization) (*cmacme.ChallengeSpec, error) { log := logf.FromContext(ctx, "challengeSpecForAuthorization") dbg := log.V(logf.DebugLevel) @@ -107,13 +108,13 @@ func challengeSpecForAuthorization(ctx context.Context, cl acmecl.Interface, iss domainToFind = "*." + domainToFind } - var selectedSolver *cmapi.ACMEChallengeSolver - var selectedChallenge *cmapi.ACMEChallenge + var selectedSolver *cmacme.ACMEChallengeSolver + var selectedChallenge *cmacme.ACMEChallenge selectedNumLabelsMatch := 0 selectedNumDNSNamesMatch := 0 selectedNumDNSZonesMatch := 0 - challengeForSolver := func(solver *cmapi.ACMEChallengeSolver) *cmapi.ACMEChallenge { + challengeForSolver := func(solver *cmacme.ACMEChallengeSolver) *cmacme.ACMEChallenge { for _, ch := range authz.Challenges { switch { case ch.Type == "http-01" && solver.HTTP01 != nil: @@ -275,7 +276,7 @@ func challengeSpecForAuthorization(ctx context.Context, cl acmecl.Interface, iss } // 5. construct Challenge resource with spec.solver field set - return &cmapi.ChallengeSpec{ + return &cmacme.ChallengeSpec{ AuthzURL: authz.URL, Type: selectedChallenge.Type, URL: selectedChallenge.URL, @@ -288,13 +289,13 @@ func challengeSpecForAuthorization(ctx context.Context, cl acmecl.Interface, iss }, nil } -func applyIngressParameterAnnotationOverrides(o *cmapi.Order, s *cmapi.ACMEChallengeSolver) error { +func applyIngressParameterAnnotationOverrides(o *cmacme.Order, s *cmacme.ACMEChallengeSolver) error { if s.HTTP01 == nil || s.HTTP01.Ingress == nil || o.Annotations == nil { return nil } - manualIngressName, hasManualIngressName := o.Annotations[cmapi.ACMECertificateHTTP01IngressNameOverride] - manualIngressClass, hasManualIngressClass := o.Annotations[cmapi.ACMECertificateHTTP01IngressClassOverride] + manualIngressName, hasManualIngressName := o.Annotations[cmacme.ACMECertificateHTTP01IngressNameOverride] + manualIngressClass, hasManualIngressClass := o.Annotations[cmacme.ACMECertificateHTTP01IngressClassOverride] // don't allow both override annotations to be specified at once if hasManualIngressName && hasManualIngressClass { return fmt.Errorf("both ingress name and ingress class overrides specified - only one may be specified at a time") @@ -314,12 +315,12 @@ func applyIngressParameterAnnotationOverrides(o *cmapi.Order, s *cmapi.ACMEChall return nil } -func keyForChallenge(cl acmecl.Interface, challenge *cmapi.ACMEChallenge) (string, error) { +func keyForChallenge(cl acmecl.Interface, challenge *cmacme.ACMEChallenge) (string, error) { var err error switch challenge.Type { - case cmapi.ACMEChallengeTypeHTTP01: + case cmacme.ACMEChallengeTypeHTTP01: return cl.HTTP01ChallengeResponse(challenge.Token) - case cmapi.ACMEChallengeTypeDNS01: + case cmacme.ACMEChallengeTypeDNS01: return cl.DNS01ChallengeRecord(challenge.Token) default: err = fmt.Errorf("unsupported challenge type %s", challenge.Type) @@ -327,7 +328,7 @@ func keyForChallenge(cl acmecl.Interface, challenge *cmapi.ACMEChallenge) (strin return "", err } -func anyChallengesFailed(chs []*cmapi.Challenge) bool { +func anyChallengesFailed(chs []*cmacme.Challenge) bool { for _, ch := range chs { if acme.IsFailureState(ch.Status.State) { return true @@ -336,7 +337,7 @@ func anyChallengesFailed(chs []*cmapi.Challenge) bool { return false } -func allChallengesFinal(chs []*cmapi.Challenge) bool { +func allChallengesFinal(chs []*cmacme.Challenge) bool { for _, ch := range chs { if !acme.IsFinalState(ch.Status.State) { return false diff --git a/pkg/controller/acmeorders/util_test.go b/pkg/controller/acmeorders/util_test.go index 4cd5b2f9536..823593c02d6 100644 --- a/pkg/controller/acmeorders/util_test.go +++ b/pkg/controller/acmeorders/util_test.go @@ -26,6 +26,7 @@ import ( "k8s.io/utils/pointer" acmecl "github.com/jetstack/cert-manager/pkg/acme/client" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" ) @@ -41,49 +42,49 @@ func TestChallengeSpecForAuthorization(t *testing.T) { }, } // define some reusable solvers that are used in multiple unit tests - emptySelectorSolverHTTP01 := v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + emptySelectorSolverHTTP01 := cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "empty-selector-solver", }, }, } - emptySelectorSolverDNS01 := v1alpha2.ACMEChallengeSolver{ - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - Cloudflare: &v1alpha2.ACMEIssuerDNS01ProviderCloudflare{ + emptySelectorSolverDNS01 := cmacme.ACMEChallengeSolver{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + Cloudflare: &cmacme.ACMEIssuerDNS01ProviderCloudflare{ Email: "test-cloudflare-email", }, }, } - nonMatchingSelectorSolver := v1alpha2.ACMEChallengeSolver{ - Selector: &v1alpha2.CertificateDNSNameSelector{ + nonMatchingSelectorSolver := cmacme.ACMEChallengeSolver{ + Selector: &cmacme.CertificateDNSNameSelector{ MatchLabels: map[string]string{ "label": "does-not-exist", "does-not": "match", }, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "non-matching-selector-solver", }, }, } - exampleComDNSNameSelectorSolver := v1alpha2.ACMEChallengeSolver{ - Selector: &v1alpha2.CertificateDNSNameSelector{ + exampleComDNSNameSelectorSolver := cmacme.ACMEChallengeSolver{ + Selector: &cmacme.CertificateDNSNameSelector{ DNSNames: []string{"example.com"}, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "example-com-dns-name-selector-solver", }, }, } // define ACME challenges that are used during tests - acmeChallengeHTTP01 := &v1alpha2.ACMEChallenge{ + acmeChallengeHTTP01 := &cmacme.ACMEChallenge{ Type: "http-01", Token: "http-01-token", } - acmeChallengeDNS01 := &v1alpha2.ACMEChallenge{ + acmeChallengeDNS01 := &cmacme.ACMEChallenge{ Type: "dns-01", Token: "dns-01-token", } @@ -91,10 +92,10 @@ func TestChallengeSpecForAuthorization(t *testing.T) { tests := map[string]struct { acmeClient acmecl.Interface issuer v1alpha2.GenericIssuer - order *v1alpha2.Order - authz *v1alpha2.ACMEAuthorization + order *cmacme.Order + authz *cmacme.ACMEAuthorization - expectedChallengeSpec *v1alpha2.ChallengeSpec + expectedChallengeSpec *cmacme.ChallengeSpec expectedError bool }{ "should override the ingress name to edit if override annotation is specified": { @@ -102,34 +103,34 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{emptySelectorSolverHTTP01}, + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{emptySelectorSolverHTTP01}, }, }, }, }, - order: &v1alpha2.Order{ + order: &cmacme.Order{ ObjectMeta: metav1.ObjectMeta{ Annotations: map[string]string{ - v1alpha2.ACMECertificateHTTP01IngressNameOverride: "test-name-to-override", + cmacme.ACMECertificateHTTP01IngressNameOverride: "test-name-to-override", }, }, - Spec: v1alpha2.OrderSpec{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "example.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeHTTP01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeHTTP01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "http-01", DNSName: "example.com", Token: acmeChallengeHTTP01.Token, Key: "http01", - Solver: &v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + Solver: &cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "test-name-to-override", }, }, @@ -141,34 +142,34 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{emptySelectorSolverHTTP01}, + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{emptySelectorSolverHTTP01}, }, }, }, }, - order: &v1alpha2.Order{ + order: &cmacme.Order{ ObjectMeta: metav1.ObjectMeta{ Annotations: map[string]string{ - v1alpha2.ACMECertificateHTTP01IngressClassOverride: "test-class-to-override", + cmacme.ACMECertificateHTTP01IngressClassOverride: "test-class-to-override", }, }, - Spec: v1alpha2.OrderSpec{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "example.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeHTTP01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeHTTP01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "http-01", DNSName: "example.com", Token: acmeChallengeHTTP01.Token, Key: "http01", - Solver: &v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + Solver: &cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Class: pointer.StringPtr("test-class-to-override"), }, }, @@ -180,26 +181,26 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{emptySelectorSolverHTTP01}, + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{emptySelectorSolverHTTP01}, }, }, }, }, - order: &v1alpha2.Order{ + order: &cmacme.Order{ ObjectMeta: metav1.ObjectMeta{ Annotations: map[string]string{ - v1alpha2.ACMECertificateHTTP01IngressNameOverride: "test-name-to-override", - v1alpha2.ACMECertificateHTTP01IngressClassOverride: "test-class-to-override", + cmacme.ACMECertificateHTTP01IngressNameOverride: "test-name-to-override", + cmacme.ACMECertificateHTTP01IngressClassOverride: "test-class-to-override", }, }, - Spec: v1alpha2.OrderSpec{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "example.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeHTTP01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeHTTP01}, }, expectedError: true, }, @@ -208,27 +209,27 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{emptySelectorSolverDNS01}, + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{emptySelectorSolverDNS01}, }, }, }, }, - order: &v1alpha2.Order{ + order: &cmacme.Order{ ObjectMeta: metav1.ObjectMeta{ Annotations: map[string]string{ - v1alpha2.ACMECertificateHTTP01IngressNameOverride: "test-name-to-override", + cmacme.ACMECertificateHTTP01IngressNameOverride: "test-name-to-override", }, }, - Spec: v1alpha2.OrderSpec{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "example.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeDNS01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeDNS01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "dns-01", DNSName: "example.com", Token: acmeChallengeDNS01.Token, @@ -241,22 +242,22 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{emptySelectorSolverHTTP01}, + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{emptySelectorSolverHTTP01}, }, }, }, }, - order: &v1alpha2.Order{ - Spec: v1alpha2.OrderSpec{ + order: &cmacme.Order{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "example.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeHTTP01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeHTTP01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "http-01", DNSName: "example.com", Token: acmeChallengeHTTP01.Token, @@ -269,12 +270,12 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ { - Selector: &v1alpha2.CertificateDNSNameSelector{}, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + Selector: &cmacme.CertificateDNSNameSelector{}, + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "empty-selector-solver", }, }, @@ -284,24 +285,24 @@ func TestChallengeSpecForAuthorization(t *testing.T) { }, }, }, - order: &v1alpha2.Order{ - Spec: v1alpha2.OrderSpec{ + order: &cmacme.Order{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "example.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeHTTP01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeHTTP01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "http-01", DNSName: "example.com", Token: acmeChallengeHTTP01.Token, Key: "http01", - Solver: &v1alpha2.ACMEChallengeSolver{ - Selector: &v1alpha2.CertificateDNSNameSelector{}, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + Solver: &cmacme.ACMEChallengeSolver{ + Selector: &cmacme.CertificateDNSNameSelector{}, + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "empty-selector-solver", }, }, @@ -313,8 +314,8 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ emptySelectorSolverHTTP01, nonMatchingSelectorSolver, }, @@ -322,16 +323,16 @@ func TestChallengeSpecForAuthorization(t *testing.T) { }, }, }, - order: &v1alpha2.Order{ - Spec: v1alpha2.OrderSpec{ + order: &cmacme.Order{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "example.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeHTTP01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeHTTP01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "http-01", DNSName: "example.com", Token: acmeChallengeHTTP01.Token, @@ -344,8 +345,8 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ emptySelectorSolverHTTP01, emptySelectorSolverDNS01, }, @@ -353,16 +354,16 @@ func TestChallengeSpecForAuthorization(t *testing.T) { }, }, }, - order: &v1alpha2.Order{ - Spec: v1alpha2.OrderSpec{ + order: &cmacme.Order{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "example.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeDNS01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeDNS01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "dns-01", DNSName: "example.com", Token: acmeChallengeDNS01.Token, @@ -375,22 +376,22 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ nonMatchingSelectorSolver, }, }, }, }, }, - order: &v1alpha2.Order{ - Spec: v1alpha2.OrderSpec{ + order: &cmacme.Order{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "example.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeHTTP01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeHTTP01}, }, expectedError: true, }, @@ -399,8 +400,8 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ emptySelectorSolverHTTP01, exampleComDNSNameSelectorSolver, }, @@ -408,16 +409,16 @@ func TestChallengeSpecForAuthorization(t *testing.T) { }, }, }, - order: &v1alpha2.Order{ - Spec: v1alpha2.OrderSpec{ + order: &cmacme.Order{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "example.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeHTTP01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeHTTP01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "http-01", DNSName: "example.com", Token: acmeChallengeHTTP01.Token, @@ -430,8 +431,8 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ emptySelectorSolverHTTP01, exampleComDNSNameSelectorSolver, }, @@ -439,16 +440,16 @@ func TestChallengeSpecForAuthorization(t *testing.T) { }, }, }, - order: &v1alpha2.Order{ - Spec: v1alpha2.OrderSpec{ + order: &cmacme.Order{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"notexample.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "notexample.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeHTTP01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeHTTP01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "http-01", DNSName: "notexample.com", Token: acmeChallengeHTTP01.Token, @@ -461,18 +462,18 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ exampleComDNSNameSelectorSolver, { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ MatchLabels: map[string]string{ "label": "exists", }, DNSNames: []string{"example.com"}, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "example-com-dns-name-labels-selector-solver", }, }, @@ -482,34 +483,34 @@ func TestChallengeSpecForAuthorization(t *testing.T) { }, }, }, - order: &v1alpha2.Order{ + order: &cmacme.Order{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ "label": "exists", }, }, - Spec: v1alpha2.OrderSpec{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "example.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeHTTP01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeHTTP01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "http-01", DNSName: "example.com", Token: acmeChallengeHTTP01.Token, Key: "http01", - Solver: &v1alpha2.ACMEChallengeSolver{ - Selector: &v1alpha2.CertificateDNSNameSelector{ + Solver: &cmacme.ACMEChallengeSolver{ + Selector: &cmacme.CertificateDNSNameSelector{ MatchLabels: map[string]string{ "label": "exists", }, DNSNames: []string{"example.com"}, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "example-com-dns-name-labels-selector-solver", }, }, @@ -521,17 +522,17 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ exampleComDNSNameSelectorSolver, { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ MatchLabels: map[string]string{ "label": "exists", }, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "example-com-labels-selector-solver", }, }, @@ -541,21 +542,21 @@ func TestChallengeSpecForAuthorization(t *testing.T) { }, }, }, - order: &v1alpha2.Order{ + order: &cmacme.Order{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ "label": "exists", }, }, - Spec: v1alpha2.OrderSpec{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "example.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeHTTP01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeHTTP01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "http-01", DNSName: "example.com", Token: acmeChallengeHTTP01.Token, @@ -570,16 +571,16 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ MatchLabels: map[string]string{ "label": "exists", }, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "example-com-labels-selector-solver", }, }, @@ -590,21 +591,21 @@ func TestChallengeSpecForAuthorization(t *testing.T) { }, }, }, - order: &v1alpha2.Order{ + order: &cmacme.Order{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ "label": "exists", }, }, - Spec: v1alpha2.OrderSpec{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "example.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeHTTP01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeHTTP01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "http-01", DNSName: "example.com", Token: acmeChallengeHTTP01.Token, @@ -617,18 +618,18 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ exampleComDNSNameSelectorSolver, { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ MatchLabels: map[string]string{ "label": "exists", "another": "label", }, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "example-com-labels-selector-solver", }, }, @@ -638,22 +639,22 @@ func TestChallengeSpecForAuthorization(t *testing.T) { }, }, }, - order: &v1alpha2.Order{ + order: &cmacme.Order{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ "label": "exists", "another": "label", }, }, - Spec: v1alpha2.OrderSpec{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "example.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeHTTP01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeHTTP01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "http-01", DNSName: "example.com", Token: acmeChallengeHTTP01.Token, @@ -666,29 +667,29 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ MatchLabels: map[string]string{ "label": "exists", }, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "example-com-labels-selector-solver", }, }, }, { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ MatchLabels: map[string]string{ "label": "exists", "another": "matches", }, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "example-com-multiple-labels-selector-solver", }, }, @@ -698,35 +699,35 @@ func TestChallengeSpecForAuthorization(t *testing.T) { }, }, }, - order: &v1alpha2.Order{ + order: &cmacme.Order{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ "label": "exists", "another": "matches", }, }, - Spec: v1alpha2.OrderSpec{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "example.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeHTTP01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeHTTP01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "http-01", DNSName: "example.com", Token: acmeChallengeHTTP01.Token, Key: "http01", - Solver: &v1alpha2.ACMEChallengeSolver{ - Selector: &v1alpha2.CertificateDNSNameSelector{ + Solver: &cmacme.ACMEChallengeSolver{ + Selector: &cmacme.CertificateDNSNameSelector{ MatchLabels: map[string]string{ "label": "exists", "another": "matches", }, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "example-com-multiple-labels-selector-solver", }, }, @@ -738,15 +739,15 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ emptySelectorSolverDNS01, { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ DNSNames: []string{"*.example.com"}, }, - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - Cloudflare: &v1alpha2.ACMEIssuerDNS01ProviderCloudflare{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + Cloudflare: &cmacme.ACMEIssuerDNS01ProviderCloudflare{ Email: "example-com-wc-dnsname-selector-solver", }, }, @@ -756,28 +757,28 @@ func TestChallengeSpecForAuthorization(t *testing.T) { }, }, }, - order: &v1alpha2.Order{ - Spec: v1alpha2.OrderSpec{ + order: &cmacme.Order{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"*.example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "example.com", Wildcard: true, - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeDNS01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeDNS01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "dns-01", DNSName: "example.com", Wildcard: true, Token: acmeChallengeDNS01.Token, Key: "dns01", - Solver: &v1alpha2.ACMEChallengeSolver{ - Selector: &v1alpha2.CertificateDNSNameSelector{ + Solver: &cmacme.ACMEChallengeSolver{ + Selector: &cmacme.CertificateDNSNameSelector{ DNSNames: []string{"*.example.com"}, }, - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - Cloudflare: &v1alpha2.ACMEIssuerDNS01ProviderCloudflare{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + Cloudflare: &cmacme.ACMEIssuerDNS01ProviderCloudflare{ Email: "example-com-wc-dnsname-selector-solver", }, }, @@ -789,15 +790,15 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ exampleComDNSNameSelectorSolver, { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ DNSZones: []string{"com"}, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "com-dnszone-selector-solver", }, }, @@ -807,16 +808,16 @@ func TestChallengeSpecForAuthorization(t *testing.T) { }, }, }, - order: &v1alpha2.Order{ - Spec: v1alpha2.OrderSpec{ + order: &cmacme.Order{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "example.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeHTTP01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeHTTP01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "http-01", DNSName: "example.com", Token: acmeChallengeHTTP01.Token, @@ -829,14 +830,14 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ DNSZones: []string{"com"}, }, - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - Cloudflare: &v1alpha2.ACMEIssuerDNS01ProviderCloudflare{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + Cloudflare: &cmacme.ACMEIssuerDNS01ProviderCloudflare{ Email: "com-dnszone-selector-solver", }, }, @@ -847,16 +848,16 @@ func TestChallengeSpecForAuthorization(t *testing.T) { }, }, }, - order: &v1alpha2.Order{ - Spec: v1alpha2.OrderSpec{ + order: &cmacme.Order{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "example.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeHTTP01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeHTTP01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "http-01", DNSName: "example.com", Token: acmeChallengeHTTP01.Token, @@ -869,15 +870,15 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ emptySelectorSolverDNS01, { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ DNSZones: []string{"example.com"}, }, - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - Cloudflare: &v1alpha2.ACMEIssuerDNS01ProviderCloudflare{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + Cloudflare: &cmacme.ACMEIssuerDNS01ProviderCloudflare{ Email: "example-com-dnszone-selector-solver", }, }, @@ -887,28 +888,28 @@ func TestChallengeSpecForAuthorization(t *testing.T) { }, }, }, - order: &v1alpha2.Order{ - Spec: v1alpha2.OrderSpec{ + order: &cmacme.Order{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"www.example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "www.example.com", Wildcard: true, - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeDNS01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeDNS01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "dns-01", DNSName: "www.example.com", Wildcard: true, Token: acmeChallengeDNS01.Token, Key: "dns01", - Solver: &v1alpha2.ACMEChallengeSolver{ - Selector: &v1alpha2.CertificateDNSNameSelector{ + Solver: &cmacme.ACMEChallengeSolver{ + Selector: &cmacme.CertificateDNSNameSelector{ DNSZones: []string{"example.com"}, }, - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - Cloudflare: &v1alpha2.ACMEIssuerDNS01ProviderCloudflare{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + Cloudflare: &cmacme.ACMEIssuerDNS01ProviderCloudflare{ Email: "example-com-dnszone-selector-solver", }, }, @@ -920,24 +921,24 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ DNSZones: []string{"example.com"}, }, - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - Cloudflare: &v1alpha2.ACMEIssuerDNS01ProviderCloudflare{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + Cloudflare: &cmacme.ACMEIssuerDNS01ProviderCloudflare{ Email: "example-com-dnszone-selector-solver", }, }, }, { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ DNSZones: []string{"prod.example.com"}, }, - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - Cloudflare: &v1alpha2.ACMEIssuerDNS01ProviderCloudflare{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + Cloudflare: &cmacme.ACMEIssuerDNS01ProviderCloudflare{ Email: "prod-example-com-dnszone-selector-solver", }, }, @@ -947,28 +948,28 @@ func TestChallengeSpecForAuthorization(t *testing.T) { }, }, }, - order: &v1alpha2.Order{ - Spec: v1alpha2.OrderSpec{ + order: &cmacme.Order{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"www.prod.example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "www.prod.example.com", Wildcard: true, - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeDNS01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeDNS01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "dns-01", DNSName: "www.prod.example.com", Wildcard: true, Token: acmeChallengeDNS01.Token, Key: "dns01", - Solver: &v1alpha2.ACMEChallengeSolver{ - Selector: &v1alpha2.CertificateDNSNameSelector{ + Solver: &cmacme.ACMEChallengeSolver{ + Selector: &cmacme.CertificateDNSNameSelector{ DNSZones: []string{"prod.example.com"}, }, - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - Cloudflare: &v1alpha2.ACMEIssuerDNS01ProviderCloudflare{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + Cloudflare: &cmacme.ACMEIssuerDNS01ProviderCloudflare{ Email: "prod-example-com-dnszone-selector-solver", }, }, @@ -980,24 +981,24 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ DNSZones: []string{"prod.example.com"}, }, - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - Cloudflare: &v1alpha2.ACMEIssuerDNS01ProviderCloudflare{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + Cloudflare: &cmacme.ACMEIssuerDNS01ProviderCloudflare{ Email: "prod-example-com-dnszone-selector-solver", }, }, }, { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ DNSZones: []string{"example.com"}, }, - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - Cloudflare: &v1alpha2.ACMEIssuerDNS01ProviderCloudflare{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + Cloudflare: &cmacme.ACMEIssuerDNS01ProviderCloudflare{ Email: "example-com-dnszone-selector-solver", }, }, @@ -1007,28 +1008,28 @@ func TestChallengeSpecForAuthorization(t *testing.T) { }, }, }, - order: &v1alpha2.Order{ - Spec: v1alpha2.OrderSpec{ + order: &cmacme.Order{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"www.prod.example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "www.prod.example.com", Wildcard: true, - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeDNS01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeDNS01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "dns-01", DNSName: "www.prod.example.com", Wildcard: true, Token: acmeChallengeDNS01.Token, Key: "dns01", - Solver: &v1alpha2.ACMEChallengeSolver{ - Selector: &v1alpha2.CertificateDNSNameSelector{ + Solver: &cmacme.ACMEChallengeSolver{ + Selector: &cmacme.CertificateDNSNameSelector{ DNSZones: []string{"prod.example.com"}, }, - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - Cloudflare: &v1alpha2.ACMEIssuerDNS01ProviderCloudflare{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + Cloudflare: &cmacme.ACMEIssuerDNS01ProviderCloudflare{ Email: "prod-example-com-dnszone-selector-solver", }, }, @@ -1040,27 +1041,27 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ DNSZones: []string{"example.com"}, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "example-com-dnszone-selector-solver", }, }, }, { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ MatchLabels: map[string]string{ "label": "exists", }, DNSZones: []string{"example.com"}, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "example-com-dnszone-labels-selector-solver", }, }, @@ -1070,34 +1071,34 @@ func TestChallengeSpecForAuthorization(t *testing.T) { }, }, }, - order: &v1alpha2.Order{ + order: &cmacme.Order{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ "label": "exists", }, }, - Spec: v1alpha2.OrderSpec{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"www.example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "www.example.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeHTTP01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeHTTP01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "http-01", DNSName: "www.example.com", Token: acmeChallengeHTTP01.Token, Key: "http01", - Solver: &v1alpha2.ACMEChallengeSolver{ - Selector: &v1alpha2.CertificateDNSNameSelector{ + Solver: &cmacme.ACMEChallengeSolver{ + Selector: &cmacme.CertificateDNSNameSelector{ MatchLabels: map[string]string{ "label": "exists", }, DNSZones: []string{"example.com"}, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "example-com-dnszone-labels-selector-solver", }, }, @@ -1109,25 +1110,25 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ DNSNames: []string{"www.example.com"}, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "example-com-dnsname-selector-solver", }, }, }, { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ DNSZones: []string{"example.com"}, DNSNames: []string{"www.example.com"}, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "example-com-dnsname-dnszone-selector-solver", }, }, @@ -1137,27 +1138,27 @@ func TestChallengeSpecForAuthorization(t *testing.T) { }, }, }, - order: &v1alpha2.Order{ - Spec: v1alpha2.OrderSpec{ + order: &cmacme.Order{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"www.example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "www.example.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeHTTP01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeHTTP01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "http-01", DNSName: "www.example.com", Token: acmeChallengeHTTP01.Token, Key: "http01", - Solver: &v1alpha2.ACMEChallengeSolver{ - Selector: &v1alpha2.CertificateDNSNameSelector{ + Solver: &cmacme.ACMEChallengeSolver{ + Selector: &cmacme.CertificateDNSNameSelector{ DNSZones: []string{"example.com"}, DNSNames: []string{"www.example.com"}, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "example-com-dnsname-dnszone-selector-solver", }, }, @@ -1169,25 +1170,25 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ DNSZones: []string{"example.com"}, DNSNames: []string{"www.example.com"}, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "example-com-dnsname-dnszone-selector-solver", }, }, }, { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ DNSNames: []string{"www.example.com"}, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "example-com-dnsname-selector-solver", }, }, @@ -1197,27 +1198,27 @@ func TestChallengeSpecForAuthorization(t *testing.T) { }, }, }, - order: &v1alpha2.Order{ - Spec: v1alpha2.OrderSpec{ + order: &cmacme.Order{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"www.example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "www.example.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeHTTP01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeHTTP01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "http-01", DNSName: "www.example.com", Token: acmeChallengeHTTP01.Token, Key: "http01", - Solver: &v1alpha2.ACMEChallengeSolver{ - Selector: &v1alpha2.CertificateDNSNameSelector{ + Solver: &cmacme.ACMEChallengeSolver{ + Selector: &cmacme.CertificateDNSNameSelector{ DNSZones: []string{"example.com"}, DNSNames: []string{"www.example.com"}, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "example-com-dnsname-dnszone-selector-solver", }, }, @@ -1229,8 +1230,8 @@ func TestChallengeSpecForAuthorization(t *testing.T) { issuer: &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ - Solvers: []v1alpha2.ACMEChallengeSolver{ + ACME: &cmacme.ACMEIssuer{ + Solvers: []cmacme.ACMEChallengeSolver{ exampleComDNSNameSelectorSolver, emptySelectorSolverHTTP01, }, @@ -1238,16 +1239,16 @@ func TestChallengeSpecForAuthorization(t *testing.T) { }, }, }, - order: &v1alpha2.Order{ - Spec: v1alpha2.OrderSpec{ + order: &cmacme.Order{ + Spec: cmacme.OrderSpec{ DNSNames: []string{"example.com"}, }, }, - authz: &v1alpha2.ACMEAuthorization{ + authz: &cmacme.ACMEAuthorization{ Identifier: "example.com", - Challenges: []v1alpha2.ACMEChallenge{*acmeChallengeHTTP01}, + Challenges: []cmacme.ACMEChallenge{*acmeChallengeHTTP01}, }, - expectedChallengeSpec: &v1alpha2.ChallengeSpec{ + expectedChallengeSpec: &cmacme.ChallengeSpec{ Type: "http-01", DNSName: "example.com", Token: acmeChallengeHTTP01.Token, diff --git a/pkg/controller/certificaterequests/acme/BUILD.bazel b/pkg/controller/certificaterequests/acme/BUILD.bazel index 21905d3d436..d0271b7954a 100644 --- a/pkg/controller/certificaterequests/acme/BUILD.bazel +++ b/pkg/controller/certificaterequests/acme/BUILD.bazel @@ -8,9 +8,10 @@ go_library( deps = [ "//pkg/acme:go_default_library", "//pkg/api/util:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", - "//pkg/client/clientset/versioned/typed/certmanager/v1alpha2:go_default_library", - "//pkg/client/listers/certmanager/v1alpha2:go_default_library", + "//pkg/client/clientset/versioned/typed/acme/v1alpha2:go_default_library", + "//pkg/client/listers/acme/v1alpha2:go_default_library", "//pkg/controller:go_default_library", "//pkg/controller/certificaterequests:go_default_library", "//pkg/controller/certificaterequests/util:go_default_library", @@ -29,10 +30,11 @@ go_test( embed = [":go_default_library"], deps = [ "//pkg/api/util:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", - "//pkg/client/listers/certmanager/v1alpha2:go_default_library", + "//pkg/client/listers/acme/v1alpha2:go_default_library", "//pkg/controller/certificaterequests:go_default_library", "//pkg/controller/test:go_default_library", "//pkg/util/pki:go_default_library", diff --git a/pkg/controller/certificaterequests/acme/acme.go b/pkg/controller/certificaterequests/acme/acme.go index 38219170ec0..c8279eca8a1 100644 --- a/pkg/controller/certificaterequests/acme/acme.go +++ b/pkg/controller/certificaterequests/acme/acme.go @@ -29,9 +29,10 @@ import ( "github.com/jetstack/cert-manager/pkg/acme" apiutil "github.com/jetstack/cert-manager/pkg/api/util" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" - cmclientset "github.com/jetstack/cert-manager/pkg/client/clientset/versioned/typed/certmanager/v1alpha2" - cmlisters "github.com/jetstack/cert-manager/pkg/client/listers/certmanager/v1alpha2" + cmacmeclientset "github.com/jetstack/cert-manager/pkg/client/clientset/versioned/typed/acme/v1alpha2" + cmacmelisters "github.com/jetstack/cert-manager/pkg/client/listers/acme/v1alpha2" controllerpkg "github.com/jetstack/cert-manager/pkg/controller" "github.com/jetstack/cert-manager/pkg/controller/certificaterequests" crutil "github.com/jetstack/cert-manager/pkg/controller/certificaterequests/util" @@ -49,8 +50,8 @@ type ACME struct { recorder record.EventRecorder issuerOptions controllerpkg.IssuerOptions - orderLister cmlisters.OrderLister - cmClientV cmclientset.CertmanagerV1alpha2Interface + orderLister cmacmelisters.OrderLister + acmeClientV cmacmeclientset.AcmeV1alpha2Interface reporter *crutil.Reporter } @@ -60,7 +61,7 @@ func init() { controllerpkg.Register(CRControllerName, func(ctx *controllerpkg.Context) (controllerpkg.Interface, error) { // watch owned Order resources and trigger resyncs of CertificateRequests // that own Orders automatically - orderInformer := ctx.SharedInformerFactory.Certmanager().V1alpha2().Orders().Informer() + orderInformer := ctx.SharedInformerFactory.Acme().V1alpha2().Orders().Informer() return controllerpkg.NewBuilder(ctx, CRControllerName). For(certificaterequests.New(apiutil.IssuerACME, NewACME(ctx), orderInformer)). Complete() @@ -71,8 +72,8 @@ func NewACME(ctx *controllerpkg.Context) *ACME { return &ACME{ recorder: ctx.Recorder, issuerOptions: ctx.IssuerOptions, - orderLister: ctx.SharedInformerFactory.Certmanager().V1alpha2().Orders().Lister(), - cmClientV: ctx.CMClient.CertmanagerV1alpha2(), + orderLister: ctx.SharedInformerFactory.Acme().V1alpha2().Orders().Lister(), + acmeClientV: ctx.CMClient.AcmeV1alpha2(), reporter: crutil.NewReporter(ctx.Clock, ctx.Recorder), } } @@ -106,7 +107,7 @@ func (a *ACME) Sign(ctx context.Context, cr *v1alpha2.CertificateRequest, issuer if k8sErrors.IsNotFound(err) { // Failing to create the order here is most likely network related. // We should backoff and keep trying. - _, err = a.cmClientV.Orders(expectedOrder.Namespace).Create(expectedOrder) + _, err = a.acmeClientV.Orders(expectedOrder.Namespace).Create(expectedOrder) if err != nil { message := fmt.Sprintf("Failed create new order resource %s/%s", expectedOrder.Namespace, expectedOrder.Name) @@ -148,7 +149,7 @@ func (a *ACME) Sign(ctx context.Context, cr *v1alpha2.CertificateRequest, issuer } // Order valid, return cert. The calling controller will update with ready if its happy with the cert. - if order.Status.State == v1alpha2.Valid { + if order.Status.State == cmacme.Valid { log.Info("certificate issued") return &issuerpkg.IssueResponse{ @@ -167,8 +168,8 @@ func (a *ACME) Sign(ctx context.Context, cr *v1alpha2.CertificateRequest, issuer } // Build order. If we error here it is a terminating failure. -func buildOrder(cr *v1alpha2.CertificateRequest, csr *x509.CertificateRequest) (*v1alpha2.Order, error) { - spec := v1alpha2.OrderSpec{ +func buildOrder(cr *v1alpha2.CertificateRequest, csr *x509.CertificateRequest) (*cmacme.Order, error) { + spec := cmacme.OrderSpec{ CSR: cr.Spec.CSRPEM, IssuerRef: cr.Spec.IssuerRef, CommonName: csr.Subject.CommonName, @@ -182,7 +183,7 @@ func buildOrder(cr *v1alpha2.CertificateRequest, csr *x509.CertificateRequest) ( // truncate certificate name so final name will be <= 63 characters. // hash (uint32) will be at most 10 digits long, and we account for // the hyphen. - return &v1alpha2.Order{ + return &cmacme.Order{ ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("%.52s-%d", cr.Name, hash), Namespace: cr.Namespace, @@ -196,7 +197,7 @@ func buildOrder(cr *v1alpha2.CertificateRequest, csr *x509.CertificateRequest) ( }, nil } -func hashOrder(orderSpec v1alpha2.OrderSpec) (uint32, error) { +func hashOrder(orderSpec cmacme.OrderSpec) (uint32, error) { // create a shallow copy of the OrderSpec so we can overwrite the CSR field orderSpec.CSR = nil diff --git a/pkg/controller/certificaterequests/acme/acme_test.go b/pkg/controller/certificaterequests/acme/acme_test.go index 41c589b47ca..731db9e9a0a 100644 --- a/pkg/controller/certificaterequests/acme/acme_test.go +++ b/pkg/controller/certificaterequests/acme/acme_test.go @@ -34,10 +34,11 @@ import ( fakeclock "k8s.io/utils/clock/testing" apiutil "github.com/jetstack/cert-manager/pkg/api/util" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager" cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" - cmlisters "github.com/jetstack/cert-manager/pkg/client/listers/certmanager/v1alpha2" + cmacmelisters "github.com/jetstack/cert-manager/pkg/client/listers/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/controller/certificaterequests" testpkg "github.com/jetstack/cert-manager/pkg/controller/test" "github.com/jetstack/cert-manager/pkg/util/pki" @@ -72,7 +73,7 @@ func generateCSR(t *testing.T, secretKey crypto.Signer) []byte { func TestSign(t *testing.T) { baseIssuer := gen.Issuer("test-issuer", - gen.SetIssuerACME(cmapi.ACMEIssuer{}), + gen.SetIssuerACME(cmacme.ACMEIssuer{}), ) sk, err := pki.GenerateRSAPrivateKey(2048) @@ -161,7 +162,7 @@ func TestSign(t *testing.T) { }, ExpectedActions: []testpkg.Action{ testpkg.NewAction(coretesting.NewCreateAction( - cmapi.SchemeGroupVersion.WithResource("orders"), + cmacme.SchemeGroupVersion.WithResource("orders"), gen.DefaultTestNamespace, baseOrder, )), @@ -206,9 +207,9 @@ func TestSign(t *testing.T) { }, }, fakeOrderLister: &testlisters.FakeOrderLister{ - OrdersFn: func(namespace string) cmlisters.OrderNamespaceLister { + OrdersFn: func(namespace string) cmacmelisters.OrderNamespaceLister { return &testlisters.FakeOrderNamespaceLister{ - GetFn: func(name string) (ret *cmapi.Order, err error) { + GetFn: func(name string) (ret *cmacme.Order, err error) { return nil, errors.New("this is a network error") }, } @@ -225,7 +226,7 @@ func TestSign(t *testing.T) { }, CertManagerObjects: []runtime.Object{baseCR.DeepCopy(), baseIssuer.DeepCopy(), gen.OrderFrom(baseOrder, - gen.SetOrderState(cmapi.Invalid), + gen.SetOrderState(cmacme.Invalid), ), }, ExpectedActions: []testpkg.Action{ @@ -255,7 +256,7 @@ func TestSign(t *testing.T) { }, CertManagerObjects: []runtime.Object{baseCR.DeepCopy(), baseIssuer.DeepCopy(), gen.OrderFrom(baseOrder, - gen.SetOrderState(cmapi.Pending), + gen.SetOrderState(cmacme.Pending), ), }, ExpectedActions: []testpkg.Action{ @@ -283,7 +284,7 @@ func TestSign(t *testing.T) { "Normal CertificateIssued Certificate fetched from issuer successfully", }, CertManagerObjects: []runtime.Object{gen.OrderFrom(baseOrder, - gen.SetOrderState(cmapi.Valid), + gen.SetOrderState(cmacme.Valid), gen.SetOrderCertificate(certPEM), ), baseCR.DeepCopy(), baseIssuer.DeepCopy()}, ExpectedActions: []testpkg.Action{ diff --git a/pkg/controller/ingress-shim/BUILD.bazel b/pkg/controller/ingress-shim/BUILD.bazel index edf4e46415d..7e66d6f0362 100644 --- a/pkg/controller/ingress-shim/BUILD.bazel +++ b/pkg/controller/ingress-shim/BUILD.bazel @@ -10,6 +10,7 @@ go_library( importpath = "github.com/jetstack/cert-manager/pkg/controller/ingress-shim", visibility = ["//visibility:public"], deps = [ + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", "//pkg/client/clientset/versioned:go_default_library", @@ -40,6 +41,7 @@ go_test( srcs = ["sync_test.go"], embed = [":go_default_library"], deps = [ + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", "//pkg/controller/test:go_default_library", diff --git a/pkg/controller/ingress-shim/sync.go b/pkg/controller/ingress-shim/sync.go index b72566d1e35..3d19e4b7634 100644 --- a/pkg/controller/ingress-shim/sync.go +++ b/pkg/controller/ingress-shim/sync.go @@ -28,6 +28,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" "github.com/jetstack/cert-manager/pkg/logs" @@ -302,7 +303,7 @@ func (c *controller) setIssuerSpecificConfig(crt *v1alpha2.Certificate, issuer v if crt.Annotations == nil { crt.Annotations = make(map[string]string) } - crt.Annotations[v1alpha2.ACMECertificateHTTP01IngressNameOverride] = ing.Name + crt.Annotations[cmacme.ACMECertificateHTTP01IngressNameOverride] = ing.Name // set IssueTemporaryCertificateAnnotation to true in order to behave // better when ingress-gce is being used. crt.Annotations[v1alpha2.IssueTemporaryCertificateAnnotation] = "true" @@ -313,7 +314,7 @@ func (c *controller) setIssuerSpecificConfig(crt *v1alpha2.Certificate, issuer v if crt.Annotations == nil { crt.Annotations = make(map[string]string) } - crt.Annotations[v1alpha2.ACMECertificateHTTP01IngressClassOverride] = ingressClassVal + crt.Annotations[cmacme.ACMECertificateHTTP01IngressClassOverride] = ingressClassVal } return nil diff --git a/pkg/controller/ingress-shim/sync_test.go b/pkg/controller/ingress-shim/sync_test.go index 740fd38619b..6a4373e5c92 100644 --- a/pkg/controller/ingress-shim/sync_test.go +++ b/pkg/controller/ingress-shim/sync_test.go @@ -27,6 +27,7 @@ import ( types "k8s.io/apimachinery/pkg/types" coretesting "k8s.io/client-go/testing" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" testpkg "github.com/jetstack/cert-manager/pkg/controller/test" @@ -76,11 +77,11 @@ func TestShouldSync(t *testing.T) { func TestSync(t *testing.T) { clusterIssuer := gen.ClusterIssuer("issuer-name") acmeIssuerNewFormat := gen.Issuer("issuer-name", - gen.SetIssuerACME(v1alpha2.ACMEIssuer{})) + gen.SetIssuerACME(cmacme.ACMEIssuer{})) acmeIssuer := gen.Issuer("issuer-name", - gen.SetIssuerACME(v1alpha2.ACMEIssuer{})) + gen.SetIssuerACME(cmacme.ACMEIssuer{})) acmeClusterIssuer := gen.ClusterIssuer("issuer-name", - gen.SetIssuerACME(v1alpha2.ACMEIssuer{})) + gen.SetIssuerACME(cmacme.ACMEIssuer{})) type testT struct { Name string Ingress *extv1beta1.Ingress @@ -131,8 +132,8 @@ func TestSync(t *testing.T) { "my-test-label": "should be copied", }, Annotations: map[string]string{ - v1alpha2.ACMECertificateHTTP01IngressNameOverride: "ingress-name", - v1alpha2.IssueTemporaryCertificateAnnotation: "true", + cmacme.ACMECertificateHTTP01IngressNameOverride: "ingress-name", + v1alpha2.IssueTemporaryCertificateAnnotation: "true", }, OwnerReferences: buildOwnerReferences("ingress-name", gen.DefaultTestNamespace), }, @@ -182,8 +183,8 @@ func TestSync(t *testing.T) { "my-test-label": "should be copied", }, Annotations: map[string]string{ - v1alpha2.ACMECertificateHTTP01IngressNameOverride: "ingress-name", - v1alpha2.IssueTemporaryCertificateAnnotation: "true", + cmacme.ACMECertificateHTTP01IngressNameOverride: "ingress-name", + v1alpha2.IssueTemporaryCertificateAnnotation: "true", }, OwnerReferences: buildOwnerReferences("ingress-name", gen.DefaultTestNamespace), }, @@ -310,7 +311,7 @@ func TestSync(t *testing.T) { Namespace: gen.DefaultTestNamespace, OwnerReferences: buildOwnerReferences("ingress-name", gen.DefaultTestNamespace), Annotations: map[string]string{ - v1alpha2.ACMECertificateHTTP01IngressClassOverride: "cert-ing", + cmacme.ACMECertificateHTTP01IngressClassOverride: "cert-ing", }, }, Spec: v1alpha2.CertificateSpec{ @@ -953,7 +954,7 @@ func buildACMEIssuer(name, namespace string) *v1alpha2.Issuer { }, Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{}, + ACME: &cmacme.ACMEIssuer{}, }, }, } diff --git a/pkg/internal/BUILD.bazel b/pkg/internal/BUILD.bazel index 64f6fedaeba..5a133917990 100644 --- a/pkg/internal/BUILD.bazel +++ b/pkg/internal/BUILD.bazel @@ -9,6 +9,7 @@ filegroup( name = "all-srcs", srcs = [ ":package-srcs", + "//pkg/internal/apis/acme:all-srcs", "//pkg/internal/apis/certmanager:all-srcs", "//pkg/internal/apis/meta:all-srcs", "//pkg/internal/vault:all-srcs", diff --git a/pkg/internal/apis/acme/BUILD.bazel b/pkg/internal/apis/acme/BUILD.bazel new file mode 100644 index 00000000000..dcea916d815 --- /dev/null +++ b/pkg/internal/apis/acme/BUILD.bazel @@ -0,0 +1,43 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "doc.go", + "register.go", + "types_challenge.go", + "types_issuer.go", + "types_order.go", + "zz_generated.deepcopy.go", + ], + importpath = "github.com/jetstack/cert-manager/pkg/internal/apis/acme", + visibility = ["//pkg:__subpackages__"], + deps = [ + "//pkg/apis/acme:go_default_library", + "//pkg/internal/apis/meta:go_default_library", + "//vendor/k8s.io/api/core/v1:go_default_library", + "//vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [ + ":package-srcs", + "//pkg/internal/apis/acme/fuzzer:all-srcs", + "//pkg/internal/apis/acme/install:all-srcs", + "//pkg/internal/apis/acme/v1alpha2:all-srcs", + ], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/pkg/internal/apis/acme/doc.go b/pkg/internal/apis/acme/doc.go new file mode 100644 index 00000000000..328add139b7 --- /dev/null +++ b/pkg/internal/apis/acme/doc.go @@ -0,0 +1,21 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package,register + +// Package acme is the internal version of the API. +// +groupName=acme.cert-manager.io +package acme diff --git a/pkg/internal/apis/acme/fuzzer/BUILD.bazel b/pkg/internal/apis/acme/fuzzer/BUILD.bazel new file mode 100644 index 00000000000..402f4e6d05c --- /dev/null +++ b/pkg/internal/apis/acme/fuzzer/BUILD.bazel @@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["fuzzer.go"], + importpath = "github.com/jetstack/cert-manager/pkg/internal/apis/acme/fuzzer", + visibility = ["//pkg:__subpackages__"], + deps = [ + "//pkg/apis/certmanager/v1alpha2:go_default_library", + "//pkg/internal/apis/acme:go_default_library", + "//vendor/github.com/google/gofuzz:go_default_library", + "//vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/pkg/internal/apis/acme/fuzzer/fuzzer.go b/pkg/internal/apis/acme/fuzzer/fuzzer.go new file mode 100644 index 00000000000..065df3aca02 --- /dev/null +++ b/pkg/internal/apis/acme/fuzzer/fuzzer.go @@ -0,0 +1,51 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package fuzzer + +import ( + fuzz "github.com/google/gofuzz" + apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" + + "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + "github.com/jetstack/cert-manager/pkg/internal/apis/acme" +) + +// Funcs returns the fuzzer functions for the apps api group. +var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} { + return []interface{}{ + func(s *acme.Order, c fuzz.Continue) { + c.FuzzNoCustom(s) // fuzz self without calling this function again + + if s.Spec.IssuerRef.Kind == "" { + s.Spec.IssuerRef.Kind = v1alpha2.IssuerKind + } + }, + func(s *acme.Challenge, c fuzz.Continue) { + c.FuzzNoCustom(s) // fuzz self without calling this function again + + if s.Spec.IssuerRef.Kind == "" { + s.Spec.IssuerRef.Kind = v1alpha2.IssuerKind + } + }, + func(s *acme.ACMEIssuerDNS01ProviderWebhook, c fuzz.Continue) { + c.FuzzNoCustom(s) // fuzz self without calling this function again + // ensure the webhook's config is valid JSON + s.Config = &apiext.JSON{Raw: []byte("{}")} + }, + } +} diff --git a/pkg/internal/apis/acme/install/BUILD.bazel b/pkg/internal/apis/acme/install/BUILD.bazel new file mode 100644 index 00000000000..135e02acb43 --- /dev/null +++ b/pkg/internal/apis/acme/install/BUILD.bazel @@ -0,0 +1,38 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "go_default_library", + srcs = ["install.go"], + importpath = "github.com/jetstack/cert-manager/pkg/internal/apis/acme/install", + visibility = ["//visibility:public"], + deps = [ + "//pkg/internal/apis/acme:go_default_library", + "//pkg/internal/apis/acme/v1alpha2:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) + +go_test( + name = "go_default_test", + srcs = ["roundtrip_test.go"], + embed = [":go_default_library"], + deps = [ + "//pkg/internal/apis/acme/fuzzer:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/api/apitesting/roundtrip:go_default_library", + ], +) diff --git a/pkg/internal/apis/acme/install/install.go b/pkg/internal/apis/acme/install/install.go new file mode 100644 index 00000000000..bfe270bec38 --- /dev/null +++ b/pkg/internal/apis/acme/install/install.go @@ -0,0 +1,33 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package install installs the API group, making it available as an option to +// all of the API encoding/decoding machinery. +package install + +import ( + "k8s.io/apimachinery/pkg/runtime" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + + "github.com/jetstack/cert-manager/pkg/internal/apis/acme" + "github.com/jetstack/cert-manager/pkg/internal/apis/acme/v1alpha2" +) + +// Install registers the API group and adds types to a scheme +func Install(scheme *runtime.Scheme) { + utilruntime.Must(acme.AddToScheme(scheme)) + utilruntime.Must(v1alpha2.AddToScheme(scheme)) +} diff --git a/pkg/internal/apis/acme/install/roundtrip_test.go b/pkg/internal/apis/acme/install/roundtrip_test.go new file mode 100644 index 00000000000..55ef2be66f5 --- /dev/null +++ b/pkg/internal/apis/acme/install/roundtrip_test.go @@ -0,0 +1,29 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package install + +import ( + "testing" + + "k8s.io/apimachinery/pkg/api/apitesting/roundtrip" + + acmefuzzer "github.com/jetstack/cert-manager/pkg/internal/apis/acme/fuzzer" +) + +func TestRoundTripTypes(t *testing.T) { + roundtrip.RoundTripTestForAPIGroup(t, Install, acmefuzzer.Funcs) +} diff --git a/pkg/internal/apis/acme/register.go b/pkg/internal/apis/acme/register.go new file mode 100644 index 00000000000..cfda7298c68 --- /dev/null +++ b/pkg/internal/apis/acme/register.go @@ -0,0 +1,48 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package acme + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/jetstack/cert-manager/pkg/apis/acme" +) + +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + AddToScheme = SchemeBuilder.AddToScheme +) + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: acme.GroupName, Version: runtime.APIVersionInternal} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &Order{}, + &OrderList{}, + &Challenge{}, + &ChallengeList{}, + ) + return nil +} diff --git a/pkg/internal/apis/certmanager/types_challenge.go b/pkg/internal/apis/acme/types_challenge.go similarity index 95% rename from pkg/internal/apis/certmanager/types_challenge.go rename to pkg/internal/apis/acme/types_challenge.go index 5c87505a6b2..dadb15285f1 100644 --- a/pkg/internal/apis/certmanager/types_challenge.go +++ b/pkg/internal/apis/acme/types_challenge.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package certmanager +package acme import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -22,9 +22,6 @@ import ( cmmeta "github.com/jetstack/cert-manager/pkg/internal/apis/meta" ) -// TODO: these types should be moved into their own API group once we have a loose -// coupling between ACME Issuers and their solver configurations (see: Solver proposal) - // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Challenge is a type to represent a Challenge request with an ACME server diff --git a/pkg/internal/apis/acme/types_issuer.go b/pkg/internal/apis/acme/types_issuer.go new file mode 100644 index 00000000000..163f7b943cb --- /dev/null +++ b/pkg/internal/apis/acme/types_issuer.go @@ -0,0 +1,373 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package acme + +import ( + corev1 "k8s.io/api/core/v1" + apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + cmmeta "github.com/jetstack/cert-manager/pkg/internal/apis/meta" +) + +// ACMEIssuer contains the specification for an ACME issuer +type ACMEIssuer struct { + // Email is the email for this account + // +optional + Email string `json:"email,omitempty"` + + // Server is the ACME server URL + Server string `json:"server"` + + // If true, skip verifying the ACME server TLS certificate + // +optional + SkipTLSVerify bool `json:"skipTLSVerify,omitempty"` + + // PrivateKey is the name of a secret containing the private key for this + // user account. + PrivateKey cmmeta.SecretKeySelector `json:"privateKeySecretRef"` + + // Solvers is a list of challenge solvers that will be used to solve + // ACME challenges for the matching domains. + // +optional + Solvers []ACMEChallengeSolver `json:"solvers,omitempty"` +} + +type ACMEChallengeSolver struct { + // Selector selects a set of DNSNames on the Certificate resource that + // should be solved using this challenge solver. + Selector *CertificateDNSNameSelector `json:"selector,omitempty"` + + // +optional + HTTP01 *ACMEChallengeSolverHTTP01 `json:"http01,omitempty"` + + // +optional + DNS01 *ACMEChallengeSolverDNS01 `json:"dns01,omitempty"` +} + +// CertificateDomainSelector selects certificates using a label selector, and +// can optionally select individual DNS names within those certificates. +// If both MatchLabels and DNSNames are empty, this selector will match all +// certificates and DNS names within them. +type CertificateDNSNameSelector struct { + // A label selector that is used to refine the set of certificate's that + // this challenge solver will apply to. + // +optional + MatchLabels map[string]string `json:"matchLabels,omitempty"` + + // List of DNSNames that this solver will be used to solve. + // If specified and a match is found, a dnsNames selector will take + // precedence over a dnsZones selector. + // If multiple solvers match with the same dnsNames value, the solver + // with the most matching labels in matchLabels will be selected. + // If neither has more matches, the solver defined earlier in the list + // will be selected. + // +optional + DNSNames []string `json:"dnsNames,omitempty"` + + // List of DNSZones that this solver will be used to solve. + // The most specific DNS zone match specified here will take precedence + // over other DNS zone matches, so a solver specifying sys.example.com + // will be selected over one specifying example.com for the domain + // www.sys.example.com. + // If multiple solvers match with the same dnsZones value, the solver + // with the most matching labels in matchLabels will be selected. + // If neither has more matches, the solver defined earlier in the list + // will be selected. + // +optional + DNSZones []string `json:"dnsZones,omitempty"` +} + +// ACMEChallengeSolverHTTP01 contains configuration detailing how to solve +// HTTP01 challenges within a Kubernetes cluster. +// Typically this is accomplished through creating 'routes' of some description +// that configure ingress controllers to direct traffic to 'solver pods', which +// are responsible for responding to the ACME server's HTTP requests. +type ACMEChallengeSolverHTTP01 struct { + // The ingress based HTTP01 challenge solver will solve challenges by + // creating or modifying Ingress resources in order to route requests for + // '/.well-known/acme-challenge/XYZ' to 'challenge solver' pods that are + // provisioned by cert-manager for each Challenge to be completed. + // +optional + Ingress *ACMEChallengeSolverHTTP01Ingress `json:"ingress"` +} + +type ACMEChallengeSolverHTTP01Ingress struct { + // Optional service type for Kubernetes solver service + // +optional + ServiceType corev1.ServiceType `json:"serviceType,omitempty"` + + // The ingress class to use when creating Ingress resources to solve ACME + // challenges that use this challenge solver. + // Only one of 'class' or 'name' may be specified. + // +optional + Class *string `json:"class,omitempty"` + + // The name of the ingress resource that should have ACME challenge solving + // routes inserted into it in order to solve HTTP01 challenges. + // This is typically used in conjunction with ingress controllers like + // ingress-gce, which maintains a 1:1 mapping between external IPs and + // ingress resources. + // +optional + Name string `json:"name,omitempty"` + + // Optional pod template used to configure the ACME challenge solver pods + // used for HTTP01 challenges + // +optional + PodTemplate *ACMEChallengeSolverHTTP01IngressPodTemplate `json:"podTemplate,omitempty"` +} + +type ACMEChallengeSolverHTTP01IngressPodTemplate struct { + // ObjectMeta overrides for the pod used to solve HTTP01 challenges. + // Only the 'labels' and 'annotations' fields may be set. + // If labels or annotations overlap with in-built values, the values here + // will override the in-built values. + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // PodSpec defines overrides for the HTTP01 challenge solver pod. + // Only the 'nodeSelector', 'affinity' and 'tolerations' fields are + // supported currently. All other fields will be ignored. + // +optional + Spec ACMEChallengeSolverHTTP01IngressPodSpec `json:"spec,omitempty"` +} + +type ACMEChallengeSolverHTTP01IngressPodSpec struct { + // NodeSelector is a selector which must be true for the pod to fit on a node. + // Selector which must match a node's labels for the pod to be scheduled on that node. + // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ + // +optional + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + + // If specified, the pod's scheduling constraints + // +optional + Affinity *corev1.Affinity `json:"affinity,omitempty"` + + // If specified, the pod's tolerations. + // +optional + Tolerations []corev1.Toleration `json:"tolerations,omitempty"` +} + +type ACMEChallengeSolverDNS01 struct { + // CNAMEStrategy configures how the DNS01 provider should handle CNAME + // records when found in DNS zones. + // +optional + CNAMEStrategy CNAMEStrategy `json:"cnameStrategy,omitempty"` + + // +optional + Akamai *ACMEIssuerDNS01ProviderAkamai `json:"akamai,omitempty"` + + // +optional + CloudDNS *ACMEIssuerDNS01ProviderCloudDNS `json:"clouddns,omitempty"` + + // +optional + Cloudflare *ACMEIssuerDNS01ProviderCloudflare `json:"cloudflare,omitempty"` + + // +optional + Route53 *ACMEIssuerDNS01ProviderRoute53 `json:"route53,omitempty"` + + // +optional + AzureDNS *ACMEIssuerDNS01ProviderAzureDNS `json:"azuredns,omitempty"` + + // +optional + DigitalOcean *ACMEIssuerDNS01ProviderDigitalOcean `json:"digitalocean,omitempty"` + + // +optional + AcmeDNS *ACMEIssuerDNS01ProviderAcmeDNS `json:"acmedns,omitempty"` + + // +optional + RFC2136 *ACMEIssuerDNS01ProviderRFC2136 `json:"rfc2136,omitempty"` + + // +optional + Webhook *ACMEIssuerDNS01ProviderWebhook `json:"webhook,omitempty"` +} + +// CNAMEStrategy configures how the DNS01 provider should handle CNAME records +// when found in DNS zones. +// By default, the None strategy will be applied (i.e. do not follow CNAMEs). +// +kubebuilder:validation:Enum=None;Follow +type CNAMEStrategy string + +const ( + // NoneStrategy indicates that no CNAME resolution strategy should be used + // when determining which DNS zone to update during DNS01 challenges. + NoneStrategy = "None" + + // FollowStrategy will cause cert-manager to recurse through CNAMEs in + // order to determine which DNS zone to update during DNS01 challenges. + // This is useful if you do not want to grant cert-manager access to your + // root DNS zone, and instead delegate the _acme-challenge.example.com + // subdomain to some other, less privileged domain. + FollowStrategy = "Follow" +) + +// ACMEIssuerDNS01ProviderAkamai is a structure containing the DNS +// configuration for Akamai DNS—Zone Record Management API +type ACMEIssuerDNS01ProviderAkamai struct { + ServiceConsumerDomain string `json:"serviceConsumerDomain"` + ClientToken cmmeta.SecretKeySelector `json:"clientTokenSecretRef"` + ClientSecret cmmeta.SecretKeySelector `json:"clientSecretSecretRef"` + AccessToken cmmeta.SecretKeySelector `json:"accessTokenSecretRef"` +} + +// ACMEIssuerDNS01ProviderCloudDNS is a structure containing the DNS +// configuration for Google Cloud DNS +type ACMEIssuerDNS01ProviderCloudDNS struct { + ServiceAccount cmmeta.SecretKeySelector `json:"serviceAccountSecretRef"` + Project string `json:"project"` +} + +// ACMEIssuerDNS01ProviderCloudflare is a structure containing the DNS +// configuration for Cloudflare +type ACMEIssuerDNS01ProviderCloudflare struct { + Email string `json:"email"` + APIKey cmmeta.SecretKeySelector `json:"apiKeySecretRef"` +} + +// ACMEIssuerDNS01ProviderDigitalOcean is a structure containing the DNS +// configuration for DigitalOcean Domains +type ACMEIssuerDNS01ProviderDigitalOcean struct { + Token cmmeta.SecretKeySelector `json:"tokenSecretRef"` +} + +// ACMEIssuerDNS01ProviderRoute53 is a structure containing the Route 53 +// configuration for AWS +type ACMEIssuerDNS01ProviderRoute53 struct { + // The AccessKeyID is used for authentication. If not set we fall-back to using env vars, shared credentials file or AWS Instance metadata + // see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials + // +optional + AccessKeyID string `json:"accessKeyID"` + + // The SecretAccessKey is used for authentication. If not set we fall-back to using env vars, shared credentials file or AWS Instance metadata + // https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials + // +optional + SecretAccessKey cmmeta.SecretKeySelector `json:"secretAccessKeySecretRef"` + + // Role is a Role ARN which the Route53 provider will assume using either the explicit credentials AccessKeyID/SecretAccessKey + // or the inferred credentials from environment variables, shared credentials file or AWS Instance metadata + // +optional + Role string `json:"role"` + + // If set, the provider will manage only this zone in Route53 and will not do an lookup using the route53:ListHostedZonesByName api call. + // +optional + HostedZoneID string `json:"hostedZoneID,omitempty"` + + // Always set the region when using AccessKeyID and SecretAccessKey + Region string `json:"region"` +} + +// ACMEIssuerDNS01ProviderAzureDNS is a structure containing the +// configuration for Azure DNS +type ACMEIssuerDNS01ProviderAzureDNS struct { + ClientID string `json:"clientID"` + + ClientSecret cmmeta.SecretKeySelector `json:"clientSecretSecretRef"` + + SubscriptionID string `json:"subscriptionID"` + + TenantID string `json:"tenantID"` + + ResourceGroupName string `json:"resourceGroupName"` + + // +optional + HostedZoneName string `json:"hostedZoneName,omitempty"` + + // +optional + Environment AzureDNSEnvironment `json:"environment,omitempty"` +} + +// +kubebuilder:validation:Enum=AzurePublicCloud;AzureChinaCloud;AzureGermanCloud;AzureUSGovernmentCloud +type AzureDNSEnvironment string + +const ( + AzurePublicCloud AzureDNSEnvironment = "AzurePublicCloud" + AzureChinaCloud AzureDNSEnvironment = "AzureChinaCloud" + AzureGermanCloud AzureDNSEnvironment = "AzureGermanCloud" + AzureUSGovernmentCloud AzureDNSEnvironment = "AzureUSGovernmentCloud" +) + +// ACMEIssuerDNS01ProviderAcmeDNS is a structure containing the +// configuration for ACME-DNS servers +type ACMEIssuerDNS01ProviderAcmeDNS struct { + Host string `json:"host"` + + AccountSecret cmmeta.SecretKeySelector `json:"accountSecretRef"` +} + +// ACMEIssuerDNS01ProviderRFC2136 is a structure containing the +// configuration for RFC2136 DNS +type ACMEIssuerDNS01ProviderRFC2136 struct { + // The IP address of the DNS supporting RFC2136. Required. + // Note: FQDN is not a valid value, only IP. + Nameserver string `json:"nameserver"` + + // The name of the secret containing the TSIG value. + // If ``tsigKeyName`` is defined, this field is required. + // +optional + TSIGSecret cmmeta.SecretKeySelector `json:"tsigSecretSecretRef,omitempty"` + + // The TSIG Key name configured in the DNS. + // If ``tsigSecretSecretRef`` is defined, this field is required. + // +optional + TSIGKeyName string `json:"tsigKeyName,omitempty"` + + // The TSIG Algorithm configured in the DNS supporting RFC2136. Used only + // when ``tsigSecretSecretRef`` and ``tsigKeyName`` are defined. + // Supported values are (case-insensitive): ``HMACMD5`` (default), + // ``HMACSHA1``, ``HMACSHA256`` or ``HMACSHA512``. + // +optional + TSIGAlgorithm string `json:"tsigAlgorithm,omitempty"` +} + +// ACMEIssuerDNS01ProviderWebhook specifies configuration for a webhook DNS01 +// provider, including where to POST ChallengePayload resources. +type ACMEIssuerDNS01ProviderWebhook struct { + // The API group name that should be used when POSTing ChallengePayload + // resources to the webhook apiserver. + // This should be the same as the GroupName specified in the webhook + // provider implementation. + GroupName string `json:"groupName"` + + // The name of the solver to use, as defined in the webhook provider + // implementation. + // This will typically be the name of the provider, e.g. 'cloudflare'. + SolverName string `json:"solverName"` + + // Additional configuration that should be passed to the webhook apiserver + // when challenges are processed. + // This can contain arbitrary JSON data. + // Secret values should not be specified in this stanza. + // If secret values are needed (e.g. credentials for a DNS service), you + // should use a cmmeta.SecretKeySelector to reference a Secret resource. + // For details on the schema of this field, consult the webhook provider + // implementation's documentation. + // +optional + Config *apiext.JSON `json:"config,omitempty"` +} + +type ACMEIssuerStatus struct { + // URI is the unique account identifier, which can also be used to retrieve + // account details from the CA + // +optional + URI string `json:"uri,omitempty"` + + // LastRegisteredEmail is the email associated with the latest registered + // ACME account, in order to track changes made to registered account + // associated with the Issuer + // +optional + LastRegisteredEmail string `json:"lastRegisteredEmail,omitempty"` +} diff --git a/pkg/internal/apis/certmanager/types_order.go b/pkg/internal/apis/acme/types_order.go similarity index 99% rename from pkg/internal/apis/certmanager/types_order.go rename to pkg/internal/apis/acme/types_order.go index 6157ecc3c5b..1a8c89cb4b5 100644 --- a/pkg/internal/apis/certmanager/types_order.go +++ b/pkg/internal/apis/acme/types_order.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package certmanager +package acme import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/internal/apis/acme/v1alpha2/BUILD.bazel b/pkg/internal/apis/acme/v1alpha2/BUILD.bazel new file mode 100644 index 00000000000..7a65f43a036 --- /dev/null +++ b/pkg/internal/apis/acme/v1alpha2/BUILD.bazel @@ -0,0 +1,39 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "defaults.go", + "doc.go", + "register.go", + "zz_generated.conversion.go", + "zz_generated.defaults.go", + ], + importpath = "github.com/jetstack/cert-manager/pkg/internal/apis/acme/v1alpha2", + visibility = ["//pkg:__subpackages__"], + deps = [ + "//pkg/apis/acme:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", + "//pkg/internal/apis/acme:go_default_library", + "//vendor/k8s.io/api/core/v1:go_default_library", + "//vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/conversion:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/pkg/internal/apis/acme/v1alpha2/defaults.go b/pkg/internal/apis/acme/v1alpha2/defaults.go new file mode 100644 index 00000000000..49faf65b1fb --- /dev/null +++ b/pkg/internal/apis/acme/v1alpha2/defaults.go @@ -0,0 +1,25 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha2 + +import ( + "k8s.io/apimachinery/pkg/runtime" +) + +func addDefaultingFuncs(scheme *runtime.Scheme) error { + return RegisterDefaults(scheme) +} diff --git a/pkg/internal/apis/acme/v1alpha2/doc.go b/pkg/internal/apis/acme/v1alpha2/doc.go new file mode 100644 index 00000000000..138300080ad --- /dev/null +++ b/pkg/internal/apis/acme/v1alpha2/doc.go @@ -0,0 +1,23 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:conversion-gen=github.com/jetstack/cert-manager/pkg/internal/apis/acme +// +k8s:conversion-gen-external-types=github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2 +// +k8s:defaulter-gen=TypeMeta +// +k8s:defaulter-gen-input=../../../../apis/acme/v1alpha2 + +// +groupName=acme.cert-manager.io +package v1alpha2 diff --git a/pkg/internal/apis/acme/v1alpha2/register.go b/pkg/internal/apis/acme/v1alpha2/register.go new file mode 100644 index 00000000000..20d9343e446 --- /dev/null +++ b/pkg/internal/apis/acme/v1alpha2/register.go @@ -0,0 +1,44 @@ +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha2 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/jetstack/cert-manager/pkg/apis/acme" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" +) + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: acme.GroupName, Version: "v1alpha2"} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + localSchemeBuilder = &cmacme.SchemeBuilder + AddToScheme = localSchemeBuilder.AddToScheme +) + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addDefaultingFuncs) +} diff --git a/pkg/internal/apis/acme/v1alpha2/zz_generated.conversion.go b/pkg/internal/apis/acme/v1alpha2/zz_generated.conversion.go new file mode 100644 index 00000000000..e547c7ba105 --- /dev/null +++ b/pkg/internal/apis/acme/v1alpha2/zz_generated.conversion.go @@ -0,0 +1,1153 @@ +// +build !ignore_autogenerated + +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by conversion-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + unsafe "unsafe" + + v1alpha2 "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" + acme "github.com/jetstack/cert-manager/pkg/internal/apis/acme" + v1 "k8s.io/api/core/v1" + v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +func init() { + localSchemeBuilder.Register(RegisterConversions) +} + +// RegisterConversions adds conversion functions to the given scheme. +// Public to allow building arbitrary schemes. +func RegisterConversions(s *runtime.Scheme) error { + if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEAuthorization)(nil), (*acme.ACMEAuthorization)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ACMEAuthorization_To_acme_ACMEAuthorization(a.(*v1alpha2.ACMEAuthorization), b.(*acme.ACMEAuthorization), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ACMEAuthorization)(nil), (*v1alpha2.ACMEAuthorization)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ACMEAuthorization_To_v1alpha2_ACMEAuthorization(a.(*acme.ACMEAuthorization), b.(*v1alpha2.ACMEAuthorization), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEChallenge)(nil), (*acme.ACMEChallenge)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ACMEChallenge_To_acme_ACMEChallenge(a.(*v1alpha2.ACMEChallenge), b.(*acme.ACMEChallenge), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ACMEChallenge)(nil), (*v1alpha2.ACMEChallenge)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ACMEChallenge_To_v1alpha2_ACMEChallenge(a.(*acme.ACMEChallenge), b.(*v1alpha2.ACMEChallenge), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEChallengeSolver)(nil), (*acme.ACMEChallengeSolver)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ACMEChallengeSolver_To_acme_ACMEChallengeSolver(a.(*v1alpha2.ACMEChallengeSolver), b.(*acme.ACMEChallengeSolver), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ACMEChallengeSolver)(nil), (*v1alpha2.ACMEChallengeSolver)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ACMEChallengeSolver_To_v1alpha2_ACMEChallengeSolver(a.(*acme.ACMEChallengeSolver), b.(*v1alpha2.ACMEChallengeSolver), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEChallengeSolverDNS01)(nil), (*acme.ACMEChallengeSolverDNS01)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ACMEChallengeSolverDNS01_To_acme_ACMEChallengeSolverDNS01(a.(*v1alpha2.ACMEChallengeSolverDNS01), b.(*acme.ACMEChallengeSolverDNS01), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ACMEChallengeSolverDNS01)(nil), (*v1alpha2.ACMEChallengeSolverDNS01)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ACMEChallengeSolverDNS01_To_v1alpha2_ACMEChallengeSolverDNS01(a.(*acme.ACMEChallengeSolverDNS01), b.(*v1alpha2.ACMEChallengeSolverDNS01), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEChallengeSolverHTTP01)(nil), (*acme.ACMEChallengeSolverHTTP01)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ACMEChallengeSolverHTTP01_To_acme_ACMEChallengeSolverHTTP01(a.(*v1alpha2.ACMEChallengeSolverHTTP01), b.(*acme.ACMEChallengeSolverHTTP01), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ACMEChallengeSolverHTTP01)(nil), (*v1alpha2.ACMEChallengeSolverHTTP01)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ACMEChallengeSolverHTTP01_To_v1alpha2_ACMEChallengeSolverHTTP01(a.(*acme.ACMEChallengeSolverHTTP01), b.(*v1alpha2.ACMEChallengeSolverHTTP01), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEChallengeSolverHTTP01Ingress)(nil), (*acme.ACMEChallengeSolverHTTP01Ingress)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ACMEChallengeSolverHTTP01Ingress_To_acme_ACMEChallengeSolverHTTP01Ingress(a.(*v1alpha2.ACMEChallengeSolverHTTP01Ingress), b.(*acme.ACMEChallengeSolverHTTP01Ingress), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ACMEChallengeSolverHTTP01Ingress)(nil), (*v1alpha2.ACMEChallengeSolverHTTP01Ingress)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ACMEChallengeSolverHTTP01Ingress_To_v1alpha2_ACMEChallengeSolverHTTP01Ingress(a.(*acme.ACMEChallengeSolverHTTP01Ingress), b.(*v1alpha2.ACMEChallengeSolverHTTP01Ingress), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEChallengeSolverHTTP01IngressPodSpec)(nil), (*acme.ACMEChallengeSolverHTTP01IngressPodSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec_To_acme_ACMEChallengeSolverHTTP01IngressPodSpec(a.(*v1alpha2.ACMEChallengeSolverHTTP01IngressPodSpec), b.(*acme.ACMEChallengeSolverHTTP01IngressPodSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ACMEChallengeSolverHTTP01IngressPodSpec)(nil), (*v1alpha2.ACMEChallengeSolverHTTP01IngressPodSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ACMEChallengeSolverHTTP01IngressPodSpec_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec(a.(*acme.ACMEChallengeSolverHTTP01IngressPodSpec), b.(*v1alpha2.ACMEChallengeSolverHTTP01IngressPodSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate)(nil), (*acme.ACMEChallengeSolverHTTP01IngressPodTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodTemplate_To_acme_ACMEChallengeSolverHTTP01IngressPodTemplate(a.(*v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate), b.(*acme.ACMEChallengeSolverHTTP01IngressPodTemplate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ACMEChallengeSolverHTTP01IngressPodTemplate)(nil), (*v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ACMEChallengeSolverHTTP01IngressPodTemplate_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodTemplate(a.(*acme.ACMEChallengeSolverHTTP01IngressPodTemplate), b.(*v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuer)(nil), (*acme.ACMEIssuer)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ACMEIssuer_To_acme_ACMEIssuer(a.(*v1alpha2.ACMEIssuer), b.(*acme.ACMEIssuer), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ACMEIssuer)(nil), (*v1alpha2.ACMEIssuer)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ACMEIssuer_To_v1alpha2_ACMEIssuer(a.(*acme.ACMEIssuer), b.(*v1alpha2.ACMEIssuer), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuerDNS01ProviderAcmeDNS)(nil), (*acme.ACMEIssuerDNS01ProviderAcmeDNS)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ACMEIssuerDNS01ProviderAcmeDNS_To_acme_ACMEIssuerDNS01ProviderAcmeDNS(a.(*v1alpha2.ACMEIssuerDNS01ProviderAcmeDNS), b.(*acme.ACMEIssuerDNS01ProviderAcmeDNS), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ACMEIssuerDNS01ProviderAcmeDNS)(nil), (*v1alpha2.ACMEIssuerDNS01ProviderAcmeDNS)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ACMEIssuerDNS01ProviderAcmeDNS_To_v1alpha2_ACMEIssuerDNS01ProviderAcmeDNS(a.(*acme.ACMEIssuerDNS01ProviderAcmeDNS), b.(*v1alpha2.ACMEIssuerDNS01ProviderAcmeDNS), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuerDNS01ProviderAkamai)(nil), (*acme.ACMEIssuerDNS01ProviderAkamai)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ACMEIssuerDNS01ProviderAkamai_To_acme_ACMEIssuerDNS01ProviderAkamai(a.(*v1alpha2.ACMEIssuerDNS01ProviderAkamai), b.(*acme.ACMEIssuerDNS01ProviderAkamai), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ACMEIssuerDNS01ProviderAkamai)(nil), (*v1alpha2.ACMEIssuerDNS01ProviderAkamai)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ACMEIssuerDNS01ProviderAkamai_To_v1alpha2_ACMEIssuerDNS01ProviderAkamai(a.(*acme.ACMEIssuerDNS01ProviderAkamai), b.(*v1alpha2.ACMEIssuerDNS01ProviderAkamai), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuerDNS01ProviderAzureDNS)(nil), (*acme.ACMEIssuerDNS01ProviderAzureDNS)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ACMEIssuerDNS01ProviderAzureDNS_To_acme_ACMEIssuerDNS01ProviderAzureDNS(a.(*v1alpha2.ACMEIssuerDNS01ProviderAzureDNS), b.(*acme.ACMEIssuerDNS01ProviderAzureDNS), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ACMEIssuerDNS01ProviderAzureDNS)(nil), (*v1alpha2.ACMEIssuerDNS01ProviderAzureDNS)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ACMEIssuerDNS01ProviderAzureDNS_To_v1alpha2_ACMEIssuerDNS01ProviderAzureDNS(a.(*acme.ACMEIssuerDNS01ProviderAzureDNS), b.(*v1alpha2.ACMEIssuerDNS01ProviderAzureDNS), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuerDNS01ProviderCloudDNS)(nil), (*acme.ACMEIssuerDNS01ProviderCloudDNS)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ACMEIssuerDNS01ProviderCloudDNS_To_acme_ACMEIssuerDNS01ProviderCloudDNS(a.(*v1alpha2.ACMEIssuerDNS01ProviderCloudDNS), b.(*acme.ACMEIssuerDNS01ProviderCloudDNS), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ACMEIssuerDNS01ProviderCloudDNS)(nil), (*v1alpha2.ACMEIssuerDNS01ProviderCloudDNS)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ACMEIssuerDNS01ProviderCloudDNS_To_v1alpha2_ACMEIssuerDNS01ProviderCloudDNS(a.(*acme.ACMEIssuerDNS01ProviderCloudDNS), b.(*v1alpha2.ACMEIssuerDNS01ProviderCloudDNS), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuerDNS01ProviderCloudflare)(nil), (*acme.ACMEIssuerDNS01ProviderCloudflare)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ACMEIssuerDNS01ProviderCloudflare_To_acme_ACMEIssuerDNS01ProviderCloudflare(a.(*v1alpha2.ACMEIssuerDNS01ProviderCloudflare), b.(*acme.ACMEIssuerDNS01ProviderCloudflare), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ACMEIssuerDNS01ProviderCloudflare)(nil), (*v1alpha2.ACMEIssuerDNS01ProviderCloudflare)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ACMEIssuerDNS01ProviderCloudflare_To_v1alpha2_ACMEIssuerDNS01ProviderCloudflare(a.(*acme.ACMEIssuerDNS01ProviderCloudflare), b.(*v1alpha2.ACMEIssuerDNS01ProviderCloudflare), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuerDNS01ProviderDigitalOcean)(nil), (*acme.ACMEIssuerDNS01ProviderDigitalOcean)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ACMEIssuerDNS01ProviderDigitalOcean_To_acme_ACMEIssuerDNS01ProviderDigitalOcean(a.(*v1alpha2.ACMEIssuerDNS01ProviderDigitalOcean), b.(*acme.ACMEIssuerDNS01ProviderDigitalOcean), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ACMEIssuerDNS01ProviderDigitalOcean)(nil), (*v1alpha2.ACMEIssuerDNS01ProviderDigitalOcean)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ACMEIssuerDNS01ProviderDigitalOcean_To_v1alpha2_ACMEIssuerDNS01ProviderDigitalOcean(a.(*acme.ACMEIssuerDNS01ProviderDigitalOcean), b.(*v1alpha2.ACMEIssuerDNS01ProviderDigitalOcean), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuerDNS01ProviderRFC2136)(nil), (*acme.ACMEIssuerDNS01ProviderRFC2136)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ACMEIssuerDNS01ProviderRFC2136_To_acme_ACMEIssuerDNS01ProviderRFC2136(a.(*v1alpha2.ACMEIssuerDNS01ProviderRFC2136), b.(*acme.ACMEIssuerDNS01ProviderRFC2136), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ACMEIssuerDNS01ProviderRFC2136)(nil), (*v1alpha2.ACMEIssuerDNS01ProviderRFC2136)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ACMEIssuerDNS01ProviderRFC2136_To_v1alpha2_ACMEIssuerDNS01ProviderRFC2136(a.(*acme.ACMEIssuerDNS01ProviderRFC2136), b.(*v1alpha2.ACMEIssuerDNS01ProviderRFC2136), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuerDNS01ProviderRoute53)(nil), (*acme.ACMEIssuerDNS01ProviderRoute53)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ACMEIssuerDNS01ProviderRoute53_To_acme_ACMEIssuerDNS01ProviderRoute53(a.(*v1alpha2.ACMEIssuerDNS01ProviderRoute53), b.(*acme.ACMEIssuerDNS01ProviderRoute53), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ACMEIssuerDNS01ProviderRoute53)(nil), (*v1alpha2.ACMEIssuerDNS01ProviderRoute53)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ACMEIssuerDNS01ProviderRoute53_To_v1alpha2_ACMEIssuerDNS01ProviderRoute53(a.(*acme.ACMEIssuerDNS01ProviderRoute53), b.(*v1alpha2.ACMEIssuerDNS01ProviderRoute53), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuerDNS01ProviderWebhook)(nil), (*acme.ACMEIssuerDNS01ProviderWebhook)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ACMEIssuerDNS01ProviderWebhook_To_acme_ACMEIssuerDNS01ProviderWebhook(a.(*v1alpha2.ACMEIssuerDNS01ProviderWebhook), b.(*acme.ACMEIssuerDNS01ProviderWebhook), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ACMEIssuerDNS01ProviderWebhook)(nil), (*v1alpha2.ACMEIssuerDNS01ProviderWebhook)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ACMEIssuerDNS01ProviderWebhook_To_v1alpha2_ACMEIssuerDNS01ProviderWebhook(a.(*acme.ACMEIssuerDNS01ProviderWebhook), b.(*v1alpha2.ACMEIssuerDNS01ProviderWebhook), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuerStatus)(nil), (*acme.ACMEIssuerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ACMEIssuerStatus_To_acme_ACMEIssuerStatus(a.(*v1alpha2.ACMEIssuerStatus), b.(*acme.ACMEIssuerStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ACMEIssuerStatus)(nil), (*v1alpha2.ACMEIssuerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ACMEIssuerStatus_To_v1alpha2_ACMEIssuerStatus(a.(*acme.ACMEIssuerStatus), b.(*v1alpha2.ACMEIssuerStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.CertificateDNSNameSelector)(nil), (*acme.CertificateDNSNameSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_CertificateDNSNameSelector_To_acme_CertificateDNSNameSelector(a.(*v1alpha2.CertificateDNSNameSelector), b.(*acme.CertificateDNSNameSelector), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.CertificateDNSNameSelector)(nil), (*v1alpha2.CertificateDNSNameSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_CertificateDNSNameSelector_To_v1alpha2_CertificateDNSNameSelector(a.(*acme.CertificateDNSNameSelector), b.(*v1alpha2.CertificateDNSNameSelector), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.Challenge)(nil), (*acme.Challenge)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_Challenge_To_acme_Challenge(a.(*v1alpha2.Challenge), b.(*acme.Challenge), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.Challenge)(nil), (*v1alpha2.Challenge)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_Challenge_To_v1alpha2_Challenge(a.(*acme.Challenge), b.(*v1alpha2.Challenge), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.ChallengeList)(nil), (*acme.ChallengeList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ChallengeList_To_acme_ChallengeList(a.(*v1alpha2.ChallengeList), b.(*acme.ChallengeList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ChallengeList)(nil), (*v1alpha2.ChallengeList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ChallengeList_To_v1alpha2_ChallengeList(a.(*acme.ChallengeList), b.(*v1alpha2.ChallengeList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.ChallengeSpec)(nil), (*acme.ChallengeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ChallengeSpec_To_acme_ChallengeSpec(a.(*v1alpha2.ChallengeSpec), b.(*acme.ChallengeSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ChallengeSpec)(nil), (*v1alpha2.ChallengeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ChallengeSpec_To_v1alpha2_ChallengeSpec(a.(*acme.ChallengeSpec), b.(*v1alpha2.ChallengeSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.ChallengeStatus)(nil), (*acme.ChallengeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ChallengeStatus_To_acme_ChallengeStatus(a.(*v1alpha2.ChallengeStatus), b.(*acme.ChallengeStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.ChallengeStatus)(nil), (*v1alpha2.ChallengeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_ChallengeStatus_To_v1alpha2_ChallengeStatus(a.(*acme.ChallengeStatus), b.(*v1alpha2.ChallengeStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.Order)(nil), (*acme.Order)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_Order_To_acme_Order(a.(*v1alpha2.Order), b.(*acme.Order), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.Order)(nil), (*v1alpha2.Order)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_Order_To_v1alpha2_Order(a.(*acme.Order), b.(*v1alpha2.Order), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.OrderList)(nil), (*acme.OrderList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_OrderList_To_acme_OrderList(a.(*v1alpha2.OrderList), b.(*acme.OrderList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.OrderList)(nil), (*v1alpha2.OrderList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_OrderList_To_v1alpha2_OrderList(a.(*acme.OrderList), b.(*v1alpha2.OrderList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.OrderSpec)(nil), (*acme.OrderSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_OrderSpec_To_acme_OrderSpec(a.(*v1alpha2.OrderSpec), b.(*acme.OrderSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.OrderSpec)(nil), (*v1alpha2.OrderSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_OrderSpec_To_v1alpha2_OrderSpec(a.(*acme.OrderSpec), b.(*v1alpha2.OrderSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.OrderStatus)(nil), (*acme.OrderStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_OrderStatus_To_acme_OrderStatus(a.(*v1alpha2.OrderStatus), b.(*acme.OrderStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*acme.OrderStatus)(nil), (*v1alpha2.OrderStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_acme_OrderStatus_To_v1alpha2_OrderStatus(a.(*acme.OrderStatus), b.(*v1alpha2.OrderStatus), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1alpha2_ACMEAuthorization_To_acme_ACMEAuthorization(in *v1alpha2.ACMEAuthorization, out *acme.ACMEAuthorization, s conversion.Scope) error { + out.URL = in.URL + out.Identifier = in.Identifier + out.Wildcard = in.Wildcard + out.Challenges = *(*[]acme.ACMEChallenge)(unsafe.Pointer(&in.Challenges)) + return nil +} + +// Convert_v1alpha2_ACMEAuthorization_To_acme_ACMEAuthorization is an autogenerated conversion function. +func Convert_v1alpha2_ACMEAuthorization_To_acme_ACMEAuthorization(in *v1alpha2.ACMEAuthorization, out *acme.ACMEAuthorization, s conversion.Scope) error { + return autoConvert_v1alpha2_ACMEAuthorization_To_acme_ACMEAuthorization(in, out, s) +} + +func autoConvert_acme_ACMEAuthorization_To_v1alpha2_ACMEAuthorization(in *acme.ACMEAuthorization, out *v1alpha2.ACMEAuthorization, s conversion.Scope) error { + out.URL = in.URL + out.Identifier = in.Identifier + out.Wildcard = in.Wildcard + out.Challenges = *(*[]v1alpha2.ACMEChallenge)(unsafe.Pointer(&in.Challenges)) + return nil +} + +// Convert_acme_ACMEAuthorization_To_v1alpha2_ACMEAuthorization is an autogenerated conversion function. +func Convert_acme_ACMEAuthorization_To_v1alpha2_ACMEAuthorization(in *acme.ACMEAuthorization, out *v1alpha2.ACMEAuthorization, s conversion.Scope) error { + return autoConvert_acme_ACMEAuthorization_To_v1alpha2_ACMEAuthorization(in, out, s) +} + +func autoConvert_v1alpha2_ACMEChallenge_To_acme_ACMEChallenge(in *v1alpha2.ACMEChallenge, out *acme.ACMEChallenge, s conversion.Scope) error { + out.URL = in.URL + out.Token = in.Token + out.Type = acme.ACMEChallengeType(in.Type) + return nil +} + +// Convert_v1alpha2_ACMEChallenge_To_acme_ACMEChallenge is an autogenerated conversion function. +func Convert_v1alpha2_ACMEChallenge_To_acme_ACMEChallenge(in *v1alpha2.ACMEChallenge, out *acme.ACMEChallenge, s conversion.Scope) error { + return autoConvert_v1alpha2_ACMEChallenge_To_acme_ACMEChallenge(in, out, s) +} + +func autoConvert_acme_ACMEChallenge_To_v1alpha2_ACMEChallenge(in *acme.ACMEChallenge, out *v1alpha2.ACMEChallenge, s conversion.Scope) error { + out.URL = in.URL + out.Token = in.Token + out.Type = v1alpha2.ACMEChallengeType(in.Type) + return nil +} + +// Convert_acme_ACMEChallenge_To_v1alpha2_ACMEChallenge is an autogenerated conversion function. +func Convert_acme_ACMEChallenge_To_v1alpha2_ACMEChallenge(in *acme.ACMEChallenge, out *v1alpha2.ACMEChallenge, s conversion.Scope) error { + return autoConvert_acme_ACMEChallenge_To_v1alpha2_ACMEChallenge(in, out, s) +} + +func autoConvert_v1alpha2_ACMEChallengeSolver_To_acme_ACMEChallengeSolver(in *v1alpha2.ACMEChallengeSolver, out *acme.ACMEChallengeSolver, s conversion.Scope) error { + out.Selector = (*acme.CertificateDNSNameSelector)(unsafe.Pointer(in.Selector)) + out.HTTP01 = (*acme.ACMEChallengeSolverHTTP01)(unsafe.Pointer(in.HTTP01)) + out.DNS01 = (*acme.ACMEChallengeSolverDNS01)(unsafe.Pointer(in.DNS01)) + return nil +} + +// Convert_v1alpha2_ACMEChallengeSolver_To_acme_ACMEChallengeSolver is an autogenerated conversion function. +func Convert_v1alpha2_ACMEChallengeSolver_To_acme_ACMEChallengeSolver(in *v1alpha2.ACMEChallengeSolver, out *acme.ACMEChallengeSolver, s conversion.Scope) error { + return autoConvert_v1alpha2_ACMEChallengeSolver_To_acme_ACMEChallengeSolver(in, out, s) +} + +func autoConvert_acme_ACMEChallengeSolver_To_v1alpha2_ACMEChallengeSolver(in *acme.ACMEChallengeSolver, out *v1alpha2.ACMEChallengeSolver, s conversion.Scope) error { + out.Selector = (*v1alpha2.CertificateDNSNameSelector)(unsafe.Pointer(in.Selector)) + out.HTTP01 = (*v1alpha2.ACMEChallengeSolverHTTP01)(unsafe.Pointer(in.HTTP01)) + out.DNS01 = (*v1alpha2.ACMEChallengeSolverDNS01)(unsafe.Pointer(in.DNS01)) + return nil +} + +// Convert_acme_ACMEChallengeSolver_To_v1alpha2_ACMEChallengeSolver is an autogenerated conversion function. +func Convert_acme_ACMEChallengeSolver_To_v1alpha2_ACMEChallengeSolver(in *acme.ACMEChallengeSolver, out *v1alpha2.ACMEChallengeSolver, s conversion.Scope) error { + return autoConvert_acme_ACMEChallengeSolver_To_v1alpha2_ACMEChallengeSolver(in, out, s) +} + +func autoConvert_v1alpha2_ACMEChallengeSolverDNS01_To_acme_ACMEChallengeSolverDNS01(in *v1alpha2.ACMEChallengeSolverDNS01, out *acme.ACMEChallengeSolverDNS01, s conversion.Scope) error { + out.CNAMEStrategy = acme.CNAMEStrategy(in.CNAMEStrategy) + out.Akamai = (*acme.ACMEIssuerDNS01ProviderAkamai)(unsafe.Pointer(in.Akamai)) + out.CloudDNS = (*acme.ACMEIssuerDNS01ProviderCloudDNS)(unsafe.Pointer(in.CloudDNS)) + out.Cloudflare = (*acme.ACMEIssuerDNS01ProviderCloudflare)(unsafe.Pointer(in.Cloudflare)) + out.Route53 = (*acme.ACMEIssuerDNS01ProviderRoute53)(unsafe.Pointer(in.Route53)) + out.AzureDNS = (*acme.ACMEIssuerDNS01ProviderAzureDNS)(unsafe.Pointer(in.AzureDNS)) + out.DigitalOcean = (*acme.ACMEIssuerDNS01ProviderDigitalOcean)(unsafe.Pointer(in.DigitalOcean)) + out.AcmeDNS = (*acme.ACMEIssuerDNS01ProviderAcmeDNS)(unsafe.Pointer(in.AcmeDNS)) + out.RFC2136 = (*acme.ACMEIssuerDNS01ProviderRFC2136)(unsafe.Pointer(in.RFC2136)) + out.Webhook = (*acme.ACMEIssuerDNS01ProviderWebhook)(unsafe.Pointer(in.Webhook)) + return nil +} + +// Convert_v1alpha2_ACMEChallengeSolverDNS01_To_acme_ACMEChallengeSolverDNS01 is an autogenerated conversion function. +func Convert_v1alpha2_ACMEChallengeSolverDNS01_To_acme_ACMEChallengeSolverDNS01(in *v1alpha2.ACMEChallengeSolverDNS01, out *acme.ACMEChallengeSolverDNS01, s conversion.Scope) error { + return autoConvert_v1alpha2_ACMEChallengeSolverDNS01_To_acme_ACMEChallengeSolverDNS01(in, out, s) +} + +func autoConvert_acme_ACMEChallengeSolverDNS01_To_v1alpha2_ACMEChallengeSolverDNS01(in *acme.ACMEChallengeSolverDNS01, out *v1alpha2.ACMEChallengeSolverDNS01, s conversion.Scope) error { + out.CNAMEStrategy = v1alpha2.CNAMEStrategy(in.CNAMEStrategy) + out.Akamai = (*v1alpha2.ACMEIssuerDNS01ProviderAkamai)(unsafe.Pointer(in.Akamai)) + out.CloudDNS = (*v1alpha2.ACMEIssuerDNS01ProviderCloudDNS)(unsafe.Pointer(in.CloudDNS)) + out.Cloudflare = (*v1alpha2.ACMEIssuerDNS01ProviderCloudflare)(unsafe.Pointer(in.Cloudflare)) + out.Route53 = (*v1alpha2.ACMEIssuerDNS01ProviderRoute53)(unsafe.Pointer(in.Route53)) + out.AzureDNS = (*v1alpha2.ACMEIssuerDNS01ProviderAzureDNS)(unsafe.Pointer(in.AzureDNS)) + out.DigitalOcean = (*v1alpha2.ACMEIssuerDNS01ProviderDigitalOcean)(unsafe.Pointer(in.DigitalOcean)) + out.AcmeDNS = (*v1alpha2.ACMEIssuerDNS01ProviderAcmeDNS)(unsafe.Pointer(in.AcmeDNS)) + out.RFC2136 = (*v1alpha2.ACMEIssuerDNS01ProviderRFC2136)(unsafe.Pointer(in.RFC2136)) + out.Webhook = (*v1alpha2.ACMEIssuerDNS01ProviderWebhook)(unsafe.Pointer(in.Webhook)) + return nil +} + +// Convert_acme_ACMEChallengeSolverDNS01_To_v1alpha2_ACMEChallengeSolverDNS01 is an autogenerated conversion function. +func Convert_acme_ACMEChallengeSolverDNS01_To_v1alpha2_ACMEChallengeSolverDNS01(in *acme.ACMEChallengeSolverDNS01, out *v1alpha2.ACMEChallengeSolverDNS01, s conversion.Scope) error { + return autoConvert_acme_ACMEChallengeSolverDNS01_To_v1alpha2_ACMEChallengeSolverDNS01(in, out, s) +} + +func autoConvert_v1alpha2_ACMEChallengeSolverHTTP01_To_acme_ACMEChallengeSolverHTTP01(in *v1alpha2.ACMEChallengeSolverHTTP01, out *acme.ACMEChallengeSolverHTTP01, s conversion.Scope) error { + out.Ingress = (*acme.ACMEChallengeSolverHTTP01Ingress)(unsafe.Pointer(in.Ingress)) + return nil +} + +// Convert_v1alpha2_ACMEChallengeSolverHTTP01_To_acme_ACMEChallengeSolverHTTP01 is an autogenerated conversion function. +func Convert_v1alpha2_ACMEChallengeSolverHTTP01_To_acme_ACMEChallengeSolverHTTP01(in *v1alpha2.ACMEChallengeSolverHTTP01, out *acme.ACMEChallengeSolverHTTP01, s conversion.Scope) error { + return autoConvert_v1alpha2_ACMEChallengeSolverHTTP01_To_acme_ACMEChallengeSolverHTTP01(in, out, s) +} + +func autoConvert_acme_ACMEChallengeSolverHTTP01_To_v1alpha2_ACMEChallengeSolverHTTP01(in *acme.ACMEChallengeSolverHTTP01, out *v1alpha2.ACMEChallengeSolverHTTP01, s conversion.Scope) error { + out.Ingress = (*v1alpha2.ACMEChallengeSolverHTTP01Ingress)(unsafe.Pointer(in.Ingress)) + return nil +} + +// Convert_acme_ACMEChallengeSolverHTTP01_To_v1alpha2_ACMEChallengeSolverHTTP01 is an autogenerated conversion function. +func Convert_acme_ACMEChallengeSolverHTTP01_To_v1alpha2_ACMEChallengeSolverHTTP01(in *acme.ACMEChallengeSolverHTTP01, out *v1alpha2.ACMEChallengeSolverHTTP01, s conversion.Scope) error { + return autoConvert_acme_ACMEChallengeSolverHTTP01_To_v1alpha2_ACMEChallengeSolverHTTP01(in, out, s) +} + +func autoConvert_v1alpha2_ACMEChallengeSolverHTTP01Ingress_To_acme_ACMEChallengeSolverHTTP01Ingress(in *v1alpha2.ACMEChallengeSolverHTTP01Ingress, out *acme.ACMEChallengeSolverHTTP01Ingress, s conversion.Scope) error { + out.ServiceType = v1.ServiceType(in.ServiceType) + out.Class = (*string)(unsafe.Pointer(in.Class)) + out.Name = in.Name + out.PodTemplate = (*acme.ACMEChallengeSolverHTTP01IngressPodTemplate)(unsafe.Pointer(in.PodTemplate)) + return nil +} + +// Convert_v1alpha2_ACMEChallengeSolverHTTP01Ingress_To_acme_ACMEChallengeSolverHTTP01Ingress is an autogenerated conversion function. +func Convert_v1alpha2_ACMEChallengeSolverHTTP01Ingress_To_acme_ACMEChallengeSolverHTTP01Ingress(in *v1alpha2.ACMEChallengeSolverHTTP01Ingress, out *acme.ACMEChallengeSolverHTTP01Ingress, s conversion.Scope) error { + return autoConvert_v1alpha2_ACMEChallengeSolverHTTP01Ingress_To_acme_ACMEChallengeSolverHTTP01Ingress(in, out, s) +} + +func autoConvert_acme_ACMEChallengeSolverHTTP01Ingress_To_v1alpha2_ACMEChallengeSolverHTTP01Ingress(in *acme.ACMEChallengeSolverHTTP01Ingress, out *v1alpha2.ACMEChallengeSolverHTTP01Ingress, s conversion.Scope) error { + out.ServiceType = v1.ServiceType(in.ServiceType) + out.Class = (*string)(unsafe.Pointer(in.Class)) + out.Name = in.Name + out.PodTemplate = (*v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate)(unsafe.Pointer(in.PodTemplate)) + return nil +} + +// Convert_acme_ACMEChallengeSolverHTTP01Ingress_To_v1alpha2_ACMEChallengeSolverHTTP01Ingress is an autogenerated conversion function. +func Convert_acme_ACMEChallengeSolverHTTP01Ingress_To_v1alpha2_ACMEChallengeSolverHTTP01Ingress(in *acme.ACMEChallengeSolverHTTP01Ingress, out *v1alpha2.ACMEChallengeSolverHTTP01Ingress, s conversion.Scope) error { + return autoConvert_acme_ACMEChallengeSolverHTTP01Ingress_To_v1alpha2_ACMEChallengeSolverHTTP01Ingress(in, out, s) +} + +func autoConvert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec_To_acme_ACMEChallengeSolverHTTP01IngressPodSpec(in *v1alpha2.ACMEChallengeSolverHTTP01IngressPodSpec, out *acme.ACMEChallengeSolverHTTP01IngressPodSpec, s conversion.Scope) error { + out.NodeSelector = *(*map[string]string)(unsafe.Pointer(&in.NodeSelector)) + out.Affinity = (*v1.Affinity)(unsafe.Pointer(in.Affinity)) + out.Tolerations = *(*[]v1.Toleration)(unsafe.Pointer(&in.Tolerations)) + return nil +} + +// Convert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec_To_acme_ACMEChallengeSolverHTTP01IngressPodSpec is an autogenerated conversion function. +func Convert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec_To_acme_ACMEChallengeSolverHTTP01IngressPodSpec(in *v1alpha2.ACMEChallengeSolverHTTP01IngressPodSpec, out *acme.ACMEChallengeSolverHTTP01IngressPodSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec_To_acme_ACMEChallengeSolverHTTP01IngressPodSpec(in, out, s) +} + +func autoConvert_acme_ACMEChallengeSolverHTTP01IngressPodSpec_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec(in *acme.ACMEChallengeSolverHTTP01IngressPodSpec, out *v1alpha2.ACMEChallengeSolverHTTP01IngressPodSpec, s conversion.Scope) error { + out.NodeSelector = *(*map[string]string)(unsafe.Pointer(&in.NodeSelector)) + out.Affinity = (*v1.Affinity)(unsafe.Pointer(in.Affinity)) + out.Tolerations = *(*[]v1.Toleration)(unsafe.Pointer(&in.Tolerations)) + return nil +} + +// Convert_acme_ACMEChallengeSolverHTTP01IngressPodSpec_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec is an autogenerated conversion function. +func Convert_acme_ACMEChallengeSolverHTTP01IngressPodSpec_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec(in *acme.ACMEChallengeSolverHTTP01IngressPodSpec, out *v1alpha2.ACMEChallengeSolverHTTP01IngressPodSpec, s conversion.Scope) error { + return autoConvert_acme_ACMEChallengeSolverHTTP01IngressPodSpec_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec(in, out, s) +} + +func autoConvert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodTemplate_To_acme_ACMEChallengeSolverHTTP01IngressPodTemplate(in *v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate, out *acme.ACMEChallengeSolverHTTP01IngressPodTemplate, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec_To_acme_ACMEChallengeSolverHTTP01IngressPodSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodTemplate_To_acme_ACMEChallengeSolverHTTP01IngressPodTemplate is an autogenerated conversion function. +func Convert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodTemplate_To_acme_ACMEChallengeSolverHTTP01IngressPodTemplate(in *v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate, out *acme.ACMEChallengeSolverHTTP01IngressPodTemplate, s conversion.Scope) error { + return autoConvert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodTemplate_To_acme_ACMEChallengeSolverHTTP01IngressPodTemplate(in, out, s) +} + +func autoConvert_acme_ACMEChallengeSolverHTTP01IngressPodTemplate_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodTemplate(in *acme.ACMEChallengeSolverHTTP01IngressPodTemplate, out *v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_acme_ACMEChallengeSolverHTTP01IngressPodSpec_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_acme_ACMEChallengeSolverHTTP01IngressPodTemplate_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodTemplate is an autogenerated conversion function. +func Convert_acme_ACMEChallengeSolverHTTP01IngressPodTemplate_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodTemplate(in *acme.ACMEChallengeSolverHTTP01IngressPodTemplate, out *v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate, s conversion.Scope) error { + return autoConvert_acme_ACMEChallengeSolverHTTP01IngressPodTemplate_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodTemplate(in, out, s) +} + +func autoConvert_v1alpha2_ACMEIssuer_To_acme_ACMEIssuer(in *v1alpha2.ACMEIssuer, out *acme.ACMEIssuer, s conversion.Scope) error { + out.Email = in.Email + out.Server = in.Server + out.SkipTLSVerify = in.SkipTLSVerify + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.PrivateKey, &out.PrivateKey, 0); err != nil { + return err + } + out.Solvers = *(*[]acme.ACMEChallengeSolver)(unsafe.Pointer(&in.Solvers)) + return nil +} + +// Convert_v1alpha2_ACMEIssuer_To_acme_ACMEIssuer is an autogenerated conversion function. +func Convert_v1alpha2_ACMEIssuer_To_acme_ACMEIssuer(in *v1alpha2.ACMEIssuer, out *acme.ACMEIssuer, s conversion.Scope) error { + return autoConvert_v1alpha2_ACMEIssuer_To_acme_ACMEIssuer(in, out, s) +} + +func autoConvert_acme_ACMEIssuer_To_v1alpha2_ACMEIssuer(in *acme.ACMEIssuer, out *v1alpha2.ACMEIssuer, s conversion.Scope) error { + out.Email = in.Email + out.Server = in.Server + out.SkipTLSVerify = in.SkipTLSVerify + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.PrivateKey, &out.PrivateKey, 0); err != nil { + return err + } + out.Solvers = *(*[]v1alpha2.ACMEChallengeSolver)(unsafe.Pointer(&in.Solvers)) + return nil +} + +// Convert_acme_ACMEIssuer_To_v1alpha2_ACMEIssuer is an autogenerated conversion function. +func Convert_acme_ACMEIssuer_To_v1alpha2_ACMEIssuer(in *acme.ACMEIssuer, out *v1alpha2.ACMEIssuer, s conversion.Scope) error { + return autoConvert_acme_ACMEIssuer_To_v1alpha2_ACMEIssuer(in, out, s) +} + +func autoConvert_v1alpha2_ACMEIssuerDNS01ProviderAcmeDNS_To_acme_ACMEIssuerDNS01ProviderAcmeDNS(in *v1alpha2.ACMEIssuerDNS01ProviderAcmeDNS, out *acme.ACMEIssuerDNS01ProviderAcmeDNS, s conversion.Scope) error { + out.Host = in.Host + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.AccountSecret, &out.AccountSecret, 0); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_ACMEIssuerDNS01ProviderAcmeDNS_To_acme_ACMEIssuerDNS01ProviderAcmeDNS is an autogenerated conversion function. +func Convert_v1alpha2_ACMEIssuerDNS01ProviderAcmeDNS_To_acme_ACMEIssuerDNS01ProviderAcmeDNS(in *v1alpha2.ACMEIssuerDNS01ProviderAcmeDNS, out *acme.ACMEIssuerDNS01ProviderAcmeDNS, s conversion.Scope) error { + return autoConvert_v1alpha2_ACMEIssuerDNS01ProviderAcmeDNS_To_acme_ACMEIssuerDNS01ProviderAcmeDNS(in, out, s) +} + +func autoConvert_acme_ACMEIssuerDNS01ProviderAcmeDNS_To_v1alpha2_ACMEIssuerDNS01ProviderAcmeDNS(in *acme.ACMEIssuerDNS01ProviderAcmeDNS, out *v1alpha2.ACMEIssuerDNS01ProviderAcmeDNS, s conversion.Scope) error { + out.Host = in.Host + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.AccountSecret, &out.AccountSecret, 0); err != nil { + return err + } + return nil +} + +// Convert_acme_ACMEIssuerDNS01ProviderAcmeDNS_To_v1alpha2_ACMEIssuerDNS01ProviderAcmeDNS is an autogenerated conversion function. +func Convert_acme_ACMEIssuerDNS01ProviderAcmeDNS_To_v1alpha2_ACMEIssuerDNS01ProviderAcmeDNS(in *acme.ACMEIssuerDNS01ProviderAcmeDNS, out *v1alpha2.ACMEIssuerDNS01ProviderAcmeDNS, s conversion.Scope) error { + return autoConvert_acme_ACMEIssuerDNS01ProviderAcmeDNS_To_v1alpha2_ACMEIssuerDNS01ProviderAcmeDNS(in, out, s) +} + +func autoConvert_v1alpha2_ACMEIssuerDNS01ProviderAkamai_To_acme_ACMEIssuerDNS01ProviderAkamai(in *v1alpha2.ACMEIssuerDNS01ProviderAkamai, out *acme.ACMEIssuerDNS01ProviderAkamai, s conversion.Scope) error { + out.ServiceConsumerDomain = in.ServiceConsumerDomain + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.ClientToken, &out.ClientToken, 0); err != nil { + return err + } + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.ClientSecret, &out.ClientSecret, 0); err != nil { + return err + } + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.AccessToken, &out.AccessToken, 0); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_ACMEIssuerDNS01ProviderAkamai_To_acme_ACMEIssuerDNS01ProviderAkamai is an autogenerated conversion function. +func Convert_v1alpha2_ACMEIssuerDNS01ProviderAkamai_To_acme_ACMEIssuerDNS01ProviderAkamai(in *v1alpha2.ACMEIssuerDNS01ProviderAkamai, out *acme.ACMEIssuerDNS01ProviderAkamai, s conversion.Scope) error { + return autoConvert_v1alpha2_ACMEIssuerDNS01ProviderAkamai_To_acme_ACMEIssuerDNS01ProviderAkamai(in, out, s) +} + +func autoConvert_acme_ACMEIssuerDNS01ProviderAkamai_To_v1alpha2_ACMEIssuerDNS01ProviderAkamai(in *acme.ACMEIssuerDNS01ProviderAkamai, out *v1alpha2.ACMEIssuerDNS01ProviderAkamai, s conversion.Scope) error { + out.ServiceConsumerDomain = in.ServiceConsumerDomain + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.ClientToken, &out.ClientToken, 0); err != nil { + return err + } + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.ClientSecret, &out.ClientSecret, 0); err != nil { + return err + } + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.AccessToken, &out.AccessToken, 0); err != nil { + return err + } + return nil +} + +// Convert_acme_ACMEIssuerDNS01ProviderAkamai_To_v1alpha2_ACMEIssuerDNS01ProviderAkamai is an autogenerated conversion function. +func Convert_acme_ACMEIssuerDNS01ProviderAkamai_To_v1alpha2_ACMEIssuerDNS01ProviderAkamai(in *acme.ACMEIssuerDNS01ProviderAkamai, out *v1alpha2.ACMEIssuerDNS01ProviderAkamai, s conversion.Scope) error { + return autoConvert_acme_ACMEIssuerDNS01ProviderAkamai_To_v1alpha2_ACMEIssuerDNS01ProviderAkamai(in, out, s) +} + +func autoConvert_v1alpha2_ACMEIssuerDNS01ProviderAzureDNS_To_acme_ACMEIssuerDNS01ProviderAzureDNS(in *v1alpha2.ACMEIssuerDNS01ProviderAzureDNS, out *acme.ACMEIssuerDNS01ProviderAzureDNS, s conversion.Scope) error { + out.ClientID = in.ClientID + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.ClientSecret, &out.ClientSecret, 0); err != nil { + return err + } + out.SubscriptionID = in.SubscriptionID + out.TenantID = in.TenantID + out.ResourceGroupName = in.ResourceGroupName + out.HostedZoneName = in.HostedZoneName + out.Environment = acme.AzureDNSEnvironment(in.Environment) + return nil +} + +// Convert_v1alpha2_ACMEIssuerDNS01ProviderAzureDNS_To_acme_ACMEIssuerDNS01ProviderAzureDNS is an autogenerated conversion function. +func Convert_v1alpha2_ACMEIssuerDNS01ProviderAzureDNS_To_acme_ACMEIssuerDNS01ProviderAzureDNS(in *v1alpha2.ACMEIssuerDNS01ProviderAzureDNS, out *acme.ACMEIssuerDNS01ProviderAzureDNS, s conversion.Scope) error { + return autoConvert_v1alpha2_ACMEIssuerDNS01ProviderAzureDNS_To_acme_ACMEIssuerDNS01ProviderAzureDNS(in, out, s) +} + +func autoConvert_acme_ACMEIssuerDNS01ProviderAzureDNS_To_v1alpha2_ACMEIssuerDNS01ProviderAzureDNS(in *acme.ACMEIssuerDNS01ProviderAzureDNS, out *v1alpha2.ACMEIssuerDNS01ProviderAzureDNS, s conversion.Scope) error { + out.ClientID = in.ClientID + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.ClientSecret, &out.ClientSecret, 0); err != nil { + return err + } + out.SubscriptionID = in.SubscriptionID + out.TenantID = in.TenantID + out.ResourceGroupName = in.ResourceGroupName + out.HostedZoneName = in.HostedZoneName + out.Environment = v1alpha2.AzureDNSEnvironment(in.Environment) + return nil +} + +// Convert_acme_ACMEIssuerDNS01ProviderAzureDNS_To_v1alpha2_ACMEIssuerDNS01ProviderAzureDNS is an autogenerated conversion function. +func Convert_acme_ACMEIssuerDNS01ProviderAzureDNS_To_v1alpha2_ACMEIssuerDNS01ProviderAzureDNS(in *acme.ACMEIssuerDNS01ProviderAzureDNS, out *v1alpha2.ACMEIssuerDNS01ProviderAzureDNS, s conversion.Scope) error { + return autoConvert_acme_ACMEIssuerDNS01ProviderAzureDNS_To_v1alpha2_ACMEIssuerDNS01ProviderAzureDNS(in, out, s) +} + +func autoConvert_v1alpha2_ACMEIssuerDNS01ProviderCloudDNS_To_acme_ACMEIssuerDNS01ProviderCloudDNS(in *v1alpha2.ACMEIssuerDNS01ProviderCloudDNS, out *acme.ACMEIssuerDNS01ProviderCloudDNS, s conversion.Scope) error { + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.ServiceAccount, &out.ServiceAccount, 0); err != nil { + return err + } + out.Project = in.Project + return nil +} + +// Convert_v1alpha2_ACMEIssuerDNS01ProviderCloudDNS_To_acme_ACMEIssuerDNS01ProviderCloudDNS is an autogenerated conversion function. +func Convert_v1alpha2_ACMEIssuerDNS01ProviderCloudDNS_To_acme_ACMEIssuerDNS01ProviderCloudDNS(in *v1alpha2.ACMEIssuerDNS01ProviderCloudDNS, out *acme.ACMEIssuerDNS01ProviderCloudDNS, s conversion.Scope) error { + return autoConvert_v1alpha2_ACMEIssuerDNS01ProviderCloudDNS_To_acme_ACMEIssuerDNS01ProviderCloudDNS(in, out, s) +} + +func autoConvert_acme_ACMEIssuerDNS01ProviderCloudDNS_To_v1alpha2_ACMEIssuerDNS01ProviderCloudDNS(in *acme.ACMEIssuerDNS01ProviderCloudDNS, out *v1alpha2.ACMEIssuerDNS01ProviderCloudDNS, s conversion.Scope) error { + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.ServiceAccount, &out.ServiceAccount, 0); err != nil { + return err + } + out.Project = in.Project + return nil +} + +// Convert_acme_ACMEIssuerDNS01ProviderCloudDNS_To_v1alpha2_ACMEIssuerDNS01ProviderCloudDNS is an autogenerated conversion function. +func Convert_acme_ACMEIssuerDNS01ProviderCloudDNS_To_v1alpha2_ACMEIssuerDNS01ProviderCloudDNS(in *acme.ACMEIssuerDNS01ProviderCloudDNS, out *v1alpha2.ACMEIssuerDNS01ProviderCloudDNS, s conversion.Scope) error { + return autoConvert_acme_ACMEIssuerDNS01ProviderCloudDNS_To_v1alpha2_ACMEIssuerDNS01ProviderCloudDNS(in, out, s) +} + +func autoConvert_v1alpha2_ACMEIssuerDNS01ProviderCloudflare_To_acme_ACMEIssuerDNS01ProviderCloudflare(in *v1alpha2.ACMEIssuerDNS01ProviderCloudflare, out *acme.ACMEIssuerDNS01ProviderCloudflare, s conversion.Scope) error { + out.Email = in.Email + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.APIKey, &out.APIKey, 0); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_ACMEIssuerDNS01ProviderCloudflare_To_acme_ACMEIssuerDNS01ProviderCloudflare is an autogenerated conversion function. +func Convert_v1alpha2_ACMEIssuerDNS01ProviderCloudflare_To_acme_ACMEIssuerDNS01ProviderCloudflare(in *v1alpha2.ACMEIssuerDNS01ProviderCloudflare, out *acme.ACMEIssuerDNS01ProviderCloudflare, s conversion.Scope) error { + return autoConvert_v1alpha2_ACMEIssuerDNS01ProviderCloudflare_To_acme_ACMEIssuerDNS01ProviderCloudflare(in, out, s) +} + +func autoConvert_acme_ACMEIssuerDNS01ProviderCloudflare_To_v1alpha2_ACMEIssuerDNS01ProviderCloudflare(in *acme.ACMEIssuerDNS01ProviderCloudflare, out *v1alpha2.ACMEIssuerDNS01ProviderCloudflare, s conversion.Scope) error { + out.Email = in.Email + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.APIKey, &out.APIKey, 0); err != nil { + return err + } + return nil +} + +// Convert_acme_ACMEIssuerDNS01ProviderCloudflare_To_v1alpha2_ACMEIssuerDNS01ProviderCloudflare is an autogenerated conversion function. +func Convert_acme_ACMEIssuerDNS01ProviderCloudflare_To_v1alpha2_ACMEIssuerDNS01ProviderCloudflare(in *acme.ACMEIssuerDNS01ProviderCloudflare, out *v1alpha2.ACMEIssuerDNS01ProviderCloudflare, s conversion.Scope) error { + return autoConvert_acme_ACMEIssuerDNS01ProviderCloudflare_To_v1alpha2_ACMEIssuerDNS01ProviderCloudflare(in, out, s) +} + +func autoConvert_v1alpha2_ACMEIssuerDNS01ProviderDigitalOcean_To_acme_ACMEIssuerDNS01ProviderDigitalOcean(in *v1alpha2.ACMEIssuerDNS01ProviderDigitalOcean, out *acme.ACMEIssuerDNS01ProviderDigitalOcean, s conversion.Scope) error { + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.Token, &out.Token, 0); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_ACMEIssuerDNS01ProviderDigitalOcean_To_acme_ACMEIssuerDNS01ProviderDigitalOcean is an autogenerated conversion function. +func Convert_v1alpha2_ACMEIssuerDNS01ProviderDigitalOcean_To_acme_ACMEIssuerDNS01ProviderDigitalOcean(in *v1alpha2.ACMEIssuerDNS01ProviderDigitalOcean, out *acme.ACMEIssuerDNS01ProviderDigitalOcean, s conversion.Scope) error { + return autoConvert_v1alpha2_ACMEIssuerDNS01ProviderDigitalOcean_To_acme_ACMEIssuerDNS01ProviderDigitalOcean(in, out, s) +} + +func autoConvert_acme_ACMEIssuerDNS01ProviderDigitalOcean_To_v1alpha2_ACMEIssuerDNS01ProviderDigitalOcean(in *acme.ACMEIssuerDNS01ProviderDigitalOcean, out *v1alpha2.ACMEIssuerDNS01ProviderDigitalOcean, s conversion.Scope) error { + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.Token, &out.Token, 0); err != nil { + return err + } + return nil +} + +// Convert_acme_ACMEIssuerDNS01ProviderDigitalOcean_To_v1alpha2_ACMEIssuerDNS01ProviderDigitalOcean is an autogenerated conversion function. +func Convert_acme_ACMEIssuerDNS01ProviderDigitalOcean_To_v1alpha2_ACMEIssuerDNS01ProviderDigitalOcean(in *acme.ACMEIssuerDNS01ProviderDigitalOcean, out *v1alpha2.ACMEIssuerDNS01ProviderDigitalOcean, s conversion.Scope) error { + return autoConvert_acme_ACMEIssuerDNS01ProviderDigitalOcean_To_v1alpha2_ACMEIssuerDNS01ProviderDigitalOcean(in, out, s) +} + +func autoConvert_v1alpha2_ACMEIssuerDNS01ProviderRFC2136_To_acme_ACMEIssuerDNS01ProviderRFC2136(in *v1alpha2.ACMEIssuerDNS01ProviderRFC2136, out *acme.ACMEIssuerDNS01ProviderRFC2136, s conversion.Scope) error { + out.Nameserver = in.Nameserver + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.TSIGSecret, &out.TSIGSecret, 0); err != nil { + return err + } + out.TSIGKeyName = in.TSIGKeyName + out.TSIGAlgorithm = in.TSIGAlgorithm + return nil +} + +// Convert_v1alpha2_ACMEIssuerDNS01ProviderRFC2136_To_acme_ACMEIssuerDNS01ProviderRFC2136 is an autogenerated conversion function. +func Convert_v1alpha2_ACMEIssuerDNS01ProviderRFC2136_To_acme_ACMEIssuerDNS01ProviderRFC2136(in *v1alpha2.ACMEIssuerDNS01ProviderRFC2136, out *acme.ACMEIssuerDNS01ProviderRFC2136, s conversion.Scope) error { + return autoConvert_v1alpha2_ACMEIssuerDNS01ProviderRFC2136_To_acme_ACMEIssuerDNS01ProviderRFC2136(in, out, s) +} + +func autoConvert_acme_ACMEIssuerDNS01ProviderRFC2136_To_v1alpha2_ACMEIssuerDNS01ProviderRFC2136(in *acme.ACMEIssuerDNS01ProviderRFC2136, out *v1alpha2.ACMEIssuerDNS01ProviderRFC2136, s conversion.Scope) error { + out.Nameserver = in.Nameserver + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.TSIGSecret, &out.TSIGSecret, 0); err != nil { + return err + } + out.TSIGKeyName = in.TSIGKeyName + out.TSIGAlgorithm = in.TSIGAlgorithm + return nil +} + +// Convert_acme_ACMEIssuerDNS01ProviderRFC2136_To_v1alpha2_ACMEIssuerDNS01ProviderRFC2136 is an autogenerated conversion function. +func Convert_acme_ACMEIssuerDNS01ProviderRFC2136_To_v1alpha2_ACMEIssuerDNS01ProviderRFC2136(in *acme.ACMEIssuerDNS01ProviderRFC2136, out *v1alpha2.ACMEIssuerDNS01ProviderRFC2136, s conversion.Scope) error { + return autoConvert_acme_ACMEIssuerDNS01ProviderRFC2136_To_v1alpha2_ACMEIssuerDNS01ProviderRFC2136(in, out, s) +} + +func autoConvert_v1alpha2_ACMEIssuerDNS01ProviderRoute53_To_acme_ACMEIssuerDNS01ProviderRoute53(in *v1alpha2.ACMEIssuerDNS01ProviderRoute53, out *acme.ACMEIssuerDNS01ProviderRoute53, s conversion.Scope) error { + out.AccessKeyID = in.AccessKeyID + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.SecretAccessKey, &out.SecretAccessKey, 0); err != nil { + return err + } + out.Role = in.Role + out.HostedZoneID = in.HostedZoneID + out.Region = in.Region + return nil +} + +// Convert_v1alpha2_ACMEIssuerDNS01ProviderRoute53_To_acme_ACMEIssuerDNS01ProviderRoute53 is an autogenerated conversion function. +func Convert_v1alpha2_ACMEIssuerDNS01ProviderRoute53_To_acme_ACMEIssuerDNS01ProviderRoute53(in *v1alpha2.ACMEIssuerDNS01ProviderRoute53, out *acme.ACMEIssuerDNS01ProviderRoute53, s conversion.Scope) error { + return autoConvert_v1alpha2_ACMEIssuerDNS01ProviderRoute53_To_acme_ACMEIssuerDNS01ProviderRoute53(in, out, s) +} + +func autoConvert_acme_ACMEIssuerDNS01ProviderRoute53_To_v1alpha2_ACMEIssuerDNS01ProviderRoute53(in *acme.ACMEIssuerDNS01ProviderRoute53, out *v1alpha2.ACMEIssuerDNS01ProviderRoute53, s conversion.Scope) error { + out.AccessKeyID = in.AccessKeyID + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.SecretAccessKey, &out.SecretAccessKey, 0); err != nil { + return err + } + out.Role = in.Role + out.HostedZoneID = in.HostedZoneID + out.Region = in.Region + return nil +} + +// Convert_acme_ACMEIssuerDNS01ProviderRoute53_To_v1alpha2_ACMEIssuerDNS01ProviderRoute53 is an autogenerated conversion function. +func Convert_acme_ACMEIssuerDNS01ProviderRoute53_To_v1alpha2_ACMEIssuerDNS01ProviderRoute53(in *acme.ACMEIssuerDNS01ProviderRoute53, out *v1alpha2.ACMEIssuerDNS01ProviderRoute53, s conversion.Scope) error { + return autoConvert_acme_ACMEIssuerDNS01ProviderRoute53_To_v1alpha2_ACMEIssuerDNS01ProviderRoute53(in, out, s) +} + +func autoConvert_v1alpha2_ACMEIssuerDNS01ProviderWebhook_To_acme_ACMEIssuerDNS01ProviderWebhook(in *v1alpha2.ACMEIssuerDNS01ProviderWebhook, out *acme.ACMEIssuerDNS01ProviderWebhook, s conversion.Scope) error { + out.GroupName = in.GroupName + out.SolverName = in.SolverName + out.Config = (*v1beta1.JSON)(unsafe.Pointer(in.Config)) + return nil +} + +// Convert_v1alpha2_ACMEIssuerDNS01ProviderWebhook_To_acme_ACMEIssuerDNS01ProviderWebhook is an autogenerated conversion function. +func Convert_v1alpha2_ACMEIssuerDNS01ProviderWebhook_To_acme_ACMEIssuerDNS01ProviderWebhook(in *v1alpha2.ACMEIssuerDNS01ProviderWebhook, out *acme.ACMEIssuerDNS01ProviderWebhook, s conversion.Scope) error { + return autoConvert_v1alpha2_ACMEIssuerDNS01ProviderWebhook_To_acme_ACMEIssuerDNS01ProviderWebhook(in, out, s) +} + +func autoConvert_acme_ACMEIssuerDNS01ProviderWebhook_To_v1alpha2_ACMEIssuerDNS01ProviderWebhook(in *acme.ACMEIssuerDNS01ProviderWebhook, out *v1alpha2.ACMEIssuerDNS01ProviderWebhook, s conversion.Scope) error { + out.GroupName = in.GroupName + out.SolverName = in.SolverName + out.Config = (*v1beta1.JSON)(unsafe.Pointer(in.Config)) + return nil +} + +// Convert_acme_ACMEIssuerDNS01ProviderWebhook_To_v1alpha2_ACMEIssuerDNS01ProviderWebhook is an autogenerated conversion function. +func Convert_acme_ACMEIssuerDNS01ProviderWebhook_To_v1alpha2_ACMEIssuerDNS01ProviderWebhook(in *acme.ACMEIssuerDNS01ProviderWebhook, out *v1alpha2.ACMEIssuerDNS01ProviderWebhook, s conversion.Scope) error { + return autoConvert_acme_ACMEIssuerDNS01ProviderWebhook_To_v1alpha2_ACMEIssuerDNS01ProviderWebhook(in, out, s) +} + +func autoConvert_v1alpha2_ACMEIssuerStatus_To_acme_ACMEIssuerStatus(in *v1alpha2.ACMEIssuerStatus, out *acme.ACMEIssuerStatus, s conversion.Scope) error { + out.URI = in.URI + out.LastRegisteredEmail = in.LastRegisteredEmail + return nil +} + +// Convert_v1alpha2_ACMEIssuerStatus_To_acme_ACMEIssuerStatus is an autogenerated conversion function. +func Convert_v1alpha2_ACMEIssuerStatus_To_acme_ACMEIssuerStatus(in *v1alpha2.ACMEIssuerStatus, out *acme.ACMEIssuerStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_ACMEIssuerStatus_To_acme_ACMEIssuerStatus(in, out, s) +} + +func autoConvert_acme_ACMEIssuerStatus_To_v1alpha2_ACMEIssuerStatus(in *acme.ACMEIssuerStatus, out *v1alpha2.ACMEIssuerStatus, s conversion.Scope) error { + out.URI = in.URI + out.LastRegisteredEmail = in.LastRegisteredEmail + return nil +} + +// Convert_acme_ACMEIssuerStatus_To_v1alpha2_ACMEIssuerStatus is an autogenerated conversion function. +func Convert_acme_ACMEIssuerStatus_To_v1alpha2_ACMEIssuerStatus(in *acme.ACMEIssuerStatus, out *v1alpha2.ACMEIssuerStatus, s conversion.Scope) error { + return autoConvert_acme_ACMEIssuerStatus_To_v1alpha2_ACMEIssuerStatus(in, out, s) +} + +func autoConvert_v1alpha2_CertificateDNSNameSelector_To_acme_CertificateDNSNameSelector(in *v1alpha2.CertificateDNSNameSelector, out *acme.CertificateDNSNameSelector, s conversion.Scope) error { + out.MatchLabels = *(*map[string]string)(unsafe.Pointer(&in.MatchLabels)) + out.DNSNames = *(*[]string)(unsafe.Pointer(&in.DNSNames)) + out.DNSZones = *(*[]string)(unsafe.Pointer(&in.DNSZones)) + return nil +} + +// Convert_v1alpha2_CertificateDNSNameSelector_To_acme_CertificateDNSNameSelector is an autogenerated conversion function. +func Convert_v1alpha2_CertificateDNSNameSelector_To_acme_CertificateDNSNameSelector(in *v1alpha2.CertificateDNSNameSelector, out *acme.CertificateDNSNameSelector, s conversion.Scope) error { + return autoConvert_v1alpha2_CertificateDNSNameSelector_To_acme_CertificateDNSNameSelector(in, out, s) +} + +func autoConvert_acme_CertificateDNSNameSelector_To_v1alpha2_CertificateDNSNameSelector(in *acme.CertificateDNSNameSelector, out *v1alpha2.CertificateDNSNameSelector, s conversion.Scope) error { + out.MatchLabels = *(*map[string]string)(unsafe.Pointer(&in.MatchLabels)) + out.DNSNames = *(*[]string)(unsafe.Pointer(&in.DNSNames)) + out.DNSZones = *(*[]string)(unsafe.Pointer(&in.DNSZones)) + return nil +} + +// Convert_acme_CertificateDNSNameSelector_To_v1alpha2_CertificateDNSNameSelector is an autogenerated conversion function. +func Convert_acme_CertificateDNSNameSelector_To_v1alpha2_CertificateDNSNameSelector(in *acme.CertificateDNSNameSelector, out *v1alpha2.CertificateDNSNameSelector, s conversion.Scope) error { + return autoConvert_acme_CertificateDNSNameSelector_To_v1alpha2_CertificateDNSNameSelector(in, out, s) +} + +func autoConvert_v1alpha2_Challenge_To_acme_Challenge(in *v1alpha2.Challenge, out *acme.Challenge, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha2_ChallengeSpec_To_acme_ChallengeSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha2_ChallengeStatus_To_acme_ChallengeStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_Challenge_To_acme_Challenge is an autogenerated conversion function. +func Convert_v1alpha2_Challenge_To_acme_Challenge(in *v1alpha2.Challenge, out *acme.Challenge, s conversion.Scope) error { + return autoConvert_v1alpha2_Challenge_To_acme_Challenge(in, out, s) +} + +func autoConvert_acme_Challenge_To_v1alpha2_Challenge(in *acme.Challenge, out *v1alpha2.Challenge, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_acme_ChallengeSpec_To_v1alpha2_ChallengeSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_acme_ChallengeStatus_To_v1alpha2_ChallengeStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_acme_Challenge_To_v1alpha2_Challenge is an autogenerated conversion function. +func Convert_acme_Challenge_To_v1alpha2_Challenge(in *acme.Challenge, out *v1alpha2.Challenge, s conversion.Scope) error { + return autoConvert_acme_Challenge_To_v1alpha2_Challenge(in, out, s) +} + +func autoConvert_v1alpha2_ChallengeList_To_acme_ChallengeList(in *v1alpha2.ChallengeList, out *acme.ChallengeList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]acme.Challenge)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha2_ChallengeList_To_acme_ChallengeList is an autogenerated conversion function. +func Convert_v1alpha2_ChallengeList_To_acme_ChallengeList(in *v1alpha2.ChallengeList, out *acme.ChallengeList, s conversion.Scope) error { + return autoConvert_v1alpha2_ChallengeList_To_acme_ChallengeList(in, out, s) +} + +func autoConvert_acme_ChallengeList_To_v1alpha2_ChallengeList(in *acme.ChallengeList, out *v1alpha2.ChallengeList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha2.Challenge)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_acme_ChallengeList_To_v1alpha2_ChallengeList is an autogenerated conversion function. +func Convert_acme_ChallengeList_To_v1alpha2_ChallengeList(in *acme.ChallengeList, out *v1alpha2.ChallengeList, s conversion.Scope) error { + return autoConvert_acme_ChallengeList_To_v1alpha2_ChallengeList(in, out, s) +} + +func autoConvert_v1alpha2_ChallengeSpec_To_acme_ChallengeSpec(in *v1alpha2.ChallengeSpec, out *acme.ChallengeSpec, s conversion.Scope) error { + out.AuthzURL = in.AuthzURL + out.Type = string(in.Type) + out.URL = in.URL + out.DNSName = in.DNSName + out.Token = in.Token + out.Key = in.Key + out.Wildcard = in.Wildcard + out.Solver = (*acme.ACMEChallengeSolver)(unsafe.Pointer(in.Solver)) + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.IssuerRef, &out.IssuerRef, 0); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_ChallengeSpec_To_acme_ChallengeSpec is an autogenerated conversion function. +func Convert_v1alpha2_ChallengeSpec_To_acme_ChallengeSpec(in *v1alpha2.ChallengeSpec, out *acme.ChallengeSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_ChallengeSpec_To_acme_ChallengeSpec(in, out, s) +} + +func autoConvert_acme_ChallengeSpec_To_v1alpha2_ChallengeSpec(in *acme.ChallengeSpec, out *v1alpha2.ChallengeSpec, s conversion.Scope) error { + out.AuthzURL = in.AuthzURL + out.Type = v1alpha2.ACMEChallengeType(in.Type) + out.URL = in.URL + out.DNSName = in.DNSName + out.Token = in.Token + out.Key = in.Key + out.Wildcard = in.Wildcard + out.Solver = (*v1alpha2.ACMEChallengeSolver)(unsafe.Pointer(in.Solver)) + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.IssuerRef, &out.IssuerRef, 0); err != nil { + return err + } + return nil +} + +// Convert_acme_ChallengeSpec_To_v1alpha2_ChallengeSpec is an autogenerated conversion function. +func Convert_acme_ChallengeSpec_To_v1alpha2_ChallengeSpec(in *acme.ChallengeSpec, out *v1alpha2.ChallengeSpec, s conversion.Scope) error { + return autoConvert_acme_ChallengeSpec_To_v1alpha2_ChallengeSpec(in, out, s) +} + +func autoConvert_v1alpha2_ChallengeStatus_To_acme_ChallengeStatus(in *v1alpha2.ChallengeStatus, out *acme.ChallengeStatus, s conversion.Scope) error { + out.Processing = in.Processing + out.Presented = in.Presented + out.Reason = in.Reason + out.State = acme.State(in.State) + return nil +} + +// Convert_v1alpha2_ChallengeStatus_To_acme_ChallengeStatus is an autogenerated conversion function. +func Convert_v1alpha2_ChallengeStatus_To_acme_ChallengeStatus(in *v1alpha2.ChallengeStatus, out *acme.ChallengeStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_ChallengeStatus_To_acme_ChallengeStatus(in, out, s) +} + +func autoConvert_acme_ChallengeStatus_To_v1alpha2_ChallengeStatus(in *acme.ChallengeStatus, out *v1alpha2.ChallengeStatus, s conversion.Scope) error { + out.Processing = in.Processing + out.Presented = in.Presented + out.Reason = in.Reason + out.State = v1alpha2.State(in.State) + return nil +} + +// Convert_acme_ChallengeStatus_To_v1alpha2_ChallengeStatus is an autogenerated conversion function. +func Convert_acme_ChallengeStatus_To_v1alpha2_ChallengeStatus(in *acme.ChallengeStatus, out *v1alpha2.ChallengeStatus, s conversion.Scope) error { + return autoConvert_acme_ChallengeStatus_To_v1alpha2_ChallengeStatus(in, out, s) +} + +func autoConvert_v1alpha2_Order_To_acme_Order(in *v1alpha2.Order, out *acme.Order, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha2_OrderSpec_To_acme_OrderSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha2_OrderStatus_To_acme_OrderStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_Order_To_acme_Order is an autogenerated conversion function. +func Convert_v1alpha2_Order_To_acme_Order(in *v1alpha2.Order, out *acme.Order, s conversion.Scope) error { + return autoConvert_v1alpha2_Order_To_acme_Order(in, out, s) +} + +func autoConvert_acme_Order_To_v1alpha2_Order(in *acme.Order, out *v1alpha2.Order, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_acme_OrderSpec_To_v1alpha2_OrderSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_acme_OrderStatus_To_v1alpha2_OrderStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_acme_Order_To_v1alpha2_Order is an autogenerated conversion function. +func Convert_acme_Order_To_v1alpha2_Order(in *acme.Order, out *v1alpha2.Order, s conversion.Scope) error { + return autoConvert_acme_Order_To_v1alpha2_Order(in, out, s) +} + +func autoConvert_v1alpha2_OrderList_To_acme_OrderList(in *v1alpha2.OrderList, out *acme.OrderList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]acme.Order, len(*in)) + for i := range *in { + if err := Convert_v1alpha2_Order_To_acme_Order(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1alpha2_OrderList_To_acme_OrderList is an autogenerated conversion function. +func Convert_v1alpha2_OrderList_To_acme_OrderList(in *v1alpha2.OrderList, out *acme.OrderList, s conversion.Scope) error { + return autoConvert_v1alpha2_OrderList_To_acme_OrderList(in, out, s) +} + +func autoConvert_acme_OrderList_To_v1alpha2_OrderList(in *acme.OrderList, out *v1alpha2.OrderList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1alpha2.Order, len(*in)) + for i := range *in { + if err := Convert_acme_Order_To_v1alpha2_Order(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_acme_OrderList_To_v1alpha2_OrderList is an autogenerated conversion function. +func Convert_acme_OrderList_To_v1alpha2_OrderList(in *acme.OrderList, out *v1alpha2.OrderList, s conversion.Scope) error { + return autoConvert_acme_OrderList_To_v1alpha2_OrderList(in, out, s) +} + +func autoConvert_v1alpha2_OrderSpec_To_acme_OrderSpec(in *v1alpha2.OrderSpec, out *acme.OrderSpec, s conversion.Scope) error { + out.CSR = *(*[]byte)(unsafe.Pointer(&in.CSR)) + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.IssuerRef, &out.IssuerRef, 0); err != nil { + return err + } + out.CommonName = in.CommonName + out.DNSNames = *(*[]string)(unsafe.Pointer(&in.DNSNames)) + return nil +} + +// Convert_v1alpha2_OrderSpec_To_acme_OrderSpec is an autogenerated conversion function. +func Convert_v1alpha2_OrderSpec_To_acme_OrderSpec(in *v1alpha2.OrderSpec, out *acme.OrderSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_OrderSpec_To_acme_OrderSpec(in, out, s) +} + +func autoConvert_acme_OrderSpec_To_v1alpha2_OrderSpec(in *acme.OrderSpec, out *v1alpha2.OrderSpec, s conversion.Scope) error { + out.CSR = *(*[]byte)(unsafe.Pointer(&in.CSR)) + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.IssuerRef, &out.IssuerRef, 0); err != nil { + return err + } + out.CommonName = in.CommonName + out.DNSNames = *(*[]string)(unsafe.Pointer(&in.DNSNames)) + return nil +} + +// Convert_acme_OrderSpec_To_v1alpha2_OrderSpec is an autogenerated conversion function. +func Convert_acme_OrderSpec_To_v1alpha2_OrderSpec(in *acme.OrderSpec, out *v1alpha2.OrderSpec, s conversion.Scope) error { + return autoConvert_acme_OrderSpec_To_v1alpha2_OrderSpec(in, out, s) +} + +func autoConvert_v1alpha2_OrderStatus_To_acme_OrderStatus(in *v1alpha2.OrderStatus, out *acme.OrderStatus, s conversion.Scope) error { + out.URL = in.URL + out.FinalizeURL = in.FinalizeURL + out.Authorizations = *(*[]acme.ACMEAuthorization)(unsafe.Pointer(&in.Authorizations)) + out.Certificate = *(*[]byte)(unsafe.Pointer(&in.Certificate)) + out.State = acme.State(in.State) + out.Reason = in.Reason + out.FailureTime = (*metav1.Time)(unsafe.Pointer(in.FailureTime)) + return nil +} + +// Convert_v1alpha2_OrderStatus_To_acme_OrderStatus is an autogenerated conversion function. +func Convert_v1alpha2_OrderStatus_To_acme_OrderStatus(in *v1alpha2.OrderStatus, out *acme.OrderStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_OrderStatus_To_acme_OrderStatus(in, out, s) +} + +func autoConvert_acme_OrderStatus_To_v1alpha2_OrderStatus(in *acme.OrderStatus, out *v1alpha2.OrderStatus, s conversion.Scope) error { + out.URL = in.URL + out.FinalizeURL = in.FinalizeURL + out.Certificate = *(*[]byte)(unsafe.Pointer(&in.Certificate)) + out.State = v1alpha2.State(in.State) + out.Reason = in.Reason + out.Authorizations = *(*[]v1alpha2.ACMEAuthorization)(unsafe.Pointer(&in.Authorizations)) + out.FailureTime = (*metav1.Time)(unsafe.Pointer(in.FailureTime)) + return nil +} + +// Convert_acme_OrderStatus_To_v1alpha2_OrderStatus is an autogenerated conversion function. +func Convert_acme_OrderStatus_To_v1alpha2_OrderStatus(in *acme.OrderStatus, out *v1alpha2.OrderStatus, s conversion.Scope) error { + return autoConvert_acme_OrderStatus_To_v1alpha2_OrderStatus(in, out, s) +} diff --git a/pkg/internal/apis/acme/v1alpha2/zz_generated.defaults.go b/pkg/internal/apis/acme/v1alpha2/zz_generated.defaults.go new file mode 100644 index 00000000000..1ec9978b2ba --- /dev/null +++ b/pkg/internal/apis/acme/v1alpha2/zz_generated.defaults.go @@ -0,0 +1,32 @@ +// +build !ignore_autogenerated + +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by defaulter-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + return nil +} diff --git a/pkg/internal/apis/acme/zz_generated.deepcopy.go b/pkg/internal/apis/acme/zz_generated.deepcopy.go new file mode 100644 index 00000000000..664178ec039 --- /dev/null +++ b/pkg/internal/apis/acme/zz_generated.deepcopy.go @@ -0,0 +1,707 @@ +// +build !ignore_autogenerated + +/* +Copyright 2019 The Jetstack cert-manager contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package acme + +import ( + v1 "k8s.io/api/core/v1" + v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEAuthorization) DeepCopyInto(out *ACMEAuthorization) { + *out = *in + if in.Challenges != nil { + in, out := &in.Challenges, &out.Challenges + *out = make([]ACMEChallenge, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEAuthorization. +func (in *ACMEAuthorization) DeepCopy() *ACMEAuthorization { + if in == nil { + return nil + } + out := new(ACMEAuthorization) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEChallenge) DeepCopyInto(out *ACMEChallenge) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallenge. +func (in *ACMEChallenge) DeepCopy() *ACMEChallenge { + if in == nil { + return nil + } + out := new(ACMEChallenge) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEChallengeSolver) DeepCopyInto(out *ACMEChallengeSolver) { + *out = *in + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = new(CertificateDNSNameSelector) + (*in).DeepCopyInto(*out) + } + if in.HTTP01 != nil { + in, out := &in.HTTP01, &out.HTTP01 + *out = new(ACMEChallengeSolverHTTP01) + (*in).DeepCopyInto(*out) + } + if in.DNS01 != nil { + in, out := &in.DNS01, &out.DNS01 + *out = new(ACMEChallengeSolverDNS01) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolver. +func (in *ACMEChallengeSolver) DeepCopy() *ACMEChallengeSolver { + if in == nil { + return nil + } + out := new(ACMEChallengeSolver) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEChallengeSolverDNS01) DeepCopyInto(out *ACMEChallengeSolverDNS01) { + *out = *in + if in.Akamai != nil { + in, out := &in.Akamai, &out.Akamai + *out = new(ACMEIssuerDNS01ProviderAkamai) + **out = **in + } + if in.CloudDNS != nil { + in, out := &in.CloudDNS, &out.CloudDNS + *out = new(ACMEIssuerDNS01ProviderCloudDNS) + **out = **in + } + if in.Cloudflare != nil { + in, out := &in.Cloudflare, &out.Cloudflare + *out = new(ACMEIssuerDNS01ProviderCloudflare) + **out = **in + } + if in.Route53 != nil { + in, out := &in.Route53, &out.Route53 + *out = new(ACMEIssuerDNS01ProviderRoute53) + **out = **in + } + if in.AzureDNS != nil { + in, out := &in.AzureDNS, &out.AzureDNS + *out = new(ACMEIssuerDNS01ProviderAzureDNS) + **out = **in + } + if in.DigitalOcean != nil { + in, out := &in.DigitalOcean, &out.DigitalOcean + *out = new(ACMEIssuerDNS01ProviderDigitalOcean) + **out = **in + } + if in.AcmeDNS != nil { + in, out := &in.AcmeDNS, &out.AcmeDNS + *out = new(ACMEIssuerDNS01ProviderAcmeDNS) + **out = **in + } + if in.RFC2136 != nil { + in, out := &in.RFC2136, &out.RFC2136 + *out = new(ACMEIssuerDNS01ProviderRFC2136) + **out = **in + } + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = new(ACMEIssuerDNS01ProviderWebhook) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolverDNS01. +func (in *ACMEChallengeSolverDNS01) DeepCopy() *ACMEChallengeSolverDNS01 { + if in == nil { + return nil + } + out := new(ACMEChallengeSolverDNS01) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEChallengeSolverHTTP01) DeepCopyInto(out *ACMEChallengeSolverHTTP01) { + *out = *in + if in.Ingress != nil { + in, out := &in.Ingress, &out.Ingress + *out = new(ACMEChallengeSolverHTTP01Ingress) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolverHTTP01. +func (in *ACMEChallengeSolverHTTP01) DeepCopy() *ACMEChallengeSolverHTTP01 { + if in == nil { + return nil + } + out := new(ACMEChallengeSolverHTTP01) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEChallengeSolverHTTP01Ingress) DeepCopyInto(out *ACMEChallengeSolverHTTP01Ingress) { + *out = *in + if in.Class != nil { + in, out := &in.Class, &out.Class + *out = new(string) + **out = **in + } + if in.PodTemplate != nil { + in, out := &in.PodTemplate, &out.PodTemplate + *out = new(ACMEChallengeSolverHTTP01IngressPodTemplate) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolverHTTP01Ingress. +func (in *ACMEChallengeSolverHTTP01Ingress) DeepCopy() *ACMEChallengeSolverHTTP01Ingress { + if in == nil { + return nil + } + out := new(ACMEChallengeSolverHTTP01Ingress) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEChallengeSolverHTTP01IngressPodSpec) DeepCopyInto(out *ACMEChallengeSolverHTTP01IngressPodSpec) { + *out = *in + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Affinity != nil { + in, out := &in.Affinity, &out.Affinity + *out = new(v1.Affinity) + (*in).DeepCopyInto(*out) + } + if in.Tolerations != nil { + in, out := &in.Tolerations, &out.Tolerations + *out = make([]v1.Toleration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolverHTTP01IngressPodSpec. +func (in *ACMEChallengeSolverHTTP01IngressPodSpec) DeepCopy() *ACMEChallengeSolverHTTP01IngressPodSpec { + if in == nil { + return nil + } + out := new(ACMEChallengeSolverHTTP01IngressPodSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEChallengeSolverHTTP01IngressPodTemplate) DeepCopyInto(out *ACMEChallengeSolverHTTP01IngressPodTemplate) { + *out = *in + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolverHTTP01IngressPodTemplate. +func (in *ACMEChallengeSolverHTTP01IngressPodTemplate) DeepCopy() *ACMEChallengeSolverHTTP01IngressPodTemplate { + if in == nil { + return nil + } + out := new(ACMEChallengeSolverHTTP01IngressPodTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuer) DeepCopyInto(out *ACMEIssuer) { + *out = *in + out.PrivateKey = in.PrivateKey + if in.Solvers != nil { + in, out := &in.Solvers, &out.Solvers + *out = make([]ACMEChallengeSolver, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuer. +func (in *ACMEIssuer) DeepCopy() *ACMEIssuer { + if in == nil { + return nil + } + out := new(ACMEIssuer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuerDNS01ProviderAcmeDNS) DeepCopyInto(out *ACMEIssuerDNS01ProviderAcmeDNS) { + *out = *in + out.AccountSecret = in.AccountSecret + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderAcmeDNS. +func (in *ACMEIssuerDNS01ProviderAcmeDNS) DeepCopy() *ACMEIssuerDNS01ProviderAcmeDNS { + if in == nil { + return nil + } + out := new(ACMEIssuerDNS01ProviderAcmeDNS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuerDNS01ProviderAkamai) DeepCopyInto(out *ACMEIssuerDNS01ProviderAkamai) { + *out = *in + out.ClientToken = in.ClientToken + out.ClientSecret = in.ClientSecret + out.AccessToken = in.AccessToken + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderAkamai. +func (in *ACMEIssuerDNS01ProviderAkamai) DeepCopy() *ACMEIssuerDNS01ProviderAkamai { + if in == nil { + return nil + } + out := new(ACMEIssuerDNS01ProviderAkamai) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuerDNS01ProviderAzureDNS) DeepCopyInto(out *ACMEIssuerDNS01ProviderAzureDNS) { + *out = *in + out.ClientSecret = in.ClientSecret + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderAzureDNS. +func (in *ACMEIssuerDNS01ProviderAzureDNS) DeepCopy() *ACMEIssuerDNS01ProviderAzureDNS { + if in == nil { + return nil + } + out := new(ACMEIssuerDNS01ProviderAzureDNS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuerDNS01ProviderCloudDNS) DeepCopyInto(out *ACMEIssuerDNS01ProviderCloudDNS) { + *out = *in + out.ServiceAccount = in.ServiceAccount + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderCloudDNS. +func (in *ACMEIssuerDNS01ProviderCloudDNS) DeepCopy() *ACMEIssuerDNS01ProviderCloudDNS { + if in == nil { + return nil + } + out := new(ACMEIssuerDNS01ProviderCloudDNS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuerDNS01ProviderCloudflare) DeepCopyInto(out *ACMEIssuerDNS01ProviderCloudflare) { + *out = *in + out.APIKey = in.APIKey + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderCloudflare. +func (in *ACMEIssuerDNS01ProviderCloudflare) DeepCopy() *ACMEIssuerDNS01ProviderCloudflare { + if in == nil { + return nil + } + out := new(ACMEIssuerDNS01ProviderCloudflare) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuerDNS01ProviderDigitalOcean) DeepCopyInto(out *ACMEIssuerDNS01ProviderDigitalOcean) { + *out = *in + out.Token = in.Token + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderDigitalOcean. +func (in *ACMEIssuerDNS01ProviderDigitalOcean) DeepCopy() *ACMEIssuerDNS01ProviderDigitalOcean { + if in == nil { + return nil + } + out := new(ACMEIssuerDNS01ProviderDigitalOcean) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuerDNS01ProviderRFC2136) DeepCopyInto(out *ACMEIssuerDNS01ProviderRFC2136) { + *out = *in + out.TSIGSecret = in.TSIGSecret + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderRFC2136. +func (in *ACMEIssuerDNS01ProviderRFC2136) DeepCopy() *ACMEIssuerDNS01ProviderRFC2136 { + if in == nil { + return nil + } + out := new(ACMEIssuerDNS01ProviderRFC2136) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuerDNS01ProviderRoute53) DeepCopyInto(out *ACMEIssuerDNS01ProviderRoute53) { + *out = *in + out.SecretAccessKey = in.SecretAccessKey + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderRoute53. +func (in *ACMEIssuerDNS01ProviderRoute53) DeepCopy() *ACMEIssuerDNS01ProviderRoute53 { + if in == nil { + return nil + } + out := new(ACMEIssuerDNS01ProviderRoute53) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuerDNS01ProviderWebhook) DeepCopyInto(out *ACMEIssuerDNS01ProviderWebhook) { + *out = *in + if in.Config != nil { + in, out := &in.Config, &out.Config + *out = new(v1beta1.JSON) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderWebhook. +func (in *ACMEIssuerDNS01ProviderWebhook) DeepCopy() *ACMEIssuerDNS01ProviderWebhook { + if in == nil { + return nil + } + out := new(ACMEIssuerDNS01ProviderWebhook) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ACMEIssuerStatus) DeepCopyInto(out *ACMEIssuerStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerStatus. +func (in *ACMEIssuerStatus) DeepCopy() *ACMEIssuerStatus { + if in == nil { + return nil + } + out := new(ACMEIssuerStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateDNSNameSelector) DeepCopyInto(out *CertificateDNSNameSelector) { + *out = *in + if in.MatchLabels != nil { + in, out := &in.MatchLabels, &out.MatchLabels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.DNSNames != nil { + in, out := &in.DNSNames, &out.DNSNames + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.DNSZones != nil { + in, out := &in.DNSZones, &out.DNSZones + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateDNSNameSelector. +func (in *CertificateDNSNameSelector) DeepCopy() *CertificateDNSNameSelector { + if in == nil { + return nil + } + out := new(CertificateDNSNameSelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Challenge) DeepCopyInto(out *Challenge) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Challenge. +func (in *Challenge) DeepCopy() *Challenge { + if in == nil { + return nil + } + out := new(Challenge) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Challenge) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ChallengeList) DeepCopyInto(out *ChallengeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Challenge, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChallengeList. +func (in *ChallengeList) DeepCopy() *ChallengeList { + if in == nil { + return nil + } + out := new(ChallengeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ChallengeList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ChallengeSpec) DeepCopyInto(out *ChallengeSpec) { + *out = *in + if in.Solver != nil { + in, out := &in.Solver, &out.Solver + *out = new(ACMEChallengeSolver) + (*in).DeepCopyInto(*out) + } + out.IssuerRef = in.IssuerRef + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChallengeSpec. +func (in *ChallengeSpec) DeepCopy() *ChallengeSpec { + if in == nil { + return nil + } + out := new(ChallengeSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ChallengeStatus) DeepCopyInto(out *ChallengeStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChallengeStatus. +func (in *ChallengeStatus) DeepCopy() *ChallengeStatus { + if in == nil { + return nil + } + out := new(ChallengeStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Order) DeepCopyInto(out *Order) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Order. +func (in *Order) DeepCopy() *Order { + if in == nil { + return nil + } + out := new(Order) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Order) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OrderList) DeepCopyInto(out *OrderList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Order, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OrderList. +func (in *OrderList) DeepCopy() *OrderList { + if in == nil { + return nil + } + out := new(OrderList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OrderList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OrderSpec) DeepCopyInto(out *OrderSpec) { + *out = *in + if in.CSR != nil { + in, out := &in.CSR, &out.CSR + *out = make([]byte, len(*in)) + copy(*out, *in) + } + out.IssuerRef = in.IssuerRef + if in.DNSNames != nil { + in, out := &in.DNSNames, &out.DNSNames + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OrderSpec. +func (in *OrderSpec) DeepCopy() *OrderSpec { + if in == nil { + return nil + } + out := new(OrderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OrderStatus) DeepCopyInto(out *OrderStatus) { + *out = *in + if in.Certificate != nil { + in, out := &in.Certificate, &out.Certificate + *out = make([]byte, len(*in)) + copy(*out, *in) + } + if in.Authorizations != nil { + in, out := &in.Authorizations, &out.Authorizations + *out = make([]ACMEAuthorization, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.FailureTime != nil { + in, out := &in.FailureTime, &out.FailureTime + *out = (*in).DeepCopy() + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OrderStatus. +func (in *OrderStatus) DeepCopy() *OrderStatus { + if in == nil { + return nil + } + out := new(OrderStatus) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/internal/apis/certmanager/BUILD.bazel b/pkg/internal/apis/certmanager/BUILD.bazel index de166906e9e..c4bccfea196 100644 --- a/pkg/internal/apis/certmanager/BUILD.bazel +++ b/pkg/internal/apis/certmanager/BUILD.bazel @@ -8,18 +8,15 @@ go_library( "types.go", "types_certificate.go", "types_certificaterequest.go", - "types_challenge.go", "types_issuer.go", - "types_order.go", "zz_generated.deepcopy.go", ], importpath = "github.com/jetstack/cert-manager/pkg/internal/apis/certmanager", visibility = ["//pkg:__subpackages__"], deps = [ "//pkg/apis/certmanager:go_default_library", + "//pkg/internal/apis/acme:go_default_library", "//pkg/internal/apis/meta:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", diff --git a/pkg/internal/apis/certmanager/fuzzer/BUILD.bazel b/pkg/internal/apis/certmanager/fuzzer/BUILD.bazel index bea76024ebf..1dee570968f 100644 --- a/pkg/internal/apis/certmanager/fuzzer/BUILD.bazel +++ b/pkg/internal/apis/certmanager/fuzzer/BUILD.bazel @@ -9,7 +9,6 @@ go_library( "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/internal/apis/certmanager:go_default_library", "//vendor/github.com/google/gofuzz:go_default_library", - "//vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library", ], diff --git a/pkg/internal/apis/certmanager/fuzzer/fuzzer.go b/pkg/internal/apis/certmanager/fuzzer/fuzzer.go index cd10e1d0777..c6447a1ce6b 100644 --- a/pkg/internal/apis/certmanager/fuzzer/fuzzer.go +++ b/pkg/internal/apis/certmanager/fuzzer/fuzzer.go @@ -18,7 +18,6 @@ package fuzzer import ( fuzz "github.com/google/gofuzz" - apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" @@ -45,20 +44,6 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} { s.Spec.RenewBefore = &metav1.Duration{Duration: v1alpha2.DefaultRenewBefore} } }, - func(s *certmanager.Order, c fuzz.Continue) { - c.FuzzNoCustom(s) // fuzz self without calling this function again - - if s.Spec.IssuerRef.Kind == "" { - s.Spec.IssuerRef.Kind = v1alpha2.IssuerKind - } - }, - func(s *certmanager.Challenge, c fuzz.Continue) { - c.FuzzNoCustom(s) // fuzz self without calling this function again - - if s.Spec.IssuerRef.Kind == "" { - s.Spec.IssuerRef.Kind = v1alpha2.IssuerKind - } - }, func(s *certmanager.CertificateRequest, c fuzz.Continue) { c.FuzzNoCustom(s) // fuzz self without calling this function again @@ -69,10 +54,5 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} { s.Spec.Duration = &metav1.Duration{Duration: v1alpha2.DefaultCertificateDuration} } }, - func(s *certmanager.ACMEIssuerDNS01ProviderWebhook, c fuzz.Continue) { - c.FuzzNoCustom(s) // fuzz self without calling this function again - // ensure the webhook's config is valid JSON - s.Config = &apiext.JSON{Raw: []byte("{}")} - }, } } diff --git a/pkg/internal/apis/certmanager/install/BUILD.bazel b/pkg/internal/apis/certmanager/install/BUILD.bazel index 5b5a51e4b13..2020c8876cc 100644 --- a/pkg/internal/apis/certmanager/install/BUILD.bazel +++ b/pkg/internal/apis/certmanager/install/BUILD.bazel @@ -32,7 +32,9 @@ go_test( srcs = ["roundtrip_test.go"], embed = [":go_default_library"], deps = [ + "//pkg/internal/apis/acme/fuzzer:go_default_library", "//pkg/internal/apis/certmanager/fuzzer:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/api/apitesting/fuzzer:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/apitesting/roundtrip:go_default_library", ], ) diff --git a/pkg/internal/apis/certmanager/install/roundtrip_test.go b/pkg/internal/apis/certmanager/install/roundtrip_test.go index 9e59b505cf8..65043b98d9e 100644 --- a/pkg/internal/apis/certmanager/install/roundtrip_test.go +++ b/pkg/internal/apis/certmanager/install/roundtrip_test.go @@ -19,11 +19,14 @@ package install import ( "testing" + "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" "k8s.io/apimachinery/pkg/api/apitesting/roundtrip" + acmefuzzer "github.com/jetstack/cert-manager/pkg/internal/apis/acme/fuzzer" cmfuzzer "github.com/jetstack/cert-manager/pkg/internal/apis/certmanager/fuzzer" ) func TestRoundTripTypes(t *testing.T) { - roundtrip.RoundTripTestForAPIGroup(t, Install, cmfuzzer.Funcs) + fuzzers := fuzzer.MergeFuzzerFuncs(cmfuzzer.Funcs, acmefuzzer.Funcs) + roundtrip.RoundTripTestForAPIGroup(t, Install, fuzzers) } diff --git a/pkg/internal/apis/certmanager/register.go b/pkg/internal/apis/certmanager/register.go index 0b441ea9973..8210f6eb1e6 100644 --- a/pkg/internal/apis/certmanager/register.go +++ b/pkg/internal/apis/certmanager/register.go @@ -47,10 +47,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { &ClusterIssuerList{}, &CertificateRequest{}, &CertificateRequestList{}, - &Order{}, - &OrderList{}, - &Challenge{}, - &ChallengeList{}, ) return nil } diff --git a/pkg/internal/apis/certmanager/types.go b/pkg/internal/apis/certmanager/types.go index 50af2fb17fc..9d4b170f0e6 100644 --- a/pkg/internal/apis/certmanager/types.go +++ b/pkg/internal/apis/certmanager/types.go @@ -36,7 +36,6 @@ const ( IssuerKind = "Issuer" CertificateKind = "Certificate" CertificateRequestKind = "CertificateRequest" - OrderKind = "Order" ) const ( diff --git a/pkg/internal/apis/certmanager/types_issuer.go b/pkg/internal/apis/certmanager/types_issuer.go index 23e236a9f19..4fbdd97c2e4 100644 --- a/pkg/internal/apis/certmanager/types_issuer.go +++ b/pkg/internal/apis/certmanager/types_issuer.go @@ -17,10 +17,9 @@ limitations under the License. package certmanager import ( - corev1 "k8s.io/api/core/v1" - apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + cmacme "github.com/jetstack/cert-manager/pkg/internal/apis/acme" cmmeta "github.com/jetstack/cert-manager/pkg/internal/apis/meta" ) @@ -72,7 +71,7 @@ type IssuerSpec struct { type IssuerConfig struct { // +optional - ACME *ACMEIssuer `json:"acme,omitempty"` + ACME *cmacme.ACMEIssuer `json:"acme,omitempty"` // +optional CA *CAIssuer `json:"ca,omitempty"` @@ -183,361 +182,13 @@ type CAIssuer struct { SecretName string `json:"secretName"` } -// ACMEIssuer contains the specification for an ACME issuer -type ACMEIssuer struct { - // Email is the email for this account - // +optional - Email string `json:"email,omitempty"` - - // Server is the ACME server URL - Server string `json:"server"` - - // If true, skip verifying the ACME server TLS certificate - // +optional - SkipTLSVerify bool `json:"skipTLSVerify,omitempty"` - - // PrivateKey is the name of a secret containing the private key for this - // user account. - PrivateKey cmmeta.SecretKeySelector `json:"privateKeySecretRef"` - - // Solvers is a list of challenge solvers that will be used to solve - // ACME challenges for the matching domains. - // +optional - Solvers []ACMEChallengeSolver `json:"solvers,omitempty"` -} - -type ACMEChallengeSolver struct { - // Selector selects a set of DNSNames on the Certificate resource that - // should be solved using this challenge solver. - Selector *CertificateDNSNameSelector `json:"selector,omitempty"` - - // +optional - HTTP01 *ACMEChallengeSolverHTTP01 `json:"http01,omitempty"` - - // +optional - DNS01 *ACMEChallengeSolverDNS01 `json:"dns01,omitempty"` -} - -// CertificateDomainSelector selects certificates using a label selector, and -// can optionally select individual DNS names within those certificates. -// If both MatchLabels and DNSNames are empty, this selector will match all -// certificates and DNS names within them. -type CertificateDNSNameSelector struct { - // A label selector that is used to refine the set of certificate's that - // this challenge solver will apply to. - // +optional - MatchLabels map[string]string `json:"matchLabels,omitempty"` - - // List of DNSNames that this solver will be used to solve. - // If specified and a match is found, a dnsNames selector will take - // precedence over a dnsZones selector. - // If multiple solvers match with the same dnsNames value, the solver - // with the most matching labels in matchLabels will be selected. - // If neither has more matches, the solver defined earlier in the list - // will be selected. - // +optional - DNSNames []string `json:"dnsNames,omitempty"` - - // List of DNSZones that this solver will be used to solve. - // The most specific DNS zone match specified here will take precedence - // over other DNS zone matches, so a solver specifying sys.example.com - // will be selected over one specifying example.com for the domain - // www.sys.example.com. - // If multiple solvers match with the same dnsZones value, the solver - // with the most matching labels in matchLabels will be selected. - // If neither has more matches, the solver defined earlier in the list - // will be selected. - // +optional - DNSZones []string `json:"dnsZones,omitempty"` -} - -// ACMEChallengeSolverHTTP01 contains configuration detailing how to solve -// HTTP01 challenges within a Kubernetes cluster. -// Typically this is accomplished through creating 'routes' of some description -// that configure ingress controllers to direct traffic to 'solver pods', which -// are responsible for responding to the ACME server's HTTP requests. -type ACMEChallengeSolverHTTP01 struct { - // The ingress based HTTP01 challenge solver will solve challenges by - // creating or modifying Ingress resources in order to route requests for - // '/.well-known/acme-challenge/XYZ' to 'challenge solver' pods that are - // provisioned by cert-manager for each Challenge to be completed. - // +optional - Ingress *ACMEChallengeSolverHTTP01Ingress `json:"ingress"` -} - -type ACMEChallengeSolverHTTP01Ingress struct { - // Optional service type for Kubernetes solver service - // +optional - ServiceType corev1.ServiceType `json:"serviceType,omitempty"` - - // The ingress class to use when creating Ingress resources to solve ACME - // challenges that use this challenge solver. - // Only one of 'class' or 'name' may be specified. - // +optional - Class *string `json:"class,omitempty"` - - // The name of the ingress resource that should have ACME challenge solving - // routes inserted into it in order to solve HTTP01 challenges. - // This is typically used in conjunction with ingress controllers like - // ingress-gce, which maintains a 1:1 mapping between external IPs and - // ingress resources. - // +optional - Name string `json:"name,omitempty"` - - // Optional pod template used to configure the ACME challenge solver pods - // used for HTTP01 challenges - // +optional - PodTemplate *ACMEChallengeSolverHTTP01IngressPodTemplate `json:"podTemplate,omitempty"` -} - -type ACMEChallengeSolverHTTP01IngressPodTemplate struct { - // ObjectMeta overrides for the pod used to solve HTTP01 challenges. - // Only the 'labels' and 'annotations' fields may be set. - // If labels or annotations overlap with in-built values, the values here - // will override the in-built values. - // +optional - metav1.ObjectMeta `json:"metadata,omitempty"` - - // PodSpec defines overrides for the HTTP01 challenge solver pod. - // Only the 'nodeSelector', 'affinity' and 'tolerations' fields are - // supported currently. All other fields will be ignored. - // +optional - Spec ACMEChallengeSolverHTTP01IngressPodSpec `json:"spec,omitempty"` -} - -type ACMEChallengeSolverHTTP01IngressPodSpec struct { - // NodeSelector is a selector which must be true for the pod to fit on a node. - // Selector which must match a node's labels for the pod to be scheduled on that node. - // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ - // +optional - NodeSelector map[string]string `json:"nodeSelector,omitempty"` - - // If specified, the pod's scheduling constraints - // +optional - Affinity *corev1.Affinity `json:"affinity,omitempty"` - - // If specified, the pod's tolerations. - // +optional - Tolerations []corev1.Toleration `json:"tolerations,omitempty"` -} - -type ACMEChallengeSolverDNS01 struct { - // CNAMEStrategy configures how the DNS01 provider should handle CNAME - // records when found in DNS zones. - // +optional - CNAMEStrategy CNAMEStrategy `json:"cnameStrategy,omitempty"` - - // +optional - Akamai *ACMEIssuerDNS01ProviderAkamai `json:"akamai,omitempty"` - - // +optional - CloudDNS *ACMEIssuerDNS01ProviderCloudDNS `json:"clouddns,omitempty"` - - // +optional - Cloudflare *ACMEIssuerDNS01ProviderCloudflare `json:"cloudflare,omitempty"` - - // +optional - Route53 *ACMEIssuerDNS01ProviderRoute53 `json:"route53,omitempty"` - - // +optional - AzureDNS *ACMEIssuerDNS01ProviderAzureDNS `json:"azuredns,omitempty"` - - // +optional - DigitalOcean *ACMEIssuerDNS01ProviderDigitalOcean `json:"digitalocean,omitempty"` - - // +optional - AcmeDNS *ACMEIssuerDNS01ProviderAcmeDNS `json:"acmedns,omitempty"` - - // +optional - RFC2136 *ACMEIssuerDNS01ProviderRFC2136 `json:"rfc2136,omitempty"` - - // +optional - Webhook *ACMEIssuerDNS01ProviderWebhook `json:"webhook,omitempty"` -} - -// CNAMEStrategy configures how the DNS01 provider should handle CNAME records -// when found in DNS zones. -// By default, the None strategy will be applied (i.e. do not follow CNAMEs). -// +kubebuilder:validation:Enum=None;Follow -type CNAMEStrategy string - -const ( - // NoneStrategy indicates that no CNAME resolution strategy should be used - // when determining which DNS zone to update during DNS01 challenges. - NoneStrategy = "None" - - // FollowStrategy will cause cert-manager to recurse through CNAMEs in - // order to determine which DNS zone to update during DNS01 challenges. - // This is useful if you do not want to grant cert-manager access to your - // root DNS zone, and instead delegate the _acme-challenge.example.com - // subdomain to some other, less privileged domain. - FollowStrategy = "Follow" -) - -// ACMEIssuerDNS01ProviderAkamai is a structure containing the DNS -// configuration for Akamai DNS—Zone Record Management API -type ACMEIssuerDNS01ProviderAkamai struct { - ServiceConsumerDomain string `json:"serviceConsumerDomain"` - ClientToken cmmeta.SecretKeySelector `json:"clientTokenSecretRef"` - ClientSecret cmmeta.SecretKeySelector `json:"clientSecretSecretRef"` - AccessToken cmmeta.SecretKeySelector `json:"accessTokenSecretRef"` -} - -// ACMEIssuerDNS01ProviderCloudDNS is a structure containing the DNS -// configuration for Google Cloud DNS -type ACMEIssuerDNS01ProviderCloudDNS struct { - ServiceAccount cmmeta.SecretKeySelector `json:"serviceAccountSecretRef"` - Project string `json:"project"` -} - -// ACMEIssuerDNS01ProviderCloudflare is a structure containing the DNS -// configuration for Cloudflare -type ACMEIssuerDNS01ProviderCloudflare struct { - Email string `json:"email"` - APIKey cmmeta.SecretKeySelector `json:"apiKeySecretRef"` -} - -// ACMEIssuerDNS01ProviderDigitalOcean is a structure containing the DNS -// configuration for DigitalOcean Domains -type ACMEIssuerDNS01ProviderDigitalOcean struct { - Token cmmeta.SecretKeySelector `json:"tokenSecretRef"` -} - -// ACMEIssuerDNS01ProviderRoute53 is a structure containing the Route 53 -// configuration for AWS -type ACMEIssuerDNS01ProviderRoute53 struct { - // The AccessKeyID is used for authentication. If not set we fall-back to using env vars, shared credentials file or AWS Instance metadata - // see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials - // +optional - AccessKeyID string `json:"accessKeyID"` - - // The SecretAccessKey is used for authentication. If not set we fall-back to using env vars, shared credentials file or AWS Instance metadata - // https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials - // +optional - SecretAccessKey cmmeta.SecretKeySelector `json:"secretAccessKeySecretRef"` - - // Role is a Role ARN which the Route53 provider will assume using either the explicit credentials AccessKeyID/SecretAccessKey - // or the inferred credentials from environment variables, shared credentials file or AWS Instance metadata - // +optional - Role string `json:"role"` - - // If set, the provider will manage only this zone in Route53 and will not do an lookup using the route53:ListHostedZonesByName api call. - // +optional - HostedZoneID string `json:"hostedZoneID,omitempty"` - - // Always set the region when using AccessKeyID and SecretAccessKey - Region string `json:"region"` -} - -// ACMEIssuerDNS01ProviderAzureDNS is a structure containing the -// configuration for Azure DNS -type ACMEIssuerDNS01ProviderAzureDNS struct { - ClientID string `json:"clientID"` - - ClientSecret cmmeta.SecretKeySelector `json:"clientSecretSecretRef"` - - SubscriptionID string `json:"subscriptionID"` - - TenantID string `json:"tenantID"` - - ResourceGroupName string `json:"resourceGroupName"` - - // +optional - HostedZoneName string `json:"hostedZoneName,omitempty"` - - // +optional - Environment AzureDNSEnvironment `json:"environment,omitempty"` -} - -// +kubebuilder:validation:Enum=AzurePublicCloud;AzureChinaCloud;AzureGermanCloud;AzureUSGovernmentCloud -type AzureDNSEnvironment string - -const ( - AzurePublicCloud AzureDNSEnvironment = "AzurePublicCloud" - AzureChinaCloud AzureDNSEnvironment = "AzureChinaCloud" - AzureGermanCloud AzureDNSEnvironment = "AzureGermanCloud" - AzureUSGovernmentCloud AzureDNSEnvironment = "AzureUSGovernmentCloud" -) - -// ACMEIssuerDNS01ProviderAcmeDNS is a structure containing the -// configuration for ACME-DNS servers -type ACMEIssuerDNS01ProviderAcmeDNS struct { - Host string `json:"host"` - - AccountSecret cmmeta.SecretKeySelector `json:"accountSecretRef"` -} - -// ACMEIssuerDNS01ProviderRFC2136 is a structure containing the -// configuration for RFC2136 DNS -type ACMEIssuerDNS01ProviderRFC2136 struct { - // The IP address of the DNS supporting RFC2136. Required. - // Note: FQDN is not a valid value, only IP. - Nameserver string `json:"nameserver"` - - // The name of the secret containing the TSIG value. - // If ``tsigKeyName`` is defined, this field is required. - // +optional - TSIGSecret cmmeta.SecretKeySelector `json:"tsigSecretSecretRef,omitempty"` - - // The TSIG Key name configured in the DNS. - // If ``tsigSecretSecretRef`` is defined, this field is required. - // +optional - TSIGKeyName string `json:"tsigKeyName,omitempty"` - - // The TSIG Algorithm configured in the DNS supporting RFC2136. Used only - // when ``tsigSecretSecretRef`` and ``tsigKeyName`` are defined. - // Supported values are (case-insensitive): ``HMACMD5`` (default), - // ``HMACSHA1``, ``HMACSHA256`` or ``HMACSHA512``. - // +optional - TSIGAlgorithm string `json:"tsigAlgorithm,omitempty"` -} - -// ACMEIssuerDNS01ProviderWebhook specifies configuration for a webhook DNS01 -// provider, including where to POST ChallengePayload resources. -type ACMEIssuerDNS01ProviderWebhook struct { - // The API group name that should be used when POSTing ChallengePayload - // resources to the webhook apiserver. - // This should be the same as the GroupName specified in the webhook - // provider implementation. - GroupName string `json:"groupName"` - - // The name of the solver to use, as defined in the webhook provider - // implementation. - // This will typically be the name of the provider, e.g. 'cloudflare'. - SolverName string `json:"solverName"` - - // Additional configuration that should be passed to the webhook apiserver - // when challenges are processed. - // This can contain arbitrary JSON data. - // Secret values should not be specified in this stanza. - // If secret values are needed (e.g. credentials for a DNS service), you - // should use a cmmeta.SecretKeySelector to reference a Secret resource. - // For details on the schema of this field, consult the webhook provider - // implementation's documentation. - // +optional - Config *apiext.JSON `json:"config,omitempty"` -} - // IssuerStatus contains status information about an Issuer type IssuerStatus struct { // +optional Conditions []IssuerCondition `json:"conditions,omitempty"` // +optional - ACME *ACMEIssuerStatus `json:"acme,omitempty"` -} - -type ACMEIssuerStatus struct { - // URI is the unique account identifier, which can also be used to retrieve - // account details from the CA - // +optional - URI string `json:"uri,omitempty"` - - // LastRegisteredEmail is the email associated with the latest registered - // ACME account, in order to track changes made to registered account - // associated with the Issuer - // +optional - LastRegisteredEmail string `json:"lastRegisteredEmail,omitempty"` + ACME *cmacme.ACMEIssuerStatus `json:"acme,omitempty"` } // IssuerCondition contains condition information for an Issuer. diff --git a/pkg/internal/apis/certmanager/v1alpha2/BUILD.bazel b/pkg/internal/apis/certmanager/v1alpha2/BUILD.bazel index 69017ac1072..d705956653e 100644 --- a/pkg/internal/apis/certmanager/v1alpha2/BUILD.bazel +++ b/pkg/internal/apis/certmanager/v1alpha2/BUILD.bazel @@ -12,13 +12,13 @@ go_library( importpath = "github.com/jetstack/cert-manager/pkg/internal/apis/certmanager/v1alpha2", visibility = ["//pkg:__subpackages__"], deps = [ + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", + "//pkg/internal/apis/acme:go_default_library", "//pkg/internal/apis/certmanager:go_default_library", "//pkg/internal/apis/meta:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/conversion:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", diff --git a/pkg/internal/apis/certmanager/v1alpha2/zz_generated.conversion.go b/pkg/internal/apis/certmanager/v1alpha2/zz_generated.conversion.go index 3ad7bf533bd..c8bfa0969d4 100644 --- a/pkg/internal/apis/certmanager/v1alpha2/zz_generated.conversion.go +++ b/pkg/internal/apis/certmanager/v1alpha2/zz_generated.conversion.go @@ -23,13 +23,13 @@ package v1alpha2 import ( unsafe "unsafe" + acmev1alpha2 "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" v1alpha2 "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" - apismetav1 "github.com/jetstack/cert-manager/pkg/apis/meta/v1" + metav1 "github.com/jetstack/cert-manager/pkg/apis/meta/v1" + acme "github.com/jetstack/cert-manager/pkg/internal/apis/acme" certmanager "github.com/jetstack/cert-manager/pkg/internal/apis/certmanager" meta "github.com/jetstack/cert-manager/pkg/internal/apis/meta" - v1 "k8s.io/api/core/v1" - v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -41,196 +41,6 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEAuthorization)(nil), (*certmanager.ACMEAuthorization)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ACMEAuthorization_To_certmanager_ACMEAuthorization(a.(*v1alpha2.ACMEAuthorization), b.(*certmanager.ACMEAuthorization), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ACMEAuthorization)(nil), (*v1alpha2.ACMEAuthorization)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ACMEAuthorization_To_v1alpha2_ACMEAuthorization(a.(*certmanager.ACMEAuthorization), b.(*v1alpha2.ACMEAuthorization), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEChallenge)(nil), (*certmanager.ACMEChallenge)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ACMEChallenge_To_certmanager_ACMEChallenge(a.(*v1alpha2.ACMEChallenge), b.(*certmanager.ACMEChallenge), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ACMEChallenge)(nil), (*v1alpha2.ACMEChallenge)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ACMEChallenge_To_v1alpha2_ACMEChallenge(a.(*certmanager.ACMEChallenge), b.(*v1alpha2.ACMEChallenge), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEChallengeSolver)(nil), (*certmanager.ACMEChallengeSolver)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ACMEChallengeSolver_To_certmanager_ACMEChallengeSolver(a.(*v1alpha2.ACMEChallengeSolver), b.(*certmanager.ACMEChallengeSolver), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ACMEChallengeSolver)(nil), (*v1alpha2.ACMEChallengeSolver)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ACMEChallengeSolver_To_v1alpha2_ACMEChallengeSolver(a.(*certmanager.ACMEChallengeSolver), b.(*v1alpha2.ACMEChallengeSolver), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEChallengeSolverDNS01)(nil), (*certmanager.ACMEChallengeSolverDNS01)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ACMEChallengeSolverDNS01_To_certmanager_ACMEChallengeSolverDNS01(a.(*v1alpha2.ACMEChallengeSolverDNS01), b.(*certmanager.ACMEChallengeSolverDNS01), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ACMEChallengeSolverDNS01)(nil), (*v1alpha2.ACMEChallengeSolverDNS01)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ACMEChallengeSolverDNS01_To_v1alpha2_ACMEChallengeSolverDNS01(a.(*certmanager.ACMEChallengeSolverDNS01), b.(*v1alpha2.ACMEChallengeSolverDNS01), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEChallengeSolverHTTP01)(nil), (*certmanager.ACMEChallengeSolverHTTP01)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ACMEChallengeSolverHTTP01_To_certmanager_ACMEChallengeSolverHTTP01(a.(*v1alpha2.ACMEChallengeSolverHTTP01), b.(*certmanager.ACMEChallengeSolverHTTP01), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ACMEChallengeSolverHTTP01)(nil), (*v1alpha2.ACMEChallengeSolverHTTP01)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ACMEChallengeSolverHTTP01_To_v1alpha2_ACMEChallengeSolverHTTP01(a.(*certmanager.ACMEChallengeSolverHTTP01), b.(*v1alpha2.ACMEChallengeSolverHTTP01), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEChallengeSolverHTTP01Ingress)(nil), (*certmanager.ACMEChallengeSolverHTTP01Ingress)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ACMEChallengeSolverHTTP01Ingress_To_certmanager_ACMEChallengeSolverHTTP01Ingress(a.(*v1alpha2.ACMEChallengeSolverHTTP01Ingress), b.(*certmanager.ACMEChallengeSolverHTTP01Ingress), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ACMEChallengeSolverHTTP01Ingress)(nil), (*v1alpha2.ACMEChallengeSolverHTTP01Ingress)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ACMEChallengeSolverHTTP01Ingress_To_v1alpha2_ACMEChallengeSolverHTTP01Ingress(a.(*certmanager.ACMEChallengeSolverHTTP01Ingress), b.(*v1alpha2.ACMEChallengeSolverHTTP01Ingress), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEChallengeSolverHTTP01IngressPodSpec)(nil), (*certmanager.ACMEChallengeSolverHTTP01IngressPodSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec_To_certmanager_ACMEChallengeSolverHTTP01IngressPodSpec(a.(*v1alpha2.ACMEChallengeSolverHTTP01IngressPodSpec), b.(*certmanager.ACMEChallengeSolverHTTP01IngressPodSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ACMEChallengeSolverHTTP01IngressPodSpec)(nil), (*v1alpha2.ACMEChallengeSolverHTTP01IngressPodSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ACMEChallengeSolverHTTP01IngressPodSpec_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec(a.(*certmanager.ACMEChallengeSolverHTTP01IngressPodSpec), b.(*v1alpha2.ACMEChallengeSolverHTTP01IngressPodSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate)(nil), (*certmanager.ACMEChallengeSolverHTTP01IngressPodTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodTemplate_To_certmanager_ACMEChallengeSolverHTTP01IngressPodTemplate(a.(*v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate), b.(*certmanager.ACMEChallengeSolverHTTP01IngressPodTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ACMEChallengeSolverHTTP01IngressPodTemplate)(nil), (*v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ACMEChallengeSolverHTTP01IngressPodTemplate_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodTemplate(a.(*certmanager.ACMEChallengeSolverHTTP01IngressPodTemplate), b.(*v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuer)(nil), (*certmanager.ACMEIssuer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ACMEIssuer_To_certmanager_ACMEIssuer(a.(*v1alpha2.ACMEIssuer), b.(*certmanager.ACMEIssuer), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ACMEIssuer)(nil), (*v1alpha2.ACMEIssuer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ACMEIssuer_To_v1alpha2_ACMEIssuer(a.(*certmanager.ACMEIssuer), b.(*v1alpha2.ACMEIssuer), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuerDNS01ProviderAcmeDNS)(nil), (*certmanager.ACMEIssuerDNS01ProviderAcmeDNS)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ACMEIssuerDNS01ProviderAcmeDNS_To_certmanager_ACMEIssuerDNS01ProviderAcmeDNS(a.(*v1alpha2.ACMEIssuerDNS01ProviderAcmeDNS), b.(*certmanager.ACMEIssuerDNS01ProviderAcmeDNS), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ACMEIssuerDNS01ProviderAcmeDNS)(nil), (*v1alpha2.ACMEIssuerDNS01ProviderAcmeDNS)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ACMEIssuerDNS01ProviderAcmeDNS_To_v1alpha2_ACMEIssuerDNS01ProviderAcmeDNS(a.(*certmanager.ACMEIssuerDNS01ProviderAcmeDNS), b.(*v1alpha2.ACMEIssuerDNS01ProviderAcmeDNS), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuerDNS01ProviderAkamai)(nil), (*certmanager.ACMEIssuerDNS01ProviderAkamai)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ACMEIssuerDNS01ProviderAkamai_To_certmanager_ACMEIssuerDNS01ProviderAkamai(a.(*v1alpha2.ACMEIssuerDNS01ProviderAkamai), b.(*certmanager.ACMEIssuerDNS01ProviderAkamai), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ACMEIssuerDNS01ProviderAkamai)(nil), (*v1alpha2.ACMEIssuerDNS01ProviderAkamai)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ACMEIssuerDNS01ProviderAkamai_To_v1alpha2_ACMEIssuerDNS01ProviderAkamai(a.(*certmanager.ACMEIssuerDNS01ProviderAkamai), b.(*v1alpha2.ACMEIssuerDNS01ProviderAkamai), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuerDNS01ProviderAzureDNS)(nil), (*certmanager.ACMEIssuerDNS01ProviderAzureDNS)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ACMEIssuerDNS01ProviderAzureDNS_To_certmanager_ACMEIssuerDNS01ProviderAzureDNS(a.(*v1alpha2.ACMEIssuerDNS01ProviderAzureDNS), b.(*certmanager.ACMEIssuerDNS01ProviderAzureDNS), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ACMEIssuerDNS01ProviderAzureDNS)(nil), (*v1alpha2.ACMEIssuerDNS01ProviderAzureDNS)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ACMEIssuerDNS01ProviderAzureDNS_To_v1alpha2_ACMEIssuerDNS01ProviderAzureDNS(a.(*certmanager.ACMEIssuerDNS01ProviderAzureDNS), b.(*v1alpha2.ACMEIssuerDNS01ProviderAzureDNS), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuerDNS01ProviderCloudDNS)(nil), (*certmanager.ACMEIssuerDNS01ProviderCloudDNS)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ACMEIssuerDNS01ProviderCloudDNS_To_certmanager_ACMEIssuerDNS01ProviderCloudDNS(a.(*v1alpha2.ACMEIssuerDNS01ProviderCloudDNS), b.(*certmanager.ACMEIssuerDNS01ProviderCloudDNS), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ACMEIssuerDNS01ProviderCloudDNS)(nil), (*v1alpha2.ACMEIssuerDNS01ProviderCloudDNS)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ACMEIssuerDNS01ProviderCloudDNS_To_v1alpha2_ACMEIssuerDNS01ProviderCloudDNS(a.(*certmanager.ACMEIssuerDNS01ProviderCloudDNS), b.(*v1alpha2.ACMEIssuerDNS01ProviderCloudDNS), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuerDNS01ProviderCloudflare)(nil), (*certmanager.ACMEIssuerDNS01ProviderCloudflare)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ACMEIssuerDNS01ProviderCloudflare_To_certmanager_ACMEIssuerDNS01ProviderCloudflare(a.(*v1alpha2.ACMEIssuerDNS01ProviderCloudflare), b.(*certmanager.ACMEIssuerDNS01ProviderCloudflare), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ACMEIssuerDNS01ProviderCloudflare)(nil), (*v1alpha2.ACMEIssuerDNS01ProviderCloudflare)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ACMEIssuerDNS01ProviderCloudflare_To_v1alpha2_ACMEIssuerDNS01ProviderCloudflare(a.(*certmanager.ACMEIssuerDNS01ProviderCloudflare), b.(*v1alpha2.ACMEIssuerDNS01ProviderCloudflare), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuerDNS01ProviderDigitalOcean)(nil), (*certmanager.ACMEIssuerDNS01ProviderDigitalOcean)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ACMEIssuerDNS01ProviderDigitalOcean_To_certmanager_ACMEIssuerDNS01ProviderDigitalOcean(a.(*v1alpha2.ACMEIssuerDNS01ProviderDigitalOcean), b.(*certmanager.ACMEIssuerDNS01ProviderDigitalOcean), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ACMEIssuerDNS01ProviderDigitalOcean)(nil), (*v1alpha2.ACMEIssuerDNS01ProviderDigitalOcean)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ACMEIssuerDNS01ProviderDigitalOcean_To_v1alpha2_ACMEIssuerDNS01ProviderDigitalOcean(a.(*certmanager.ACMEIssuerDNS01ProviderDigitalOcean), b.(*v1alpha2.ACMEIssuerDNS01ProviderDigitalOcean), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuerDNS01ProviderRFC2136)(nil), (*certmanager.ACMEIssuerDNS01ProviderRFC2136)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ACMEIssuerDNS01ProviderRFC2136_To_certmanager_ACMEIssuerDNS01ProviderRFC2136(a.(*v1alpha2.ACMEIssuerDNS01ProviderRFC2136), b.(*certmanager.ACMEIssuerDNS01ProviderRFC2136), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ACMEIssuerDNS01ProviderRFC2136)(nil), (*v1alpha2.ACMEIssuerDNS01ProviderRFC2136)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ACMEIssuerDNS01ProviderRFC2136_To_v1alpha2_ACMEIssuerDNS01ProviderRFC2136(a.(*certmanager.ACMEIssuerDNS01ProviderRFC2136), b.(*v1alpha2.ACMEIssuerDNS01ProviderRFC2136), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuerDNS01ProviderRoute53)(nil), (*certmanager.ACMEIssuerDNS01ProviderRoute53)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ACMEIssuerDNS01ProviderRoute53_To_certmanager_ACMEIssuerDNS01ProviderRoute53(a.(*v1alpha2.ACMEIssuerDNS01ProviderRoute53), b.(*certmanager.ACMEIssuerDNS01ProviderRoute53), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ACMEIssuerDNS01ProviderRoute53)(nil), (*v1alpha2.ACMEIssuerDNS01ProviderRoute53)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ACMEIssuerDNS01ProviderRoute53_To_v1alpha2_ACMEIssuerDNS01ProviderRoute53(a.(*certmanager.ACMEIssuerDNS01ProviderRoute53), b.(*v1alpha2.ACMEIssuerDNS01ProviderRoute53), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuerDNS01ProviderWebhook)(nil), (*certmanager.ACMEIssuerDNS01ProviderWebhook)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ACMEIssuerDNS01ProviderWebhook_To_certmanager_ACMEIssuerDNS01ProviderWebhook(a.(*v1alpha2.ACMEIssuerDNS01ProviderWebhook), b.(*certmanager.ACMEIssuerDNS01ProviderWebhook), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ACMEIssuerDNS01ProviderWebhook)(nil), (*v1alpha2.ACMEIssuerDNS01ProviderWebhook)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ACMEIssuerDNS01ProviderWebhook_To_v1alpha2_ACMEIssuerDNS01ProviderWebhook(a.(*certmanager.ACMEIssuerDNS01ProviderWebhook), b.(*v1alpha2.ACMEIssuerDNS01ProviderWebhook), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ACMEIssuerStatus)(nil), (*certmanager.ACMEIssuerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ACMEIssuerStatus_To_certmanager_ACMEIssuerStatus(a.(*v1alpha2.ACMEIssuerStatus), b.(*certmanager.ACMEIssuerStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ACMEIssuerStatus)(nil), (*v1alpha2.ACMEIssuerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ACMEIssuerStatus_To_v1alpha2_ACMEIssuerStatus(a.(*certmanager.ACMEIssuerStatus), b.(*v1alpha2.ACMEIssuerStatus), scope) - }); err != nil { - return err - } if err := s.AddGeneratedConversionFunc((*v1alpha2.CAIssuer)(nil), (*certmanager.CAIssuer)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha2_CAIssuer_To_certmanager_CAIssuer(a.(*v1alpha2.CAIssuer), b.(*certmanager.CAIssuer), scope) }); err != nil { @@ -261,16 +71,6 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.CertificateDNSNameSelector)(nil), (*certmanager.CertificateDNSNameSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_CertificateDNSNameSelector_To_certmanager_CertificateDNSNameSelector(a.(*v1alpha2.CertificateDNSNameSelector), b.(*certmanager.CertificateDNSNameSelector), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.CertificateDNSNameSelector)(nil), (*v1alpha2.CertificateDNSNameSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_CertificateDNSNameSelector_To_v1alpha2_CertificateDNSNameSelector(a.(*certmanager.CertificateDNSNameSelector), b.(*v1alpha2.CertificateDNSNameSelector), scope) - }); err != nil { - return err - } if err := s.AddGeneratedConversionFunc((*v1alpha2.CertificateList)(nil), (*certmanager.CertificateList)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha2_CertificateList_To_certmanager_CertificateList(a.(*v1alpha2.CertificateList), b.(*certmanager.CertificateList), scope) }); err != nil { @@ -351,46 +151,6 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.Challenge)(nil), (*certmanager.Challenge)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_Challenge_To_certmanager_Challenge(a.(*v1alpha2.Challenge), b.(*certmanager.Challenge), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.Challenge)(nil), (*v1alpha2.Challenge)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_Challenge_To_v1alpha2_Challenge(a.(*certmanager.Challenge), b.(*v1alpha2.Challenge), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ChallengeList)(nil), (*certmanager.ChallengeList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ChallengeList_To_certmanager_ChallengeList(a.(*v1alpha2.ChallengeList), b.(*certmanager.ChallengeList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ChallengeList)(nil), (*v1alpha2.ChallengeList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ChallengeList_To_v1alpha2_ChallengeList(a.(*certmanager.ChallengeList), b.(*v1alpha2.ChallengeList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ChallengeSpec)(nil), (*certmanager.ChallengeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ChallengeSpec_To_certmanager_ChallengeSpec(a.(*v1alpha2.ChallengeSpec), b.(*certmanager.ChallengeSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ChallengeSpec)(nil), (*v1alpha2.ChallengeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ChallengeSpec_To_v1alpha2_ChallengeSpec(a.(*certmanager.ChallengeSpec), b.(*v1alpha2.ChallengeSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ChallengeStatus)(nil), (*certmanager.ChallengeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ChallengeStatus_To_certmanager_ChallengeStatus(a.(*v1alpha2.ChallengeStatus), b.(*certmanager.ChallengeStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.ChallengeStatus)(nil), (*v1alpha2.ChallengeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_ChallengeStatus_To_v1alpha2_ChallengeStatus(a.(*certmanager.ChallengeStatus), b.(*v1alpha2.ChallengeStatus), scope) - }); err != nil { - return err - } if err := s.AddGeneratedConversionFunc((*v1alpha2.ClusterIssuer)(nil), (*certmanager.ClusterIssuer)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha2_ClusterIssuer_To_certmanager_ClusterIssuer(a.(*v1alpha2.ClusterIssuer), b.(*certmanager.ClusterIssuer), scope) }); err != nil { @@ -471,46 +231,6 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.Order)(nil), (*certmanager.Order)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_Order_To_certmanager_Order(a.(*v1alpha2.Order), b.(*certmanager.Order), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.Order)(nil), (*v1alpha2.Order)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_Order_To_v1alpha2_Order(a.(*certmanager.Order), b.(*v1alpha2.Order), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.OrderList)(nil), (*certmanager.OrderList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_OrderList_To_certmanager_OrderList(a.(*v1alpha2.OrderList), b.(*certmanager.OrderList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.OrderList)(nil), (*v1alpha2.OrderList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_OrderList_To_v1alpha2_OrderList(a.(*certmanager.OrderList), b.(*v1alpha2.OrderList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.OrderSpec)(nil), (*certmanager.OrderSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_OrderSpec_To_certmanager_OrderSpec(a.(*v1alpha2.OrderSpec), b.(*certmanager.OrderSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.OrderSpec)(nil), (*v1alpha2.OrderSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_OrderSpec_To_v1alpha2_OrderSpec(a.(*certmanager.OrderSpec), b.(*v1alpha2.OrderSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.OrderStatus)(nil), (*certmanager.OrderStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_OrderStatus_To_certmanager_OrderStatus(a.(*v1alpha2.OrderStatus), b.(*certmanager.OrderStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.OrderStatus)(nil), (*v1alpha2.OrderStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_OrderStatus_To_v1alpha2_OrderStatus(a.(*certmanager.OrderStatus), b.(*v1alpha2.OrderStatus), scope) - }); err != nil { - return err - } if err := s.AddGeneratedConversionFunc((*v1alpha2.SelfSignedIssuer)(nil), (*certmanager.SelfSignedIssuer)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha2_SelfSignedIssuer_To_certmanager_SelfSignedIssuer(a.(*v1alpha2.SelfSignedIssuer), b.(*certmanager.SelfSignedIssuer), scope) }); err != nil { @@ -531,605 +251,59 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VaultAuth)(nil), (*certmanager.VaultAuth)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VaultAuth_To_certmanager_VaultAuth(a.(*v1alpha2.VaultAuth), b.(*certmanager.VaultAuth), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.VaultAuth)(nil), (*v1alpha2.VaultAuth)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_VaultAuth_To_v1alpha2_VaultAuth(a.(*certmanager.VaultAuth), b.(*v1alpha2.VaultAuth), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VaultIssuer)(nil), (*certmanager.VaultIssuer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VaultIssuer_To_certmanager_VaultIssuer(a.(*v1alpha2.VaultIssuer), b.(*certmanager.VaultIssuer), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.VaultIssuer)(nil), (*v1alpha2.VaultIssuer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_VaultIssuer_To_v1alpha2_VaultIssuer(a.(*certmanager.VaultIssuer), b.(*v1alpha2.VaultIssuer), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VenafiCloud)(nil), (*certmanager.VenafiCloud)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VenafiCloud_To_certmanager_VenafiCloud(a.(*v1alpha2.VenafiCloud), b.(*certmanager.VenafiCloud), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.VenafiCloud)(nil), (*v1alpha2.VenafiCloud)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_VenafiCloud_To_v1alpha2_VenafiCloud(a.(*certmanager.VenafiCloud), b.(*v1alpha2.VenafiCloud), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VenafiIssuer)(nil), (*certmanager.VenafiIssuer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VenafiIssuer_To_certmanager_VenafiIssuer(a.(*v1alpha2.VenafiIssuer), b.(*certmanager.VenafiIssuer), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.VenafiIssuer)(nil), (*v1alpha2.VenafiIssuer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_VenafiIssuer_To_v1alpha2_VenafiIssuer(a.(*certmanager.VenafiIssuer), b.(*v1alpha2.VenafiIssuer), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VenafiTPP)(nil), (*certmanager.VenafiTPP)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VenafiTPP_To_certmanager_VenafiTPP(a.(*v1alpha2.VenafiTPP), b.(*certmanager.VenafiTPP), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*certmanager.VenafiTPP)(nil), (*v1alpha2.VenafiTPP)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_VenafiTPP_To_v1alpha2_VenafiTPP(a.(*certmanager.VenafiTPP), b.(*v1alpha2.VenafiTPP), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha2_ACMEAuthorization_To_certmanager_ACMEAuthorization(in *v1alpha2.ACMEAuthorization, out *certmanager.ACMEAuthorization, s conversion.Scope) error { - out.URL = in.URL - out.Identifier = in.Identifier - out.Wildcard = in.Wildcard - out.Challenges = *(*[]certmanager.ACMEChallenge)(unsafe.Pointer(&in.Challenges)) - return nil -} - -// Convert_v1alpha2_ACMEAuthorization_To_certmanager_ACMEAuthorization is an autogenerated conversion function. -func Convert_v1alpha2_ACMEAuthorization_To_certmanager_ACMEAuthorization(in *v1alpha2.ACMEAuthorization, out *certmanager.ACMEAuthorization, s conversion.Scope) error { - return autoConvert_v1alpha2_ACMEAuthorization_To_certmanager_ACMEAuthorization(in, out, s) -} - -func autoConvert_certmanager_ACMEAuthorization_To_v1alpha2_ACMEAuthorization(in *certmanager.ACMEAuthorization, out *v1alpha2.ACMEAuthorization, s conversion.Scope) error { - out.URL = in.URL - out.Identifier = in.Identifier - out.Wildcard = in.Wildcard - out.Challenges = *(*[]v1alpha2.ACMEChallenge)(unsafe.Pointer(&in.Challenges)) - return nil -} - -// Convert_certmanager_ACMEAuthorization_To_v1alpha2_ACMEAuthorization is an autogenerated conversion function. -func Convert_certmanager_ACMEAuthorization_To_v1alpha2_ACMEAuthorization(in *certmanager.ACMEAuthorization, out *v1alpha2.ACMEAuthorization, s conversion.Scope) error { - return autoConvert_certmanager_ACMEAuthorization_To_v1alpha2_ACMEAuthorization(in, out, s) -} - -func autoConvert_v1alpha2_ACMEChallenge_To_certmanager_ACMEChallenge(in *v1alpha2.ACMEChallenge, out *certmanager.ACMEChallenge, s conversion.Scope) error { - out.URL = in.URL - out.Token = in.Token - out.Type = certmanager.ACMEChallengeType(in.Type) - return nil -} - -// Convert_v1alpha2_ACMEChallenge_To_certmanager_ACMEChallenge is an autogenerated conversion function. -func Convert_v1alpha2_ACMEChallenge_To_certmanager_ACMEChallenge(in *v1alpha2.ACMEChallenge, out *certmanager.ACMEChallenge, s conversion.Scope) error { - return autoConvert_v1alpha2_ACMEChallenge_To_certmanager_ACMEChallenge(in, out, s) -} - -func autoConvert_certmanager_ACMEChallenge_To_v1alpha2_ACMEChallenge(in *certmanager.ACMEChallenge, out *v1alpha2.ACMEChallenge, s conversion.Scope) error { - out.URL = in.URL - out.Token = in.Token - out.Type = v1alpha2.ACMEChallengeType(in.Type) - return nil -} - -// Convert_certmanager_ACMEChallenge_To_v1alpha2_ACMEChallenge is an autogenerated conversion function. -func Convert_certmanager_ACMEChallenge_To_v1alpha2_ACMEChallenge(in *certmanager.ACMEChallenge, out *v1alpha2.ACMEChallenge, s conversion.Scope) error { - return autoConvert_certmanager_ACMEChallenge_To_v1alpha2_ACMEChallenge(in, out, s) -} - -func autoConvert_v1alpha2_ACMEChallengeSolver_To_certmanager_ACMEChallengeSolver(in *v1alpha2.ACMEChallengeSolver, out *certmanager.ACMEChallengeSolver, s conversion.Scope) error { - out.Selector = (*certmanager.CertificateDNSNameSelector)(unsafe.Pointer(in.Selector)) - out.HTTP01 = (*certmanager.ACMEChallengeSolverHTTP01)(unsafe.Pointer(in.HTTP01)) - out.DNS01 = (*certmanager.ACMEChallengeSolverDNS01)(unsafe.Pointer(in.DNS01)) - return nil -} - -// Convert_v1alpha2_ACMEChallengeSolver_To_certmanager_ACMEChallengeSolver is an autogenerated conversion function. -func Convert_v1alpha2_ACMEChallengeSolver_To_certmanager_ACMEChallengeSolver(in *v1alpha2.ACMEChallengeSolver, out *certmanager.ACMEChallengeSolver, s conversion.Scope) error { - return autoConvert_v1alpha2_ACMEChallengeSolver_To_certmanager_ACMEChallengeSolver(in, out, s) -} - -func autoConvert_certmanager_ACMEChallengeSolver_To_v1alpha2_ACMEChallengeSolver(in *certmanager.ACMEChallengeSolver, out *v1alpha2.ACMEChallengeSolver, s conversion.Scope) error { - out.Selector = (*v1alpha2.CertificateDNSNameSelector)(unsafe.Pointer(in.Selector)) - out.HTTP01 = (*v1alpha2.ACMEChallengeSolverHTTP01)(unsafe.Pointer(in.HTTP01)) - out.DNS01 = (*v1alpha2.ACMEChallengeSolverDNS01)(unsafe.Pointer(in.DNS01)) - return nil -} - -// Convert_certmanager_ACMEChallengeSolver_To_v1alpha2_ACMEChallengeSolver is an autogenerated conversion function. -func Convert_certmanager_ACMEChallengeSolver_To_v1alpha2_ACMEChallengeSolver(in *certmanager.ACMEChallengeSolver, out *v1alpha2.ACMEChallengeSolver, s conversion.Scope) error { - return autoConvert_certmanager_ACMEChallengeSolver_To_v1alpha2_ACMEChallengeSolver(in, out, s) -} - -func autoConvert_v1alpha2_ACMEChallengeSolverDNS01_To_certmanager_ACMEChallengeSolverDNS01(in *v1alpha2.ACMEChallengeSolverDNS01, out *certmanager.ACMEChallengeSolverDNS01, s conversion.Scope) error { - out.CNAMEStrategy = certmanager.CNAMEStrategy(in.CNAMEStrategy) - out.Akamai = (*certmanager.ACMEIssuerDNS01ProviderAkamai)(unsafe.Pointer(in.Akamai)) - out.CloudDNS = (*certmanager.ACMEIssuerDNS01ProviderCloudDNS)(unsafe.Pointer(in.CloudDNS)) - out.Cloudflare = (*certmanager.ACMEIssuerDNS01ProviderCloudflare)(unsafe.Pointer(in.Cloudflare)) - out.Route53 = (*certmanager.ACMEIssuerDNS01ProviderRoute53)(unsafe.Pointer(in.Route53)) - out.AzureDNS = (*certmanager.ACMEIssuerDNS01ProviderAzureDNS)(unsafe.Pointer(in.AzureDNS)) - out.DigitalOcean = (*certmanager.ACMEIssuerDNS01ProviderDigitalOcean)(unsafe.Pointer(in.DigitalOcean)) - out.AcmeDNS = (*certmanager.ACMEIssuerDNS01ProviderAcmeDNS)(unsafe.Pointer(in.AcmeDNS)) - out.RFC2136 = (*certmanager.ACMEIssuerDNS01ProviderRFC2136)(unsafe.Pointer(in.RFC2136)) - out.Webhook = (*certmanager.ACMEIssuerDNS01ProviderWebhook)(unsafe.Pointer(in.Webhook)) - return nil -} - -// Convert_v1alpha2_ACMEChallengeSolverDNS01_To_certmanager_ACMEChallengeSolverDNS01 is an autogenerated conversion function. -func Convert_v1alpha2_ACMEChallengeSolverDNS01_To_certmanager_ACMEChallengeSolverDNS01(in *v1alpha2.ACMEChallengeSolverDNS01, out *certmanager.ACMEChallengeSolverDNS01, s conversion.Scope) error { - return autoConvert_v1alpha2_ACMEChallengeSolverDNS01_To_certmanager_ACMEChallengeSolverDNS01(in, out, s) -} - -func autoConvert_certmanager_ACMEChallengeSolverDNS01_To_v1alpha2_ACMEChallengeSolverDNS01(in *certmanager.ACMEChallengeSolverDNS01, out *v1alpha2.ACMEChallengeSolverDNS01, s conversion.Scope) error { - out.CNAMEStrategy = v1alpha2.CNAMEStrategy(in.CNAMEStrategy) - out.Akamai = (*v1alpha2.ACMEIssuerDNS01ProviderAkamai)(unsafe.Pointer(in.Akamai)) - out.CloudDNS = (*v1alpha2.ACMEIssuerDNS01ProviderCloudDNS)(unsafe.Pointer(in.CloudDNS)) - out.Cloudflare = (*v1alpha2.ACMEIssuerDNS01ProviderCloudflare)(unsafe.Pointer(in.Cloudflare)) - out.Route53 = (*v1alpha2.ACMEIssuerDNS01ProviderRoute53)(unsafe.Pointer(in.Route53)) - out.AzureDNS = (*v1alpha2.ACMEIssuerDNS01ProviderAzureDNS)(unsafe.Pointer(in.AzureDNS)) - out.DigitalOcean = (*v1alpha2.ACMEIssuerDNS01ProviderDigitalOcean)(unsafe.Pointer(in.DigitalOcean)) - out.AcmeDNS = (*v1alpha2.ACMEIssuerDNS01ProviderAcmeDNS)(unsafe.Pointer(in.AcmeDNS)) - out.RFC2136 = (*v1alpha2.ACMEIssuerDNS01ProviderRFC2136)(unsafe.Pointer(in.RFC2136)) - out.Webhook = (*v1alpha2.ACMEIssuerDNS01ProviderWebhook)(unsafe.Pointer(in.Webhook)) - return nil -} - -// Convert_certmanager_ACMEChallengeSolverDNS01_To_v1alpha2_ACMEChallengeSolverDNS01 is an autogenerated conversion function. -func Convert_certmanager_ACMEChallengeSolverDNS01_To_v1alpha2_ACMEChallengeSolverDNS01(in *certmanager.ACMEChallengeSolverDNS01, out *v1alpha2.ACMEChallengeSolverDNS01, s conversion.Scope) error { - return autoConvert_certmanager_ACMEChallengeSolverDNS01_To_v1alpha2_ACMEChallengeSolverDNS01(in, out, s) -} - -func autoConvert_v1alpha2_ACMEChallengeSolverHTTP01_To_certmanager_ACMEChallengeSolverHTTP01(in *v1alpha2.ACMEChallengeSolverHTTP01, out *certmanager.ACMEChallengeSolverHTTP01, s conversion.Scope) error { - out.Ingress = (*certmanager.ACMEChallengeSolverHTTP01Ingress)(unsafe.Pointer(in.Ingress)) - return nil -} - -// Convert_v1alpha2_ACMEChallengeSolverHTTP01_To_certmanager_ACMEChallengeSolverHTTP01 is an autogenerated conversion function. -func Convert_v1alpha2_ACMEChallengeSolverHTTP01_To_certmanager_ACMEChallengeSolverHTTP01(in *v1alpha2.ACMEChallengeSolverHTTP01, out *certmanager.ACMEChallengeSolverHTTP01, s conversion.Scope) error { - return autoConvert_v1alpha2_ACMEChallengeSolverHTTP01_To_certmanager_ACMEChallengeSolverHTTP01(in, out, s) -} - -func autoConvert_certmanager_ACMEChallengeSolverHTTP01_To_v1alpha2_ACMEChallengeSolverHTTP01(in *certmanager.ACMEChallengeSolverHTTP01, out *v1alpha2.ACMEChallengeSolverHTTP01, s conversion.Scope) error { - out.Ingress = (*v1alpha2.ACMEChallengeSolverHTTP01Ingress)(unsafe.Pointer(in.Ingress)) - return nil -} - -// Convert_certmanager_ACMEChallengeSolverHTTP01_To_v1alpha2_ACMEChallengeSolverHTTP01 is an autogenerated conversion function. -func Convert_certmanager_ACMEChallengeSolverHTTP01_To_v1alpha2_ACMEChallengeSolverHTTP01(in *certmanager.ACMEChallengeSolverHTTP01, out *v1alpha2.ACMEChallengeSolverHTTP01, s conversion.Scope) error { - return autoConvert_certmanager_ACMEChallengeSolverHTTP01_To_v1alpha2_ACMEChallengeSolverHTTP01(in, out, s) -} - -func autoConvert_v1alpha2_ACMEChallengeSolverHTTP01Ingress_To_certmanager_ACMEChallengeSolverHTTP01Ingress(in *v1alpha2.ACMEChallengeSolverHTTP01Ingress, out *certmanager.ACMEChallengeSolverHTTP01Ingress, s conversion.Scope) error { - out.ServiceType = v1.ServiceType(in.ServiceType) - out.Class = (*string)(unsafe.Pointer(in.Class)) - out.Name = in.Name - out.PodTemplate = (*certmanager.ACMEChallengeSolverHTTP01IngressPodTemplate)(unsafe.Pointer(in.PodTemplate)) - return nil -} - -// Convert_v1alpha2_ACMEChallengeSolverHTTP01Ingress_To_certmanager_ACMEChallengeSolverHTTP01Ingress is an autogenerated conversion function. -func Convert_v1alpha2_ACMEChallengeSolverHTTP01Ingress_To_certmanager_ACMEChallengeSolverHTTP01Ingress(in *v1alpha2.ACMEChallengeSolverHTTP01Ingress, out *certmanager.ACMEChallengeSolverHTTP01Ingress, s conversion.Scope) error { - return autoConvert_v1alpha2_ACMEChallengeSolverHTTP01Ingress_To_certmanager_ACMEChallengeSolverHTTP01Ingress(in, out, s) -} - -func autoConvert_certmanager_ACMEChallengeSolverHTTP01Ingress_To_v1alpha2_ACMEChallengeSolverHTTP01Ingress(in *certmanager.ACMEChallengeSolverHTTP01Ingress, out *v1alpha2.ACMEChallengeSolverHTTP01Ingress, s conversion.Scope) error { - out.ServiceType = v1.ServiceType(in.ServiceType) - out.Class = (*string)(unsafe.Pointer(in.Class)) - out.Name = in.Name - out.PodTemplate = (*v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate)(unsafe.Pointer(in.PodTemplate)) - return nil -} - -// Convert_certmanager_ACMEChallengeSolverHTTP01Ingress_To_v1alpha2_ACMEChallengeSolverHTTP01Ingress is an autogenerated conversion function. -func Convert_certmanager_ACMEChallengeSolverHTTP01Ingress_To_v1alpha2_ACMEChallengeSolverHTTP01Ingress(in *certmanager.ACMEChallengeSolverHTTP01Ingress, out *v1alpha2.ACMEChallengeSolverHTTP01Ingress, s conversion.Scope) error { - return autoConvert_certmanager_ACMEChallengeSolverHTTP01Ingress_To_v1alpha2_ACMEChallengeSolverHTTP01Ingress(in, out, s) -} - -func autoConvert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec_To_certmanager_ACMEChallengeSolverHTTP01IngressPodSpec(in *v1alpha2.ACMEChallengeSolverHTTP01IngressPodSpec, out *certmanager.ACMEChallengeSolverHTTP01IngressPodSpec, s conversion.Scope) error { - out.NodeSelector = *(*map[string]string)(unsafe.Pointer(&in.NodeSelector)) - out.Affinity = (*v1.Affinity)(unsafe.Pointer(in.Affinity)) - out.Tolerations = *(*[]v1.Toleration)(unsafe.Pointer(&in.Tolerations)) - return nil -} - -// Convert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec_To_certmanager_ACMEChallengeSolverHTTP01IngressPodSpec is an autogenerated conversion function. -func Convert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec_To_certmanager_ACMEChallengeSolverHTTP01IngressPodSpec(in *v1alpha2.ACMEChallengeSolverHTTP01IngressPodSpec, out *certmanager.ACMEChallengeSolverHTTP01IngressPodSpec, s conversion.Scope) error { - return autoConvert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec_To_certmanager_ACMEChallengeSolverHTTP01IngressPodSpec(in, out, s) -} - -func autoConvert_certmanager_ACMEChallengeSolverHTTP01IngressPodSpec_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec(in *certmanager.ACMEChallengeSolverHTTP01IngressPodSpec, out *v1alpha2.ACMEChallengeSolverHTTP01IngressPodSpec, s conversion.Scope) error { - out.NodeSelector = *(*map[string]string)(unsafe.Pointer(&in.NodeSelector)) - out.Affinity = (*v1.Affinity)(unsafe.Pointer(in.Affinity)) - out.Tolerations = *(*[]v1.Toleration)(unsafe.Pointer(&in.Tolerations)) - return nil -} - -// Convert_certmanager_ACMEChallengeSolverHTTP01IngressPodSpec_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec is an autogenerated conversion function. -func Convert_certmanager_ACMEChallengeSolverHTTP01IngressPodSpec_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec(in *certmanager.ACMEChallengeSolverHTTP01IngressPodSpec, out *v1alpha2.ACMEChallengeSolverHTTP01IngressPodSpec, s conversion.Scope) error { - return autoConvert_certmanager_ACMEChallengeSolverHTTP01IngressPodSpec_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec(in, out, s) -} - -func autoConvert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodTemplate_To_certmanager_ACMEChallengeSolverHTTP01IngressPodTemplate(in *v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate, out *certmanager.ACMEChallengeSolverHTTP01IngressPodTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec_To_certmanager_ACMEChallengeSolverHTTP01IngressPodSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodTemplate_To_certmanager_ACMEChallengeSolverHTTP01IngressPodTemplate is an autogenerated conversion function. -func Convert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodTemplate_To_certmanager_ACMEChallengeSolverHTTP01IngressPodTemplate(in *v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate, out *certmanager.ACMEChallengeSolverHTTP01IngressPodTemplate, s conversion.Scope) error { - return autoConvert_v1alpha2_ACMEChallengeSolverHTTP01IngressPodTemplate_To_certmanager_ACMEChallengeSolverHTTP01IngressPodTemplate(in, out, s) -} - -func autoConvert_certmanager_ACMEChallengeSolverHTTP01IngressPodTemplate_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodTemplate(in *certmanager.ACMEChallengeSolverHTTP01IngressPodTemplate, out *v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_certmanager_ACMEChallengeSolverHTTP01IngressPodSpec_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_certmanager_ACMEChallengeSolverHTTP01IngressPodTemplate_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodTemplate is an autogenerated conversion function. -func Convert_certmanager_ACMEChallengeSolverHTTP01IngressPodTemplate_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodTemplate(in *certmanager.ACMEChallengeSolverHTTP01IngressPodTemplate, out *v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate, s conversion.Scope) error { - return autoConvert_certmanager_ACMEChallengeSolverHTTP01IngressPodTemplate_To_v1alpha2_ACMEChallengeSolverHTTP01IngressPodTemplate(in, out, s) -} - -func autoConvert_v1alpha2_ACMEIssuer_To_certmanager_ACMEIssuer(in *v1alpha2.ACMEIssuer, out *certmanager.ACMEIssuer, s conversion.Scope) error { - out.Email = in.Email - out.Server = in.Server - out.SkipTLSVerify = in.SkipTLSVerify - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.PrivateKey, &out.PrivateKey, 0); err != nil { - return err - } - out.Solvers = *(*[]certmanager.ACMEChallengeSolver)(unsafe.Pointer(&in.Solvers)) - return nil -} - -// Convert_v1alpha2_ACMEIssuer_To_certmanager_ACMEIssuer is an autogenerated conversion function. -func Convert_v1alpha2_ACMEIssuer_To_certmanager_ACMEIssuer(in *v1alpha2.ACMEIssuer, out *certmanager.ACMEIssuer, s conversion.Scope) error { - return autoConvert_v1alpha2_ACMEIssuer_To_certmanager_ACMEIssuer(in, out, s) -} - -func autoConvert_certmanager_ACMEIssuer_To_v1alpha2_ACMEIssuer(in *certmanager.ACMEIssuer, out *v1alpha2.ACMEIssuer, s conversion.Scope) error { - out.Email = in.Email - out.Server = in.Server - out.SkipTLSVerify = in.SkipTLSVerify - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.PrivateKey, &out.PrivateKey, 0); err != nil { - return err - } - out.Solvers = *(*[]v1alpha2.ACMEChallengeSolver)(unsafe.Pointer(&in.Solvers)) - return nil -} - -// Convert_certmanager_ACMEIssuer_To_v1alpha2_ACMEIssuer is an autogenerated conversion function. -func Convert_certmanager_ACMEIssuer_To_v1alpha2_ACMEIssuer(in *certmanager.ACMEIssuer, out *v1alpha2.ACMEIssuer, s conversion.Scope) error { - return autoConvert_certmanager_ACMEIssuer_To_v1alpha2_ACMEIssuer(in, out, s) -} - -func autoConvert_v1alpha2_ACMEIssuerDNS01ProviderAcmeDNS_To_certmanager_ACMEIssuerDNS01ProviderAcmeDNS(in *v1alpha2.ACMEIssuerDNS01ProviderAcmeDNS, out *certmanager.ACMEIssuerDNS01ProviderAcmeDNS, s conversion.Scope) error { - out.Host = in.Host - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.AccountSecret, &out.AccountSecret, 0); err != nil { - return err - } - return nil -} - -// Convert_v1alpha2_ACMEIssuerDNS01ProviderAcmeDNS_To_certmanager_ACMEIssuerDNS01ProviderAcmeDNS is an autogenerated conversion function. -func Convert_v1alpha2_ACMEIssuerDNS01ProviderAcmeDNS_To_certmanager_ACMEIssuerDNS01ProviderAcmeDNS(in *v1alpha2.ACMEIssuerDNS01ProviderAcmeDNS, out *certmanager.ACMEIssuerDNS01ProviderAcmeDNS, s conversion.Scope) error { - return autoConvert_v1alpha2_ACMEIssuerDNS01ProviderAcmeDNS_To_certmanager_ACMEIssuerDNS01ProviderAcmeDNS(in, out, s) -} - -func autoConvert_certmanager_ACMEIssuerDNS01ProviderAcmeDNS_To_v1alpha2_ACMEIssuerDNS01ProviderAcmeDNS(in *certmanager.ACMEIssuerDNS01ProviderAcmeDNS, out *v1alpha2.ACMEIssuerDNS01ProviderAcmeDNS, s conversion.Scope) error { - out.Host = in.Host - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.AccountSecret, &out.AccountSecret, 0); err != nil { - return err - } - return nil -} - -// Convert_certmanager_ACMEIssuerDNS01ProviderAcmeDNS_To_v1alpha2_ACMEIssuerDNS01ProviderAcmeDNS is an autogenerated conversion function. -func Convert_certmanager_ACMEIssuerDNS01ProviderAcmeDNS_To_v1alpha2_ACMEIssuerDNS01ProviderAcmeDNS(in *certmanager.ACMEIssuerDNS01ProviderAcmeDNS, out *v1alpha2.ACMEIssuerDNS01ProviderAcmeDNS, s conversion.Scope) error { - return autoConvert_certmanager_ACMEIssuerDNS01ProviderAcmeDNS_To_v1alpha2_ACMEIssuerDNS01ProviderAcmeDNS(in, out, s) -} - -func autoConvert_v1alpha2_ACMEIssuerDNS01ProviderAkamai_To_certmanager_ACMEIssuerDNS01ProviderAkamai(in *v1alpha2.ACMEIssuerDNS01ProviderAkamai, out *certmanager.ACMEIssuerDNS01ProviderAkamai, s conversion.Scope) error { - out.ServiceConsumerDomain = in.ServiceConsumerDomain - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ClientToken, &out.ClientToken, 0); err != nil { - return err - } - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ClientSecret, &out.ClientSecret, 0); err != nil { - return err - } - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.AccessToken, &out.AccessToken, 0); err != nil { - return err - } - return nil -} - -// Convert_v1alpha2_ACMEIssuerDNS01ProviderAkamai_To_certmanager_ACMEIssuerDNS01ProviderAkamai is an autogenerated conversion function. -func Convert_v1alpha2_ACMEIssuerDNS01ProviderAkamai_To_certmanager_ACMEIssuerDNS01ProviderAkamai(in *v1alpha2.ACMEIssuerDNS01ProviderAkamai, out *certmanager.ACMEIssuerDNS01ProviderAkamai, s conversion.Scope) error { - return autoConvert_v1alpha2_ACMEIssuerDNS01ProviderAkamai_To_certmanager_ACMEIssuerDNS01ProviderAkamai(in, out, s) -} - -func autoConvert_certmanager_ACMEIssuerDNS01ProviderAkamai_To_v1alpha2_ACMEIssuerDNS01ProviderAkamai(in *certmanager.ACMEIssuerDNS01ProviderAkamai, out *v1alpha2.ACMEIssuerDNS01ProviderAkamai, s conversion.Scope) error { - out.ServiceConsumerDomain = in.ServiceConsumerDomain - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ClientToken, &out.ClientToken, 0); err != nil { - return err - } - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ClientSecret, &out.ClientSecret, 0); err != nil { - return err - } - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.AccessToken, &out.AccessToken, 0); err != nil { - return err - } - return nil -} - -// Convert_certmanager_ACMEIssuerDNS01ProviderAkamai_To_v1alpha2_ACMEIssuerDNS01ProviderAkamai is an autogenerated conversion function. -func Convert_certmanager_ACMEIssuerDNS01ProviderAkamai_To_v1alpha2_ACMEIssuerDNS01ProviderAkamai(in *certmanager.ACMEIssuerDNS01ProviderAkamai, out *v1alpha2.ACMEIssuerDNS01ProviderAkamai, s conversion.Scope) error { - return autoConvert_certmanager_ACMEIssuerDNS01ProviderAkamai_To_v1alpha2_ACMEIssuerDNS01ProviderAkamai(in, out, s) -} - -func autoConvert_v1alpha2_ACMEIssuerDNS01ProviderAzureDNS_To_certmanager_ACMEIssuerDNS01ProviderAzureDNS(in *v1alpha2.ACMEIssuerDNS01ProviderAzureDNS, out *certmanager.ACMEIssuerDNS01ProviderAzureDNS, s conversion.Scope) error { - out.ClientID = in.ClientID - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ClientSecret, &out.ClientSecret, 0); err != nil { - return err - } - out.SubscriptionID = in.SubscriptionID - out.TenantID = in.TenantID - out.ResourceGroupName = in.ResourceGroupName - out.HostedZoneName = in.HostedZoneName - out.Environment = certmanager.AzureDNSEnvironment(in.Environment) - return nil -} - -// Convert_v1alpha2_ACMEIssuerDNS01ProviderAzureDNS_To_certmanager_ACMEIssuerDNS01ProviderAzureDNS is an autogenerated conversion function. -func Convert_v1alpha2_ACMEIssuerDNS01ProviderAzureDNS_To_certmanager_ACMEIssuerDNS01ProviderAzureDNS(in *v1alpha2.ACMEIssuerDNS01ProviderAzureDNS, out *certmanager.ACMEIssuerDNS01ProviderAzureDNS, s conversion.Scope) error { - return autoConvert_v1alpha2_ACMEIssuerDNS01ProviderAzureDNS_To_certmanager_ACMEIssuerDNS01ProviderAzureDNS(in, out, s) -} - -func autoConvert_certmanager_ACMEIssuerDNS01ProviderAzureDNS_To_v1alpha2_ACMEIssuerDNS01ProviderAzureDNS(in *certmanager.ACMEIssuerDNS01ProviderAzureDNS, out *v1alpha2.ACMEIssuerDNS01ProviderAzureDNS, s conversion.Scope) error { - out.ClientID = in.ClientID - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ClientSecret, &out.ClientSecret, 0); err != nil { - return err - } - out.SubscriptionID = in.SubscriptionID - out.TenantID = in.TenantID - out.ResourceGroupName = in.ResourceGroupName - out.HostedZoneName = in.HostedZoneName - out.Environment = v1alpha2.AzureDNSEnvironment(in.Environment) - return nil -} - -// Convert_certmanager_ACMEIssuerDNS01ProviderAzureDNS_To_v1alpha2_ACMEIssuerDNS01ProviderAzureDNS is an autogenerated conversion function. -func Convert_certmanager_ACMEIssuerDNS01ProviderAzureDNS_To_v1alpha2_ACMEIssuerDNS01ProviderAzureDNS(in *certmanager.ACMEIssuerDNS01ProviderAzureDNS, out *v1alpha2.ACMEIssuerDNS01ProviderAzureDNS, s conversion.Scope) error { - return autoConvert_certmanager_ACMEIssuerDNS01ProviderAzureDNS_To_v1alpha2_ACMEIssuerDNS01ProviderAzureDNS(in, out, s) -} - -func autoConvert_v1alpha2_ACMEIssuerDNS01ProviderCloudDNS_To_certmanager_ACMEIssuerDNS01ProviderCloudDNS(in *v1alpha2.ACMEIssuerDNS01ProviderCloudDNS, out *certmanager.ACMEIssuerDNS01ProviderCloudDNS, s conversion.Scope) error { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ServiceAccount, &out.ServiceAccount, 0); err != nil { - return err - } - out.Project = in.Project - return nil -} - -// Convert_v1alpha2_ACMEIssuerDNS01ProviderCloudDNS_To_certmanager_ACMEIssuerDNS01ProviderCloudDNS is an autogenerated conversion function. -func Convert_v1alpha2_ACMEIssuerDNS01ProviderCloudDNS_To_certmanager_ACMEIssuerDNS01ProviderCloudDNS(in *v1alpha2.ACMEIssuerDNS01ProviderCloudDNS, out *certmanager.ACMEIssuerDNS01ProviderCloudDNS, s conversion.Scope) error { - return autoConvert_v1alpha2_ACMEIssuerDNS01ProviderCloudDNS_To_certmanager_ACMEIssuerDNS01ProviderCloudDNS(in, out, s) -} - -func autoConvert_certmanager_ACMEIssuerDNS01ProviderCloudDNS_To_v1alpha2_ACMEIssuerDNS01ProviderCloudDNS(in *certmanager.ACMEIssuerDNS01ProviderCloudDNS, out *v1alpha2.ACMEIssuerDNS01ProviderCloudDNS, s conversion.Scope) error { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ServiceAccount, &out.ServiceAccount, 0); err != nil { + if err := s.AddGeneratedConversionFunc((*v1alpha2.VaultAuth)(nil), (*certmanager.VaultAuth)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VaultAuth_To_certmanager_VaultAuth(a.(*v1alpha2.VaultAuth), b.(*certmanager.VaultAuth), scope) + }); err != nil { return err } - out.Project = in.Project - return nil -} - -// Convert_certmanager_ACMEIssuerDNS01ProviderCloudDNS_To_v1alpha2_ACMEIssuerDNS01ProviderCloudDNS is an autogenerated conversion function. -func Convert_certmanager_ACMEIssuerDNS01ProviderCloudDNS_To_v1alpha2_ACMEIssuerDNS01ProviderCloudDNS(in *certmanager.ACMEIssuerDNS01ProviderCloudDNS, out *v1alpha2.ACMEIssuerDNS01ProviderCloudDNS, s conversion.Scope) error { - return autoConvert_certmanager_ACMEIssuerDNS01ProviderCloudDNS_To_v1alpha2_ACMEIssuerDNS01ProviderCloudDNS(in, out, s) -} - -func autoConvert_v1alpha2_ACMEIssuerDNS01ProviderCloudflare_To_certmanager_ACMEIssuerDNS01ProviderCloudflare(in *v1alpha2.ACMEIssuerDNS01ProviderCloudflare, out *certmanager.ACMEIssuerDNS01ProviderCloudflare, s conversion.Scope) error { - out.Email = in.Email - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.APIKey, &out.APIKey, 0); err != nil { + if err := s.AddGeneratedConversionFunc((*certmanager.VaultAuth)(nil), (*v1alpha2.VaultAuth)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_certmanager_VaultAuth_To_v1alpha2_VaultAuth(a.(*certmanager.VaultAuth), b.(*v1alpha2.VaultAuth), scope) + }); err != nil { return err } - return nil -} - -// Convert_v1alpha2_ACMEIssuerDNS01ProviderCloudflare_To_certmanager_ACMEIssuerDNS01ProviderCloudflare is an autogenerated conversion function. -func Convert_v1alpha2_ACMEIssuerDNS01ProviderCloudflare_To_certmanager_ACMEIssuerDNS01ProviderCloudflare(in *v1alpha2.ACMEIssuerDNS01ProviderCloudflare, out *certmanager.ACMEIssuerDNS01ProviderCloudflare, s conversion.Scope) error { - return autoConvert_v1alpha2_ACMEIssuerDNS01ProviderCloudflare_To_certmanager_ACMEIssuerDNS01ProviderCloudflare(in, out, s) -} - -func autoConvert_certmanager_ACMEIssuerDNS01ProviderCloudflare_To_v1alpha2_ACMEIssuerDNS01ProviderCloudflare(in *certmanager.ACMEIssuerDNS01ProviderCloudflare, out *v1alpha2.ACMEIssuerDNS01ProviderCloudflare, s conversion.Scope) error { - out.Email = in.Email - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.APIKey, &out.APIKey, 0); err != nil { + if err := s.AddGeneratedConversionFunc((*v1alpha2.VaultIssuer)(nil), (*certmanager.VaultIssuer)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VaultIssuer_To_certmanager_VaultIssuer(a.(*v1alpha2.VaultIssuer), b.(*certmanager.VaultIssuer), scope) + }); err != nil { return err } - return nil -} - -// Convert_certmanager_ACMEIssuerDNS01ProviderCloudflare_To_v1alpha2_ACMEIssuerDNS01ProviderCloudflare is an autogenerated conversion function. -func Convert_certmanager_ACMEIssuerDNS01ProviderCloudflare_To_v1alpha2_ACMEIssuerDNS01ProviderCloudflare(in *certmanager.ACMEIssuerDNS01ProviderCloudflare, out *v1alpha2.ACMEIssuerDNS01ProviderCloudflare, s conversion.Scope) error { - return autoConvert_certmanager_ACMEIssuerDNS01ProviderCloudflare_To_v1alpha2_ACMEIssuerDNS01ProviderCloudflare(in, out, s) -} - -func autoConvert_v1alpha2_ACMEIssuerDNS01ProviderDigitalOcean_To_certmanager_ACMEIssuerDNS01ProviderDigitalOcean(in *v1alpha2.ACMEIssuerDNS01ProviderDigitalOcean, out *certmanager.ACMEIssuerDNS01ProviderDigitalOcean, s conversion.Scope) error { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.Token, &out.Token, 0); err != nil { + if err := s.AddGeneratedConversionFunc((*certmanager.VaultIssuer)(nil), (*v1alpha2.VaultIssuer)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_certmanager_VaultIssuer_To_v1alpha2_VaultIssuer(a.(*certmanager.VaultIssuer), b.(*v1alpha2.VaultIssuer), scope) + }); err != nil { return err } - return nil -} - -// Convert_v1alpha2_ACMEIssuerDNS01ProviderDigitalOcean_To_certmanager_ACMEIssuerDNS01ProviderDigitalOcean is an autogenerated conversion function. -func Convert_v1alpha2_ACMEIssuerDNS01ProviderDigitalOcean_To_certmanager_ACMEIssuerDNS01ProviderDigitalOcean(in *v1alpha2.ACMEIssuerDNS01ProviderDigitalOcean, out *certmanager.ACMEIssuerDNS01ProviderDigitalOcean, s conversion.Scope) error { - return autoConvert_v1alpha2_ACMEIssuerDNS01ProviderDigitalOcean_To_certmanager_ACMEIssuerDNS01ProviderDigitalOcean(in, out, s) -} - -func autoConvert_certmanager_ACMEIssuerDNS01ProviderDigitalOcean_To_v1alpha2_ACMEIssuerDNS01ProviderDigitalOcean(in *certmanager.ACMEIssuerDNS01ProviderDigitalOcean, out *v1alpha2.ACMEIssuerDNS01ProviderDigitalOcean, s conversion.Scope) error { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.Token, &out.Token, 0); err != nil { + if err := s.AddGeneratedConversionFunc((*v1alpha2.VenafiCloud)(nil), (*certmanager.VenafiCloud)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VenafiCloud_To_certmanager_VenafiCloud(a.(*v1alpha2.VenafiCloud), b.(*certmanager.VenafiCloud), scope) + }); err != nil { return err } - return nil -} - -// Convert_certmanager_ACMEIssuerDNS01ProviderDigitalOcean_To_v1alpha2_ACMEIssuerDNS01ProviderDigitalOcean is an autogenerated conversion function. -func Convert_certmanager_ACMEIssuerDNS01ProviderDigitalOcean_To_v1alpha2_ACMEIssuerDNS01ProviderDigitalOcean(in *certmanager.ACMEIssuerDNS01ProviderDigitalOcean, out *v1alpha2.ACMEIssuerDNS01ProviderDigitalOcean, s conversion.Scope) error { - return autoConvert_certmanager_ACMEIssuerDNS01ProviderDigitalOcean_To_v1alpha2_ACMEIssuerDNS01ProviderDigitalOcean(in, out, s) -} - -func autoConvert_v1alpha2_ACMEIssuerDNS01ProviderRFC2136_To_certmanager_ACMEIssuerDNS01ProviderRFC2136(in *v1alpha2.ACMEIssuerDNS01ProviderRFC2136, out *certmanager.ACMEIssuerDNS01ProviderRFC2136, s conversion.Scope) error { - out.Nameserver = in.Nameserver - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.TSIGSecret, &out.TSIGSecret, 0); err != nil { + if err := s.AddGeneratedConversionFunc((*certmanager.VenafiCloud)(nil), (*v1alpha2.VenafiCloud)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_certmanager_VenafiCloud_To_v1alpha2_VenafiCloud(a.(*certmanager.VenafiCloud), b.(*v1alpha2.VenafiCloud), scope) + }); err != nil { return err } - out.TSIGKeyName = in.TSIGKeyName - out.TSIGAlgorithm = in.TSIGAlgorithm - return nil -} - -// Convert_v1alpha2_ACMEIssuerDNS01ProviderRFC2136_To_certmanager_ACMEIssuerDNS01ProviderRFC2136 is an autogenerated conversion function. -func Convert_v1alpha2_ACMEIssuerDNS01ProviderRFC2136_To_certmanager_ACMEIssuerDNS01ProviderRFC2136(in *v1alpha2.ACMEIssuerDNS01ProviderRFC2136, out *certmanager.ACMEIssuerDNS01ProviderRFC2136, s conversion.Scope) error { - return autoConvert_v1alpha2_ACMEIssuerDNS01ProviderRFC2136_To_certmanager_ACMEIssuerDNS01ProviderRFC2136(in, out, s) -} - -func autoConvert_certmanager_ACMEIssuerDNS01ProviderRFC2136_To_v1alpha2_ACMEIssuerDNS01ProviderRFC2136(in *certmanager.ACMEIssuerDNS01ProviderRFC2136, out *v1alpha2.ACMEIssuerDNS01ProviderRFC2136, s conversion.Scope) error { - out.Nameserver = in.Nameserver - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.TSIGSecret, &out.TSIGSecret, 0); err != nil { + if err := s.AddGeneratedConversionFunc((*v1alpha2.VenafiIssuer)(nil), (*certmanager.VenafiIssuer)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VenafiIssuer_To_certmanager_VenafiIssuer(a.(*v1alpha2.VenafiIssuer), b.(*certmanager.VenafiIssuer), scope) + }); err != nil { return err } - out.TSIGKeyName = in.TSIGKeyName - out.TSIGAlgorithm = in.TSIGAlgorithm - return nil -} - -// Convert_certmanager_ACMEIssuerDNS01ProviderRFC2136_To_v1alpha2_ACMEIssuerDNS01ProviderRFC2136 is an autogenerated conversion function. -func Convert_certmanager_ACMEIssuerDNS01ProviderRFC2136_To_v1alpha2_ACMEIssuerDNS01ProviderRFC2136(in *certmanager.ACMEIssuerDNS01ProviderRFC2136, out *v1alpha2.ACMEIssuerDNS01ProviderRFC2136, s conversion.Scope) error { - return autoConvert_certmanager_ACMEIssuerDNS01ProviderRFC2136_To_v1alpha2_ACMEIssuerDNS01ProviderRFC2136(in, out, s) -} - -func autoConvert_v1alpha2_ACMEIssuerDNS01ProviderRoute53_To_certmanager_ACMEIssuerDNS01ProviderRoute53(in *v1alpha2.ACMEIssuerDNS01ProviderRoute53, out *certmanager.ACMEIssuerDNS01ProviderRoute53, s conversion.Scope) error { - out.AccessKeyID = in.AccessKeyID - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.SecretAccessKey, &out.SecretAccessKey, 0); err != nil { + if err := s.AddGeneratedConversionFunc((*certmanager.VenafiIssuer)(nil), (*v1alpha2.VenafiIssuer)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_certmanager_VenafiIssuer_To_v1alpha2_VenafiIssuer(a.(*certmanager.VenafiIssuer), b.(*v1alpha2.VenafiIssuer), scope) + }); err != nil { return err } - out.Role = in.Role - out.HostedZoneID = in.HostedZoneID - out.Region = in.Region - return nil -} - -// Convert_v1alpha2_ACMEIssuerDNS01ProviderRoute53_To_certmanager_ACMEIssuerDNS01ProviderRoute53 is an autogenerated conversion function. -func Convert_v1alpha2_ACMEIssuerDNS01ProviderRoute53_To_certmanager_ACMEIssuerDNS01ProviderRoute53(in *v1alpha2.ACMEIssuerDNS01ProviderRoute53, out *certmanager.ACMEIssuerDNS01ProviderRoute53, s conversion.Scope) error { - return autoConvert_v1alpha2_ACMEIssuerDNS01ProviderRoute53_To_certmanager_ACMEIssuerDNS01ProviderRoute53(in, out, s) -} - -func autoConvert_certmanager_ACMEIssuerDNS01ProviderRoute53_To_v1alpha2_ACMEIssuerDNS01ProviderRoute53(in *certmanager.ACMEIssuerDNS01ProviderRoute53, out *v1alpha2.ACMEIssuerDNS01ProviderRoute53, s conversion.Scope) error { - out.AccessKeyID = in.AccessKeyID - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.SecretAccessKey, &out.SecretAccessKey, 0); err != nil { + if err := s.AddGeneratedConversionFunc((*v1alpha2.VenafiTPP)(nil), (*certmanager.VenafiTPP)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VenafiTPP_To_certmanager_VenafiTPP(a.(*v1alpha2.VenafiTPP), b.(*certmanager.VenafiTPP), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*certmanager.VenafiTPP)(nil), (*v1alpha2.VenafiTPP)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_certmanager_VenafiTPP_To_v1alpha2_VenafiTPP(a.(*certmanager.VenafiTPP), b.(*v1alpha2.VenafiTPP), scope) + }); err != nil { return err } - out.Role = in.Role - out.HostedZoneID = in.HostedZoneID - out.Region = in.Region - return nil -} - -// Convert_certmanager_ACMEIssuerDNS01ProviderRoute53_To_v1alpha2_ACMEIssuerDNS01ProviderRoute53 is an autogenerated conversion function. -func Convert_certmanager_ACMEIssuerDNS01ProviderRoute53_To_v1alpha2_ACMEIssuerDNS01ProviderRoute53(in *certmanager.ACMEIssuerDNS01ProviderRoute53, out *v1alpha2.ACMEIssuerDNS01ProviderRoute53, s conversion.Scope) error { - return autoConvert_certmanager_ACMEIssuerDNS01ProviderRoute53_To_v1alpha2_ACMEIssuerDNS01ProviderRoute53(in, out, s) -} - -func autoConvert_v1alpha2_ACMEIssuerDNS01ProviderWebhook_To_certmanager_ACMEIssuerDNS01ProviderWebhook(in *v1alpha2.ACMEIssuerDNS01ProviderWebhook, out *certmanager.ACMEIssuerDNS01ProviderWebhook, s conversion.Scope) error { - out.GroupName = in.GroupName - out.SolverName = in.SolverName - out.Config = (*v1beta1.JSON)(unsafe.Pointer(in.Config)) - return nil -} - -// Convert_v1alpha2_ACMEIssuerDNS01ProviderWebhook_To_certmanager_ACMEIssuerDNS01ProviderWebhook is an autogenerated conversion function. -func Convert_v1alpha2_ACMEIssuerDNS01ProviderWebhook_To_certmanager_ACMEIssuerDNS01ProviderWebhook(in *v1alpha2.ACMEIssuerDNS01ProviderWebhook, out *certmanager.ACMEIssuerDNS01ProviderWebhook, s conversion.Scope) error { - return autoConvert_v1alpha2_ACMEIssuerDNS01ProviderWebhook_To_certmanager_ACMEIssuerDNS01ProviderWebhook(in, out, s) -} - -func autoConvert_certmanager_ACMEIssuerDNS01ProviderWebhook_To_v1alpha2_ACMEIssuerDNS01ProviderWebhook(in *certmanager.ACMEIssuerDNS01ProviderWebhook, out *v1alpha2.ACMEIssuerDNS01ProviderWebhook, s conversion.Scope) error { - out.GroupName = in.GroupName - out.SolverName = in.SolverName - out.Config = (*v1beta1.JSON)(unsafe.Pointer(in.Config)) - return nil -} - -// Convert_certmanager_ACMEIssuerDNS01ProviderWebhook_To_v1alpha2_ACMEIssuerDNS01ProviderWebhook is an autogenerated conversion function. -func Convert_certmanager_ACMEIssuerDNS01ProviderWebhook_To_v1alpha2_ACMEIssuerDNS01ProviderWebhook(in *certmanager.ACMEIssuerDNS01ProviderWebhook, out *v1alpha2.ACMEIssuerDNS01ProviderWebhook, s conversion.Scope) error { - return autoConvert_certmanager_ACMEIssuerDNS01ProviderWebhook_To_v1alpha2_ACMEIssuerDNS01ProviderWebhook(in, out, s) -} - -func autoConvert_v1alpha2_ACMEIssuerStatus_To_certmanager_ACMEIssuerStatus(in *v1alpha2.ACMEIssuerStatus, out *certmanager.ACMEIssuerStatus, s conversion.Scope) error { - out.URI = in.URI - out.LastRegisteredEmail = in.LastRegisteredEmail - return nil -} - -// Convert_v1alpha2_ACMEIssuerStatus_To_certmanager_ACMEIssuerStatus is an autogenerated conversion function. -func Convert_v1alpha2_ACMEIssuerStatus_To_certmanager_ACMEIssuerStatus(in *v1alpha2.ACMEIssuerStatus, out *certmanager.ACMEIssuerStatus, s conversion.Scope) error { - return autoConvert_v1alpha2_ACMEIssuerStatus_To_certmanager_ACMEIssuerStatus(in, out, s) -} - -func autoConvert_certmanager_ACMEIssuerStatus_To_v1alpha2_ACMEIssuerStatus(in *certmanager.ACMEIssuerStatus, out *v1alpha2.ACMEIssuerStatus, s conversion.Scope) error { - out.URI = in.URI - out.LastRegisteredEmail = in.LastRegisteredEmail return nil } -// Convert_certmanager_ACMEIssuerStatus_To_v1alpha2_ACMEIssuerStatus is an autogenerated conversion function. -func Convert_certmanager_ACMEIssuerStatus_To_v1alpha2_ACMEIssuerStatus(in *certmanager.ACMEIssuerStatus, out *v1alpha2.ACMEIssuerStatus, s conversion.Scope) error { - return autoConvert_certmanager_ACMEIssuerStatus_To_v1alpha2_ACMEIssuerStatus(in, out, s) -} - func autoConvert_v1alpha2_CAIssuer_To_certmanager_CAIssuer(in *v1alpha2.CAIssuer, out *certmanager.CAIssuer, s conversion.Scope) error { out.SecretName = in.SecretName return nil @@ -1185,7 +359,7 @@ func Convert_certmanager_Certificate_To_v1alpha2_Certificate(in *certmanager.Cer func autoConvert_v1alpha2_CertificateCondition_To_certmanager_CertificateCondition(in *v1alpha2.CertificateCondition, out *certmanager.CertificateCondition, s conversion.Scope) error { out.Type = certmanager.CertificateConditionType(in.Type) out.Status = meta.ConditionStatus(in.Status) - out.LastTransitionTime = (*metav1.Time)(unsafe.Pointer(in.LastTransitionTime)) + out.LastTransitionTime = (*v1.Time)(unsafe.Pointer(in.LastTransitionTime)) out.Reason = in.Reason out.Message = in.Message return nil @@ -1198,8 +372,8 @@ func Convert_v1alpha2_CertificateCondition_To_certmanager_CertificateCondition(i func autoConvert_certmanager_CertificateCondition_To_v1alpha2_CertificateCondition(in *certmanager.CertificateCondition, out *v1alpha2.CertificateCondition, s conversion.Scope) error { out.Type = v1alpha2.CertificateConditionType(in.Type) - out.Status = apismetav1.ConditionStatus(in.Status) - out.LastTransitionTime = (*metav1.Time)(unsafe.Pointer(in.LastTransitionTime)) + out.Status = metav1.ConditionStatus(in.Status) + out.LastTransitionTime = (*v1.Time)(unsafe.Pointer(in.LastTransitionTime)) out.Reason = in.Reason out.Message = in.Message return nil @@ -1210,30 +384,6 @@ func Convert_certmanager_CertificateCondition_To_v1alpha2_CertificateCondition(i return autoConvert_certmanager_CertificateCondition_To_v1alpha2_CertificateCondition(in, out, s) } -func autoConvert_v1alpha2_CertificateDNSNameSelector_To_certmanager_CertificateDNSNameSelector(in *v1alpha2.CertificateDNSNameSelector, out *certmanager.CertificateDNSNameSelector, s conversion.Scope) error { - out.MatchLabels = *(*map[string]string)(unsafe.Pointer(&in.MatchLabels)) - out.DNSNames = *(*[]string)(unsafe.Pointer(&in.DNSNames)) - out.DNSZones = *(*[]string)(unsafe.Pointer(&in.DNSZones)) - return nil -} - -// Convert_v1alpha2_CertificateDNSNameSelector_To_certmanager_CertificateDNSNameSelector is an autogenerated conversion function. -func Convert_v1alpha2_CertificateDNSNameSelector_To_certmanager_CertificateDNSNameSelector(in *v1alpha2.CertificateDNSNameSelector, out *certmanager.CertificateDNSNameSelector, s conversion.Scope) error { - return autoConvert_v1alpha2_CertificateDNSNameSelector_To_certmanager_CertificateDNSNameSelector(in, out, s) -} - -func autoConvert_certmanager_CertificateDNSNameSelector_To_v1alpha2_CertificateDNSNameSelector(in *certmanager.CertificateDNSNameSelector, out *v1alpha2.CertificateDNSNameSelector, s conversion.Scope) error { - out.MatchLabels = *(*map[string]string)(unsafe.Pointer(&in.MatchLabels)) - out.DNSNames = *(*[]string)(unsafe.Pointer(&in.DNSNames)) - out.DNSZones = *(*[]string)(unsafe.Pointer(&in.DNSZones)) - return nil -} - -// Convert_certmanager_CertificateDNSNameSelector_To_v1alpha2_CertificateDNSNameSelector is an autogenerated conversion function. -func Convert_certmanager_CertificateDNSNameSelector_To_v1alpha2_CertificateDNSNameSelector(in *certmanager.CertificateDNSNameSelector, out *v1alpha2.CertificateDNSNameSelector, s conversion.Scope) error { - return autoConvert_certmanager_CertificateDNSNameSelector_To_v1alpha2_CertificateDNSNameSelector(in, out, s) -} - func autoConvert_v1alpha2_CertificateList_To_certmanager_CertificateList(in *v1alpha2.CertificateList, out *certmanager.CertificateList, s conversion.Scope) error { out.ListMeta = in.ListMeta out.Items = *(*[]certmanager.Certificate)(unsafe.Pointer(&in.Items)) @@ -1291,7 +441,7 @@ func Convert_certmanager_CertificateRequest_To_v1alpha2_CertificateRequest(in *c func autoConvert_v1alpha2_CertificateRequestCondition_To_certmanager_CertificateRequestCondition(in *v1alpha2.CertificateRequestCondition, out *certmanager.CertificateRequestCondition, s conversion.Scope) error { out.Type = certmanager.CertificateRequestConditionType(in.Type) out.Status = meta.ConditionStatus(in.Status) - out.LastTransitionTime = (*metav1.Time)(unsafe.Pointer(in.LastTransitionTime)) + out.LastTransitionTime = (*v1.Time)(unsafe.Pointer(in.LastTransitionTime)) out.Reason = in.Reason out.Message = in.Message return nil @@ -1304,8 +454,8 @@ func Convert_v1alpha2_CertificateRequestCondition_To_certmanager_CertificateRequ func autoConvert_certmanager_CertificateRequestCondition_To_v1alpha2_CertificateRequestCondition(in *certmanager.CertificateRequestCondition, out *v1alpha2.CertificateRequestCondition, s conversion.Scope) error { out.Type = v1alpha2.CertificateRequestConditionType(in.Type) - out.Status = apismetav1.ConditionStatus(in.Status) - out.LastTransitionTime = (*metav1.Time)(unsafe.Pointer(in.LastTransitionTime)) + out.Status = metav1.ConditionStatus(in.Status) + out.LastTransitionTime = (*v1.Time)(unsafe.Pointer(in.LastTransitionTime)) out.Reason = in.Reason out.Message = in.Message return nil @@ -1339,7 +489,7 @@ func Convert_certmanager_CertificateRequestList_To_v1alpha2_CertificateRequestLi } func autoConvert_v1alpha2_CertificateRequestSpec_To_certmanager_CertificateRequestSpec(in *v1alpha2.CertificateRequestSpec, out *certmanager.CertificateRequestSpec, s conversion.Scope) error { - out.Duration = (*metav1.Duration)(unsafe.Pointer(in.Duration)) + out.Duration = (*v1.Duration)(unsafe.Pointer(in.Duration)) // TODO: Inefficient conversion - can we improve it? if err := s.Convert(&in.IssuerRef, &out.IssuerRef, 0); err != nil { return err @@ -1356,7 +506,7 @@ func Convert_v1alpha2_CertificateRequestSpec_To_certmanager_CertificateRequestSp } func autoConvert_certmanager_CertificateRequestSpec_To_v1alpha2_CertificateRequestSpec(in *certmanager.CertificateRequestSpec, out *v1alpha2.CertificateRequestSpec, s conversion.Scope) error { - out.Duration = (*metav1.Duration)(unsafe.Pointer(in.Duration)) + out.Duration = (*v1.Duration)(unsafe.Pointer(in.Duration)) // TODO: Inefficient conversion - can we improve it? if err := s.Convert(&in.IssuerRef, &out.IssuerRef, 0); err != nil { return err @@ -1376,7 +526,7 @@ func autoConvert_v1alpha2_CertificateRequestStatus_To_certmanager_CertificateReq out.Conditions = *(*[]certmanager.CertificateRequestCondition)(unsafe.Pointer(&in.Conditions)) out.Certificate = *(*[]byte)(unsafe.Pointer(&in.Certificate)) out.CA = *(*[]byte)(unsafe.Pointer(&in.CA)) - out.FailureTime = (*metav1.Time)(unsafe.Pointer(in.FailureTime)) + out.FailureTime = (*v1.Time)(unsafe.Pointer(in.FailureTime)) return nil } @@ -1389,7 +539,7 @@ func autoConvert_certmanager_CertificateRequestStatus_To_v1alpha2_CertificateReq out.Conditions = *(*[]v1alpha2.CertificateRequestCondition)(unsafe.Pointer(&in.Conditions)) out.Certificate = *(*[]byte)(unsafe.Pointer(&in.Certificate)) out.CA = *(*[]byte)(unsafe.Pointer(&in.CA)) - out.FailureTime = (*metav1.Time)(unsafe.Pointer(in.FailureTime)) + out.FailureTime = (*v1.Time)(unsafe.Pointer(in.FailureTime)) return nil } @@ -1401,8 +551,8 @@ func Convert_certmanager_CertificateRequestStatus_To_v1alpha2_CertificateRequest func autoConvert_v1alpha2_CertificateSpec_To_certmanager_CertificateSpec(in *v1alpha2.CertificateSpec, out *certmanager.CertificateSpec, s conversion.Scope) error { out.CommonName = in.CommonName out.Organization = *(*[]string)(unsafe.Pointer(&in.Organization)) - out.Duration = (*metav1.Duration)(unsafe.Pointer(in.Duration)) - out.RenewBefore = (*metav1.Duration)(unsafe.Pointer(in.RenewBefore)) + out.Duration = (*v1.Duration)(unsafe.Pointer(in.Duration)) + out.RenewBefore = (*v1.Duration)(unsafe.Pointer(in.RenewBefore)) out.DNSNames = *(*[]string)(unsafe.Pointer(&in.DNSNames)) out.IPAddresses = *(*[]string)(unsafe.Pointer(&in.IPAddresses)) out.SecretName = in.SecretName @@ -1426,8 +576,8 @@ func Convert_v1alpha2_CertificateSpec_To_certmanager_CertificateSpec(in *v1alpha func autoConvert_certmanager_CertificateSpec_To_v1alpha2_CertificateSpec(in *certmanager.CertificateSpec, out *v1alpha2.CertificateSpec, s conversion.Scope) error { out.CommonName = in.CommonName out.Organization = *(*[]string)(unsafe.Pointer(&in.Organization)) - out.Duration = (*metav1.Duration)(unsafe.Pointer(in.Duration)) - out.RenewBefore = (*metav1.Duration)(unsafe.Pointer(in.RenewBefore)) + out.Duration = (*v1.Duration)(unsafe.Pointer(in.Duration)) + out.RenewBefore = (*v1.Duration)(unsafe.Pointer(in.RenewBefore)) out.DNSNames = *(*[]string)(unsafe.Pointer(&in.DNSNames)) out.IPAddresses = *(*[]string)(unsafe.Pointer(&in.IPAddresses)) out.SecretName = in.SecretName @@ -1450,8 +600,8 @@ func Convert_certmanager_CertificateSpec_To_v1alpha2_CertificateSpec(in *certman func autoConvert_v1alpha2_CertificateStatus_To_certmanager_CertificateStatus(in *v1alpha2.CertificateStatus, out *certmanager.CertificateStatus, s conversion.Scope) error { out.Conditions = *(*[]certmanager.CertificateCondition)(unsafe.Pointer(&in.Conditions)) - out.LastFailureTime = (*metav1.Time)(unsafe.Pointer(in.LastFailureTime)) - out.NotAfter = (*metav1.Time)(unsafe.Pointer(in.NotAfter)) + out.LastFailureTime = (*v1.Time)(unsafe.Pointer(in.LastFailureTime)) + out.NotAfter = (*v1.Time)(unsafe.Pointer(in.NotAfter)) return nil } @@ -1462,8 +612,8 @@ func Convert_v1alpha2_CertificateStatus_To_certmanager_CertificateStatus(in *v1a func autoConvert_certmanager_CertificateStatus_To_v1alpha2_CertificateStatus(in *certmanager.CertificateStatus, out *v1alpha2.CertificateStatus, s conversion.Scope) error { out.Conditions = *(*[]v1alpha2.CertificateCondition)(unsafe.Pointer(&in.Conditions)) - out.LastFailureTime = (*metav1.Time)(unsafe.Pointer(in.LastFailureTime)) - out.NotAfter = (*metav1.Time)(unsafe.Pointer(in.NotAfter)) + out.LastFailureTime = (*v1.Time)(unsafe.Pointer(in.LastFailureTime)) + out.NotAfter = (*v1.Time)(unsafe.Pointer(in.NotAfter)) return nil } @@ -1472,128 +622,6 @@ func Convert_certmanager_CertificateStatus_To_v1alpha2_CertificateStatus(in *cer return autoConvert_certmanager_CertificateStatus_To_v1alpha2_CertificateStatus(in, out, s) } -func autoConvert_v1alpha2_Challenge_To_certmanager_Challenge(in *v1alpha2.Challenge, out *certmanager.Challenge, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha2_ChallengeSpec_To_certmanager_ChallengeSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha2_ChallengeStatus_To_certmanager_ChallengeStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha2_Challenge_To_certmanager_Challenge is an autogenerated conversion function. -func Convert_v1alpha2_Challenge_To_certmanager_Challenge(in *v1alpha2.Challenge, out *certmanager.Challenge, s conversion.Scope) error { - return autoConvert_v1alpha2_Challenge_To_certmanager_Challenge(in, out, s) -} - -func autoConvert_certmanager_Challenge_To_v1alpha2_Challenge(in *certmanager.Challenge, out *v1alpha2.Challenge, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_certmanager_ChallengeSpec_To_v1alpha2_ChallengeSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_certmanager_ChallengeStatus_To_v1alpha2_ChallengeStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_certmanager_Challenge_To_v1alpha2_Challenge is an autogenerated conversion function. -func Convert_certmanager_Challenge_To_v1alpha2_Challenge(in *certmanager.Challenge, out *v1alpha2.Challenge, s conversion.Scope) error { - return autoConvert_certmanager_Challenge_To_v1alpha2_Challenge(in, out, s) -} - -func autoConvert_v1alpha2_ChallengeList_To_certmanager_ChallengeList(in *v1alpha2.ChallengeList, out *certmanager.ChallengeList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]certmanager.Challenge)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha2_ChallengeList_To_certmanager_ChallengeList is an autogenerated conversion function. -func Convert_v1alpha2_ChallengeList_To_certmanager_ChallengeList(in *v1alpha2.ChallengeList, out *certmanager.ChallengeList, s conversion.Scope) error { - return autoConvert_v1alpha2_ChallengeList_To_certmanager_ChallengeList(in, out, s) -} - -func autoConvert_certmanager_ChallengeList_To_v1alpha2_ChallengeList(in *certmanager.ChallengeList, out *v1alpha2.ChallengeList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1alpha2.Challenge)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_certmanager_ChallengeList_To_v1alpha2_ChallengeList is an autogenerated conversion function. -func Convert_certmanager_ChallengeList_To_v1alpha2_ChallengeList(in *certmanager.ChallengeList, out *v1alpha2.ChallengeList, s conversion.Scope) error { - return autoConvert_certmanager_ChallengeList_To_v1alpha2_ChallengeList(in, out, s) -} - -func autoConvert_v1alpha2_ChallengeSpec_To_certmanager_ChallengeSpec(in *v1alpha2.ChallengeSpec, out *certmanager.ChallengeSpec, s conversion.Scope) error { - out.AuthzURL = in.AuthzURL - out.Type = string(in.Type) - out.URL = in.URL - out.DNSName = in.DNSName - out.Token = in.Token - out.Key = in.Key - out.Wildcard = in.Wildcard - out.Solver = (*certmanager.ACMEChallengeSolver)(unsafe.Pointer(in.Solver)) - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.IssuerRef, &out.IssuerRef, 0); err != nil { - return err - } - return nil -} - -// Convert_v1alpha2_ChallengeSpec_To_certmanager_ChallengeSpec is an autogenerated conversion function. -func Convert_v1alpha2_ChallengeSpec_To_certmanager_ChallengeSpec(in *v1alpha2.ChallengeSpec, out *certmanager.ChallengeSpec, s conversion.Scope) error { - return autoConvert_v1alpha2_ChallengeSpec_To_certmanager_ChallengeSpec(in, out, s) -} - -func autoConvert_certmanager_ChallengeSpec_To_v1alpha2_ChallengeSpec(in *certmanager.ChallengeSpec, out *v1alpha2.ChallengeSpec, s conversion.Scope) error { - out.AuthzURL = in.AuthzURL - out.Type = v1alpha2.ACMEChallengeType(in.Type) - out.URL = in.URL - out.DNSName = in.DNSName - out.Token = in.Token - out.Key = in.Key - out.Wildcard = in.Wildcard - out.Solver = (*v1alpha2.ACMEChallengeSolver)(unsafe.Pointer(in.Solver)) - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.IssuerRef, &out.IssuerRef, 0); err != nil { - return err - } - return nil -} - -// Convert_certmanager_ChallengeSpec_To_v1alpha2_ChallengeSpec is an autogenerated conversion function. -func Convert_certmanager_ChallengeSpec_To_v1alpha2_ChallengeSpec(in *certmanager.ChallengeSpec, out *v1alpha2.ChallengeSpec, s conversion.Scope) error { - return autoConvert_certmanager_ChallengeSpec_To_v1alpha2_ChallengeSpec(in, out, s) -} - -func autoConvert_v1alpha2_ChallengeStatus_To_certmanager_ChallengeStatus(in *v1alpha2.ChallengeStatus, out *certmanager.ChallengeStatus, s conversion.Scope) error { - out.Processing = in.Processing - out.Presented = in.Presented - out.Reason = in.Reason - out.State = certmanager.State(in.State) - return nil -} - -// Convert_v1alpha2_ChallengeStatus_To_certmanager_ChallengeStatus is an autogenerated conversion function. -func Convert_v1alpha2_ChallengeStatus_To_certmanager_ChallengeStatus(in *v1alpha2.ChallengeStatus, out *certmanager.ChallengeStatus, s conversion.Scope) error { - return autoConvert_v1alpha2_ChallengeStatus_To_certmanager_ChallengeStatus(in, out, s) -} - -func autoConvert_certmanager_ChallengeStatus_To_v1alpha2_ChallengeStatus(in *certmanager.ChallengeStatus, out *v1alpha2.ChallengeStatus, s conversion.Scope) error { - out.Processing = in.Processing - out.Presented = in.Presented - out.Reason = in.Reason - out.State = v1alpha2.State(in.State) - return nil -} - -// Convert_certmanager_ChallengeStatus_To_v1alpha2_ChallengeStatus is an autogenerated conversion function. -func Convert_certmanager_ChallengeStatus_To_v1alpha2_ChallengeStatus(in *certmanager.ChallengeStatus, out *v1alpha2.ChallengeStatus, s conversion.Scope) error { - return autoConvert_certmanager_ChallengeStatus_To_v1alpha2_ChallengeStatus(in, out, s) -} - func autoConvert_v1alpha2_ClusterIssuer_To_certmanager_ClusterIssuer(in *v1alpha2.ClusterIssuer, out *certmanager.ClusterIssuer, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_v1alpha2_IssuerSpec_To_certmanager_IssuerSpec(&in.Spec, &out.Spec, s); err != nil { @@ -1683,7 +711,7 @@ func Convert_certmanager_Issuer_To_v1alpha2_Issuer(in *certmanager.Issuer, out * func autoConvert_v1alpha2_IssuerCondition_To_certmanager_IssuerCondition(in *v1alpha2.IssuerCondition, out *certmanager.IssuerCondition, s conversion.Scope) error { out.Type = certmanager.IssuerConditionType(in.Type) out.Status = meta.ConditionStatus(in.Status) - out.LastTransitionTime = (*metav1.Time)(unsafe.Pointer(in.LastTransitionTime)) + out.LastTransitionTime = (*v1.Time)(unsafe.Pointer(in.LastTransitionTime)) out.Reason = in.Reason out.Message = in.Message return nil @@ -1696,8 +724,8 @@ func Convert_v1alpha2_IssuerCondition_To_certmanager_IssuerCondition(in *v1alpha func autoConvert_certmanager_IssuerCondition_To_v1alpha2_IssuerCondition(in *certmanager.IssuerCondition, out *v1alpha2.IssuerCondition, s conversion.Scope) error { out.Type = v1alpha2.IssuerConditionType(in.Type) - out.Status = apismetav1.ConditionStatus(in.Status) - out.LastTransitionTime = (*metav1.Time)(unsafe.Pointer(in.LastTransitionTime)) + out.Status = metav1.ConditionStatus(in.Status) + out.LastTransitionTime = (*v1.Time)(unsafe.Pointer(in.LastTransitionTime)) out.Reason = in.Reason out.Message = in.Message return nil @@ -1709,7 +737,7 @@ func Convert_certmanager_IssuerCondition_To_v1alpha2_IssuerCondition(in *certman } func autoConvert_v1alpha2_IssuerConfig_To_certmanager_IssuerConfig(in *v1alpha2.IssuerConfig, out *certmanager.IssuerConfig, s conversion.Scope) error { - out.ACME = (*certmanager.ACMEIssuer)(unsafe.Pointer(in.ACME)) + out.ACME = (*acme.ACMEIssuer)(unsafe.Pointer(in.ACME)) out.CA = (*certmanager.CAIssuer)(unsafe.Pointer(in.CA)) out.Vault = (*certmanager.VaultIssuer)(unsafe.Pointer(in.Vault)) out.SelfSigned = (*certmanager.SelfSignedIssuer)(unsafe.Pointer(in.SelfSigned)) @@ -1723,7 +751,7 @@ func Convert_v1alpha2_IssuerConfig_To_certmanager_IssuerConfig(in *v1alpha2.Issu } func autoConvert_certmanager_IssuerConfig_To_v1alpha2_IssuerConfig(in *certmanager.IssuerConfig, out *v1alpha2.IssuerConfig, s conversion.Scope) error { - out.ACME = (*v1alpha2.ACMEIssuer)(unsafe.Pointer(in.ACME)) + out.ACME = (*acmev1alpha2.ACMEIssuer)(unsafe.Pointer(in.ACME)) out.CA = (*v1alpha2.CAIssuer)(unsafe.Pointer(in.CA)) out.Vault = (*v1alpha2.VaultIssuer)(unsafe.Pointer(in.Vault)) out.SelfSigned = (*v1alpha2.SelfSignedIssuer)(unsafe.Pointer(in.SelfSigned)) @@ -1784,7 +812,7 @@ func Convert_certmanager_IssuerSpec_To_v1alpha2_IssuerSpec(in *certmanager.Issue func autoConvert_v1alpha2_IssuerStatus_To_certmanager_IssuerStatus(in *v1alpha2.IssuerStatus, out *certmanager.IssuerStatus, s conversion.Scope) error { out.Conditions = *(*[]certmanager.IssuerCondition)(unsafe.Pointer(&in.Conditions)) - out.ACME = (*certmanager.ACMEIssuerStatus)(unsafe.Pointer(in.ACME)) + out.ACME = (*acme.ACMEIssuerStatus)(unsafe.Pointer(in.ACME)) return nil } @@ -1795,7 +823,7 @@ func Convert_v1alpha2_IssuerStatus_To_certmanager_IssuerStatus(in *v1alpha2.Issu func autoConvert_certmanager_IssuerStatus_To_v1alpha2_IssuerStatus(in *certmanager.IssuerStatus, out *v1alpha2.IssuerStatus, s conversion.Scope) error { out.Conditions = *(*[]v1alpha2.IssuerCondition)(unsafe.Pointer(&in.Conditions)) - out.ACME = (*v1alpha2.ACMEIssuerStatus)(unsafe.Pointer(in.ACME)) + out.ACME = (*acmev1alpha2.ACMEIssuerStatus)(unsafe.Pointer(in.ACME)) return nil } @@ -1804,144 +832,6 @@ func Convert_certmanager_IssuerStatus_To_v1alpha2_IssuerStatus(in *certmanager.I return autoConvert_certmanager_IssuerStatus_To_v1alpha2_IssuerStatus(in, out, s) } -func autoConvert_v1alpha2_Order_To_certmanager_Order(in *v1alpha2.Order, out *certmanager.Order, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha2_OrderSpec_To_certmanager_OrderSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha2_OrderStatus_To_certmanager_OrderStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha2_Order_To_certmanager_Order is an autogenerated conversion function. -func Convert_v1alpha2_Order_To_certmanager_Order(in *v1alpha2.Order, out *certmanager.Order, s conversion.Scope) error { - return autoConvert_v1alpha2_Order_To_certmanager_Order(in, out, s) -} - -func autoConvert_certmanager_Order_To_v1alpha2_Order(in *certmanager.Order, out *v1alpha2.Order, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_certmanager_OrderSpec_To_v1alpha2_OrderSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_certmanager_OrderStatus_To_v1alpha2_OrderStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_certmanager_Order_To_v1alpha2_Order is an autogenerated conversion function. -func Convert_certmanager_Order_To_v1alpha2_Order(in *certmanager.Order, out *v1alpha2.Order, s conversion.Scope) error { - return autoConvert_certmanager_Order_To_v1alpha2_Order(in, out, s) -} - -func autoConvert_v1alpha2_OrderList_To_certmanager_OrderList(in *v1alpha2.OrderList, out *certmanager.OrderList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]certmanager.Order, len(*in)) - for i := range *in { - if err := Convert_v1alpha2_Order_To_certmanager_Order(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha2_OrderList_To_certmanager_OrderList is an autogenerated conversion function. -func Convert_v1alpha2_OrderList_To_certmanager_OrderList(in *v1alpha2.OrderList, out *certmanager.OrderList, s conversion.Scope) error { - return autoConvert_v1alpha2_OrderList_To_certmanager_OrderList(in, out, s) -} - -func autoConvert_certmanager_OrderList_To_v1alpha2_OrderList(in *certmanager.OrderList, out *v1alpha2.OrderList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1alpha2.Order, len(*in)) - for i := range *in { - if err := Convert_certmanager_Order_To_v1alpha2_Order(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_certmanager_OrderList_To_v1alpha2_OrderList is an autogenerated conversion function. -func Convert_certmanager_OrderList_To_v1alpha2_OrderList(in *certmanager.OrderList, out *v1alpha2.OrderList, s conversion.Scope) error { - return autoConvert_certmanager_OrderList_To_v1alpha2_OrderList(in, out, s) -} - -func autoConvert_v1alpha2_OrderSpec_To_certmanager_OrderSpec(in *v1alpha2.OrderSpec, out *certmanager.OrderSpec, s conversion.Scope) error { - out.CSR = *(*[]byte)(unsafe.Pointer(&in.CSR)) - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.IssuerRef, &out.IssuerRef, 0); err != nil { - return err - } - out.CommonName = in.CommonName - out.DNSNames = *(*[]string)(unsafe.Pointer(&in.DNSNames)) - return nil -} - -// Convert_v1alpha2_OrderSpec_To_certmanager_OrderSpec is an autogenerated conversion function. -func Convert_v1alpha2_OrderSpec_To_certmanager_OrderSpec(in *v1alpha2.OrderSpec, out *certmanager.OrderSpec, s conversion.Scope) error { - return autoConvert_v1alpha2_OrderSpec_To_certmanager_OrderSpec(in, out, s) -} - -func autoConvert_certmanager_OrderSpec_To_v1alpha2_OrderSpec(in *certmanager.OrderSpec, out *v1alpha2.OrderSpec, s conversion.Scope) error { - out.CSR = *(*[]byte)(unsafe.Pointer(&in.CSR)) - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.IssuerRef, &out.IssuerRef, 0); err != nil { - return err - } - out.CommonName = in.CommonName - out.DNSNames = *(*[]string)(unsafe.Pointer(&in.DNSNames)) - return nil -} - -// Convert_certmanager_OrderSpec_To_v1alpha2_OrderSpec is an autogenerated conversion function. -func Convert_certmanager_OrderSpec_To_v1alpha2_OrderSpec(in *certmanager.OrderSpec, out *v1alpha2.OrderSpec, s conversion.Scope) error { - return autoConvert_certmanager_OrderSpec_To_v1alpha2_OrderSpec(in, out, s) -} - -func autoConvert_v1alpha2_OrderStatus_To_certmanager_OrderStatus(in *v1alpha2.OrderStatus, out *certmanager.OrderStatus, s conversion.Scope) error { - out.URL = in.URL - out.FinalizeURL = in.FinalizeURL - out.Authorizations = *(*[]certmanager.ACMEAuthorization)(unsafe.Pointer(&in.Authorizations)) - out.Certificate = *(*[]byte)(unsafe.Pointer(&in.Certificate)) - out.State = certmanager.State(in.State) - out.Reason = in.Reason - out.FailureTime = (*metav1.Time)(unsafe.Pointer(in.FailureTime)) - return nil -} - -// Convert_v1alpha2_OrderStatus_To_certmanager_OrderStatus is an autogenerated conversion function. -func Convert_v1alpha2_OrderStatus_To_certmanager_OrderStatus(in *v1alpha2.OrderStatus, out *certmanager.OrderStatus, s conversion.Scope) error { - return autoConvert_v1alpha2_OrderStatus_To_certmanager_OrderStatus(in, out, s) -} - -func autoConvert_certmanager_OrderStatus_To_v1alpha2_OrderStatus(in *certmanager.OrderStatus, out *v1alpha2.OrderStatus, s conversion.Scope) error { - out.URL = in.URL - out.FinalizeURL = in.FinalizeURL - out.Certificate = *(*[]byte)(unsafe.Pointer(&in.Certificate)) - out.State = v1alpha2.State(in.State) - out.Reason = in.Reason - out.Authorizations = *(*[]v1alpha2.ACMEAuthorization)(unsafe.Pointer(&in.Authorizations)) - out.FailureTime = (*metav1.Time)(unsafe.Pointer(in.FailureTime)) - return nil -} - -// Convert_certmanager_OrderStatus_To_v1alpha2_OrderStatus is an autogenerated conversion function. -func Convert_certmanager_OrderStatus_To_v1alpha2_OrderStatus(in *certmanager.OrderStatus, out *v1alpha2.OrderStatus, s conversion.Scope) error { - return autoConvert_certmanager_OrderStatus_To_v1alpha2_OrderStatus(in, out, s) -} - func autoConvert_v1alpha2_SelfSignedIssuer_To_certmanager_SelfSignedIssuer(in *v1alpha2.SelfSignedIssuer, out *certmanager.SelfSignedIssuer, s conversion.Scope) error { return nil } diff --git a/pkg/internal/apis/certmanager/validation/BUILD.bazel b/pkg/internal/apis/certmanager/validation/BUILD.bazel index bf90b10e138..51b8fefbf77 100644 --- a/pkg/internal/apis/certmanager/validation/BUILD.bazel +++ b/pkg/internal/apis/certmanager/validation/BUILD.bazel @@ -13,6 +13,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/api/util:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", "//pkg/internal/apis/certmanager/validation/util:go_default_library", @@ -33,6 +34,7 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", "//test/unit/gen:go_default_library", diff --git a/pkg/internal/apis/certmanager/validation/certificate_for_issuer_test.go b/pkg/internal/apis/certmanager/validation/certificate_for_issuer_test.go index 93c217023ee..0bfd3b4624e 100644 --- a/pkg/internal/apis/certmanager/validation/certificate_for_issuer_test.go +++ b/pkg/internal/apis/certmanager/validation/certificate_for_issuer_test.go @@ -24,6 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/validation/field" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" "github.com/jetstack/cert-manager/test/unit/gen" ) @@ -48,7 +49,7 @@ func TestValidateCertificateForIssuer(t *testing.T) { IssuerRef: validIssuerRef, }, }, - issuer: gen.Issuer(defaultTestIssuerName, gen.SetIssuerACME(v1alpha2.ACMEIssuer{})), + issuer: gen.Issuer(defaultTestIssuerName, gen.SetIssuerACME(cmacme.ACMEIssuer{})), }, "certificate with RSA keyAlgorithm for ACME": { crt: &v1alpha2.Certificate{ @@ -57,7 +58,7 @@ func TestValidateCertificateForIssuer(t *testing.T) { IssuerRef: validIssuerRef, }, }, - issuer: gen.Issuer(defaultTestIssuerName, gen.SetIssuerACME(v1alpha2.ACMEIssuer{})), + issuer: gen.Issuer(defaultTestIssuerName, gen.SetIssuerACME(cmacme.ACMEIssuer{})), }, "certificate with ECDSA keyAlgorithm for ACME": { crt: &v1alpha2.Certificate{ @@ -66,7 +67,7 @@ func TestValidateCertificateForIssuer(t *testing.T) { IssuerRef: validIssuerRef, }, }, - issuer: gen.Issuer(defaultTestIssuerName, gen.SetIssuerACME(v1alpha2.ACMEIssuer{})), + issuer: gen.Issuer(defaultTestIssuerName, gen.SetIssuerACME(cmacme.ACMEIssuer{})), }, "acme certificate with organization set": { crt: &v1alpha2.Certificate{ @@ -75,7 +76,7 @@ func TestValidateCertificateForIssuer(t *testing.T) { IssuerRef: validIssuerRef, }, }, - issuer: gen.Issuer(defaultTestIssuerName, gen.SetIssuerACME(v1alpha2.ACMEIssuer{})), + issuer: gen.Issuer(defaultTestIssuerName, gen.SetIssuerACME(cmacme.ACMEIssuer{})), errs: []*field.Error{ field.Invalid(fldPath.Child("organization"), []string{"shouldfailorg"}, "ACME does not support setting the organization name"), }, @@ -87,7 +88,7 @@ func TestValidateCertificateForIssuer(t *testing.T) { IssuerRef: validIssuerRef, }, }, - issuer: gen.Issuer(defaultTestIssuerName, gen.SetIssuerACME(v1alpha2.ACMEIssuer{})), + issuer: gen.Issuer(defaultTestIssuerName, gen.SetIssuerACME(cmacme.ACMEIssuer{})), errs: []*field.Error{ field.Invalid(fldPath.Child("duration"), &metav1.Duration{Duration: time.Minute * 60}, "ACME does not support certificate durations"), }, @@ -99,7 +100,7 @@ func TestValidateCertificateForIssuer(t *testing.T) { IssuerRef: validIssuerRef, }, }, - issuer: gen.Issuer(defaultTestIssuerName, gen.SetIssuerACME(v1alpha2.ACMEIssuer{})), + issuer: gen.Issuer(defaultTestIssuerName, gen.SetIssuerACME(cmacme.ACMEIssuer{})), errs: []*field.Error{ field.Invalid(fldPath.Child("ipAddresses"), []string{"127.0.0.1"}, "ACME does not support certificate ip addresses"), }, @@ -111,7 +112,7 @@ func TestValidateCertificateForIssuer(t *testing.T) { IssuerRef: validIssuerRef, }, }, - issuer: gen.Issuer(defaultTestIssuerName, gen.SetIssuerACME(v1alpha2.ACMEIssuer{})), + issuer: gen.Issuer(defaultTestIssuerName, gen.SetIssuerACME(cmacme.ACMEIssuer{})), errs: []*field.Error{}, }, "certificate with unspecified issuer type": { diff --git a/pkg/internal/apis/certmanager/validation/issuer.go b/pkg/internal/apis/certmanager/validation/issuer.go index 7b97c393f01..7d3cddeea76 100644 --- a/pkg/internal/apis/certmanager/validation/issuer.go +++ b/pkg/internal/apis/certmanager/validation/issuer.go @@ -27,6 +27,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/validation/field" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" "github.com/jetstack/cert-manager/pkg/internal/apis/certmanager/validation/util" @@ -96,7 +97,7 @@ func ValidateIssuerConfig(iss *v1alpha2.IssuerConfig, fldPath *field.Path) field return el } -func ValidateACMEIssuerConfig(iss *v1alpha2.ACMEIssuer, fldPath *field.Path) field.ErrorList { +func ValidateACMEIssuerConfig(iss *cmacme.ACMEIssuer, fldPath *field.Path) field.ErrorList { el := field.ErrorList{} if len(iss.PrivateKey.Name) == 0 { el = append(el, field.Required(fldPath.Child("privateKeySecretRef", "name"), "private key secret name is a required field")) @@ -111,7 +112,7 @@ func ValidateACMEIssuerConfig(iss *v1alpha2.ACMEIssuer, fldPath *field.Path) fie return el } -func ValidateACMEIssuerChallengeSolverConfig(sol *v1alpha2.ACMEChallengeSolver, fldPath *field.Path) field.ErrorList { +func ValidateACMEIssuerChallengeSolverConfig(sol *cmacme.ACMEChallengeSolver, fldPath *field.Path) field.ErrorList { el := field.ErrorList{} numProviders := 0 @@ -134,7 +135,7 @@ func ValidateACMEIssuerChallengeSolverConfig(sol *v1alpha2.ACMEChallengeSolver, return el } -func ValidateACMEIssuerChallengeSolverHTTP01Config(http01 *v1alpha2.ACMEChallengeSolverHTTP01, fldPath *field.Path) field.ErrorList { +func ValidateACMEIssuerChallengeSolverHTTP01Config(http01 *cmacme.ACMEChallengeSolverHTTP01, fldPath *field.Path) field.ErrorList { el := field.ErrorList{} numDefined := 0 @@ -149,7 +150,7 @@ func ValidateACMEIssuerChallengeSolverHTTP01Config(http01 *v1alpha2.ACMEChalleng return el } -func ValidateACMEIssuerChallengeSolverHTTP01IngressConfig(ingress *v1alpha2.ACMEChallengeSolverHTTP01Ingress, fldPath *field.Path) field.ErrorList { +func ValidateACMEIssuerChallengeSolverHTTP01IngressConfig(ingress *cmacme.ACMEChallengeSolverHTTP01Ingress, fldPath *field.Path) field.ErrorList { el := field.ErrorList{} if ingress.Class != nil && len(ingress.Name) > 0 { @@ -167,7 +168,7 @@ func ValidateACMEIssuerChallengeSolverHTTP01IngressConfig(ingress *v1alpha2.ACME return el } -func ValidateACMEIssuerChallengeSolverHTTP01IngressPodTemplateConfig(podTempl *v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate, fldPath *field.Path) field.ErrorList { +func ValidateACMEIssuerChallengeSolverHTTP01IngressPodTemplateConfig(podTempl *cmacme.ACMEChallengeSolverHTTP01IngressPodTemplate, fldPath *field.Path) field.ErrorList { el := field.ErrorList{} cpyPodTempl := podTempl.DeepCopy() @@ -229,17 +230,17 @@ var supportedTSIGAlgorithms = []string{ "HMACSHA512", } -func ValidateACMEChallengeSolverDNS01(p *v1alpha2.ACMEChallengeSolverDNS01, fldPath *field.Path) field.ErrorList { +func ValidateACMEChallengeSolverDNS01(p *cmacme.ACMEChallengeSolverDNS01, fldPath *field.Path) field.ErrorList { el := field.ErrorList{} // allow empty values for now, until we have a MutatingWebhook to apply // default values to fields. if len(p.CNAMEStrategy) > 0 { switch p.CNAMEStrategy { - case v1alpha2.NoneStrategy: - case v1alpha2.FollowStrategy: + case cmacme.NoneStrategy: + case cmacme.FollowStrategy: default: - el = append(el, field.Invalid(fldPath.Child("cnameStrategy"), p.CNAMEStrategy, fmt.Sprintf("must be one of %q or %q", v1alpha2.NoneStrategy, v1alpha2.FollowStrategy))) + el = append(el, field.Invalid(fldPath.Child("cnameStrategy"), p.CNAMEStrategy, fmt.Sprintf("must be one of %q or %q", cmacme.NoneStrategy, cmacme.FollowStrategy))) } } numProviders := 0 @@ -271,10 +272,10 @@ func ValidateACMEChallengeSolverDNS01(p *v1alpha2.ACMEChallengeSolverDNS01, fldP el = append(el, field.Required(fldPath.Child("azuredns", "resourceGroupName"), "")) } switch p.AzureDNS.Environment { - case "", v1alpha2.AzurePublicCloud, v1alpha2.AzureChinaCloud, v1alpha2.AzureGermanCloud, v1alpha2.AzureUSGovernmentCloud: + case "", cmacme.AzurePublicCloud, cmacme.AzureChinaCloud, cmacme.AzureGermanCloud, cmacme.AzureUSGovernmentCloud: default: el = append(el, field.Invalid(fldPath.Child("azuredns", "environment"), p.AzureDNS.Environment, - fmt.Sprintf("must be either empty or one of %s, %s, %s or %s", v1alpha2.AzurePublicCloud, v1alpha2.AzureChinaCloud, v1alpha2.AzureGermanCloud, v1alpha2.AzureUSGovernmentCloud))) + fmt.Sprintf("must be either empty or one of %s, %s, %s or %s", cmacme.AzurePublicCloud, cmacme.AzureChinaCloud, cmacme.AzureGermanCloud, cmacme.AzureUSGovernmentCloud))) } } } diff --git a/pkg/internal/apis/certmanager/validation/issuer_test.go b/pkg/internal/apis/certmanager/validation/issuer_test.go index 35f462154d3..9d40e9e0461 100644 --- a/pkg/internal/apis/certmanager/validation/issuer_test.go +++ b/pkg/internal/apis/certmanager/validation/issuer_test.go @@ -24,12 +24,13 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/validation/field" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" ) var ( - validCloudDNSProvider = v1alpha2.ACMEIssuerDNS01ProviderCloudDNS{ + validCloudDNSProvider = cmacme.ACMEIssuerDNS01ProviderCloudDNS{ ServiceAccount: validSecretKeyRef, Project: "valid", } @@ -39,11 +40,11 @@ var ( }, Key: "validkey", } - validCloudflareProvider = v1alpha2.ACMEIssuerDNS01ProviderCloudflare{ + validCloudflareProvider = cmacme.ACMEIssuerDNS01ProviderCloudflare{ APIKey: validSecretKeyRef, Email: "valid", } - validACMEIssuer = v1alpha2.ACMEIssuer{ + validACMEIssuer = cmacme.ACMEIssuer{ Email: "valid-email", Server: "valid-server", PrivateKey: validSecretKeyRef, @@ -104,25 +105,25 @@ func TestValidateVaultIssuerConfig(t *testing.T) { func TestValidateACMEIssuerConfig(t *testing.T) { fldPath := field.NewPath("") scenarios := map[string]struct { - spec *v1alpha2.ACMEIssuer + spec *cmacme.ACMEIssuer errs []*field.Error }{ "valid acme issuer": { spec: &validACMEIssuer, }, "acme issuer with missing fields": { - spec: &v1alpha2.ACMEIssuer{}, + spec: &cmacme.ACMEIssuer{}, errs: []*field.Error{ field.Required(fldPath.Child("privateKeySecretRef", "name"), "private key secret name is a required field"), field.Required(fldPath.Child("server"), "acme server URL is a required field"), }, }, "acme solver without any config": { - spec: &v1alpha2.ACMEIssuer{ + spec: &cmacme.ACMEIssuer{ Email: "valid-email", Server: "valid-server", PrivateKey: validSecretKeyRef, - Solvers: []v1alpha2.ACMEChallengeSolver{ + Solvers: []cmacme.ACMEChallengeSolver{ {}, }, }, @@ -131,13 +132,13 @@ func TestValidateACMEIssuerConfig(t *testing.T) { }, }, "acme solver with valid dns01 config": { - spec: &v1alpha2.ACMEIssuer{ + spec: &cmacme.ACMEIssuer{ Email: "valid-email", Server: "valid-server", PrivateKey: validSecretKeyRef, - Solvers: []v1alpha2.ACMEChallengeSolver{ + Solvers: []cmacme.ACMEChallengeSolver{ { - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ CloudDNS: &validCloudDNSProvider, }, }, @@ -145,13 +146,13 @@ func TestValidateACMEIssuerConfig(t *testing.T) { }, }, "acme solver with missing http01 config type": { - spec: &v1alpha2.ACMEIssuer{ + spec: &cmacme.ACMEIssuer{ Email: "valid-email", Server: "valid-server", PrivateKey: validSecretKeyRef, - Solvers: []v1alpha2.ACMEChallengeSolver{ + Solvers: []cmacme.ACMEChallengeSolver{ { - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{}, + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{}, }, }, }, @@ -160,29 +161,29 @@ func TestValidateACMEIssuerConfig(t *testing.T) { }, }, "acme solver with valid http01 config": { - spec: &v1alpha2.ACMEIssuer{ + spec: &cmacme.ACMEIssuer{ Email: "valid-email", Server: "valid-server", PrivateKey: validSecretKeyRef, - Solvers: []v1alpha2.ACMEChallengeSolver{ + Solvers: []cmacme.ACMEChallengeSolver{ { - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{}, + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{}, }, }, }, }, }, "acme issue with valid pod template ObjectMeta attributes": { - spec: &v1alpha2.ACMEIssuer{ + spec: &cmacme.ACMEIssuer{ Email: "valid-email", Server: "valid-server", PrivateKey: validSecretKeyRef, - Solvers: []v1alpha2.ACMEChallengeSolver{ + Solvers: []cmacme.ACMEChallengeSolver{ { - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ - PodTemplate: &v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ + PodTemplate: &cmacme.ACMEChallengeSolverHTTP01IngressPodTemplate{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ "valid_to_contain": "labels", @@ -199,15 +200,15 @@ func TestValidateACMEIssuerConfig(t *testing.T) { }, }, "acme issue with invalid pod template ObjectMeta attributes": { - spec: &v1alpha2.ACMEIssuer{ + spec: &cmacme.ACMEIssuer{ Email: "valid-email", Server: "valid-server", PrivateKey: validSecretKeyRef, - Solvers: []v1alpha2.ACMEChallengeSolver{ + Solvers: []cmacme.ACMEChallengeSolver{ { - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ - PodTemplate: &v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ + PodTemplate: &cmacme.ACMEChallengeSolverHTTP01IngressPodTemplate{ ObjectMeta: metav1.ObjectMeta{ Annotations: map[string]string{ "valid_to_contain": "annotations", @@ -227,16 +228,16 @@ func TestValidateACMEIssuerConfig(t *testing.T) { }, }, "acme issue with valid pod template PodSpec attributes": { - spec: &v1alpha2.ACMEIssuer{ + spec: &cmacme.ACMEIssuer{ Email: "valid-email", Server: "valid-server", PrivateKey: validSecretKeyRef, - Solvers: []v1alpha2.ACMEChallengeSolver{ + Solvers: []cmacme.ACMEChallengeSolver{ { - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ - PodTemplate: &v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate{ - Spec: v1alpha2.ACMEChallengeSolverHTTP01IngressPodSpec{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ + PodTemplate: &cmacme.ACMEChallengeSolverHTTP01IngressPodTemplate{ + Spec: cmacme.ACMEChallengeSolverHTTP01IngressPodSpec{ NodeSelector: map[string]string{ "valid_to_contain": "nodeSelector", }, @@ -256,21 +257,21 @@ func TestValidateACMEIssuerConfig(t *testing.T) { }, }, "acme issue with valid pod template ObjectMeta and PodSpec attributes": { - spec: &v1alpha2.ACMEIssuer{ + spec: &cmacme.ACMEIssuer{ Email: "valid-email", Server: "valid-server", PrivateKey: validSecretKeyRef, - Solvers: []v1alpha2.ACMEChallengeSolver{ + Solvers: []cmacme.ACMEChallengeSolver{ { - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ - PodTemplate: &v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ + PodTemplate: &cmacme.ACMEChallengeSolverHTTP01IngressPodTemplate{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ "valid_to_contain": "labels", }, }, - Spec: v1alpha2.ACMEChallengeSolverHTTP01IngressPodSpec{ + Spec: cmacme.ACMEChallengeSolverHTTP01IngressPodSpec{ NodeSelector: map[string]string{ "valid_to_contain": "nodeSelector", }, @@ -387,33 +388,33 @@ func TestValidateACMEIssuerHTTP01Config(t *testing.T) { fldPath := field.NewPath("") scenarios := map[string]struct { isExpectedFailure bool - cfg *v1alpha2.ACMEChallengeSolverHTTP01 + cfg *cmacme.ACMEChallengeSolverHTTP01 errs []*field.Error }{ "ingress field specified": { - cfg: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{Name: "abc"}, + cfg: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{Name: "abc"}, }, }, "ingress class field specified": { - cfg: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{Class: strPtr("abc")}, + cfg: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{Class: strPtr("abc")}, }, }, "neither field specified": { - cfg: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{}, + cfg: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{}, }, }, "no solver config type specified": { - cfg: &v1alpha2.ACMEChallengeSolverHTTP01{}, + cfg: &cmacme.ACMEChallengeSolverHTTP01{}, errs: []*field.Error{ field.Required(fldPath, "no HTTP01 solver type configured"), }, }, "both fields specified": { - cfg: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + cfg: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "abc", Class: strPtr("abc"), }, @@ -423,29 +424,29 @@ func TestValidateACMEIssuerHTTP01Config(t *testing.T) { }, }, "acme issuer with valid http01 service config serviceType ClusterIP": { - cfg: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + cfg: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ ServiceType: corev1.ServiceType("ClusterIP"), }, }, }, "acme issuer with valid http01 service config serviceType NodePort": { - cfg: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + cfg: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ ServiceType: corev1.ServiceType("NodePort"), }, }, }, "acme issuer with valid http01 service config serviceType (empty string)": { - cfg: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + cfg: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ ServiceType: corev1.ServiceType(""), }, }, }, "acme issuer with invalid http01 service config": { - cfg: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + cfg: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ ServiceType: corev1.ServiceType("InvalidServiceType"), }, }, @@ -474,12 +475,12 @@ func TestValidateACMEIssuerHTTP01Config(t *testing.T) { func TestValidateACMEIssuerDNS01Config(t *testing.T) { fldPath := field.NewPath("test") scenarios := map[string]struct { - cfg *v1alpha2.ACMEChallengeSolverDNS01 + cfg *cmacme.ACMEChallengeSolverDNS01 errs []*field.Error }{ "missing clouddns project": { - cfg: &v1alpha2.ACMEChallengeSolverDNS01{ - CloudDNS: &v1alpha2.ACMEIssuerDNS01ProviderCloudDNS{ + cfg: &cmacme.ACMEChallengeSolverDNS01{ + CloudDNS: &cmacme.ACMEIssuerDNS01ProviderCloudDNS{ ServiceAccount: validSecretKeyRef, }, }, @@ -488,8 +489,8 @@ func TestValidateACMEIssuerDNS01Config(t *testing.T) { }, }, "missing clouddns service account key": { - cfg: &v1alpha2.ACMEChallengeSolverDNS01{ - CloudDNS: &v1alpha2.ACMEIssuerDNS01ProviderCloudDNS{ + cfg: &cmacme.ACMEChallengeSolverDNS01{ + CloudDNS: &cmacme.ACMEIssuerDNS01ProviderCloudDNS{ Project: "valid", ServiceAccount: cmmeta.SecretKeySelector{ LocalObjectReference: cmmeta.LocalObjectReference{Name: "something"}, @@ -502,8 +503,8 @@ func TestValidateACMEIssuerDNS01Config(t *testing.T) { }, }, "missing clouddns service account name": { - cfg: &v1alpha2.ACMEChallengeSolverDNS01{ - CloudDNS: &v1alpha2.ACMEIssuerDNS01ProviderCloudDNS{ + cfg: &cmacme.ACMEChallengeSolverDNS01{ + CloudDNS: &cmacme.ACMEIssuerDNS01ProviderCloudDNS{ Project: "valid", ServiceAccount: cmmeta.SecretKeySelector{ LocalObjectReference: cmmeta.LocalObjectReference{Name: ""}, @@ -516,15 +517,15 @@ func TestValidateACMEIssuerDNS01Config(t *testing.T) { }, }, "clouddns serviceAccount field not set should be allowed for ambient auth": { - cfg: &v1alpha2.ACMEChallengeSolverDNS01{ - CloudDNS: &v1alpha2.ACMEIssuerDNS01ProviderCloudDNS{ + cfg: &cmacme.ACMEChallengeSolverDNS01{ + CloudDNS: &cmacme.ACMEIssuerDNS01ProviderCloudDNS{ Project: "valid", }, }, }, "missing cloudflare token": { - cfg: &v1alpha2.ACMEChallengeSolverDNS01{ - Cloudflare: &v1alpha2.ACMEIssuerDNS01ProviderCloudflare{ + cfg: &cmacme.ACMEChallengeSolverDNS01{ + Cloudflare: &cmacme.ACMEIssuerDNS01ProviderCloudflare{ Email: "valid", }, }, @@ -534,8 +535,8 @@ func TestValidateACMEIssuerDNS01Config(t *testing.T) { }, }, "missing cloudflare email": { - cfg: &v1alpha2.ACMEChallengeSolverDNS01{ - Cloudflare: &v1alpha2.ACMEIssuerDNS01ProviderCloudflare{ + cfg: &cmacme.ACMEChallengeSolverDNS01{ + Cloudflare: &cmacme.ACMEIssuerDNS01ProviderCloudflare{ APIKey: validSecretKeyRef, }, }, @@ -544,22 +545,22 @@ func TestValidateACMEIssuerDNS01Config(t *testing.T) { }, }, "missing route53 region": { - cfg: &v1alpha2.ACMEChallengeSolverDNS01{ - Route53: &v1alpha2.ACMEIssuerDNS01ProviderRoute53{}, + cfg: &cmacme.ACMEChallengeSolverDNS01{ + Route53: &cmacme.ACMEIssuerDNS01ProviderRoute53{}, }, errs: []*field.Error{ field.Required(fldPath.Child("route53", "region"), ""), }, }, "missing provider config": { - cfg: &v1alpha2.ACMEChallengeSolverDNS01{}, + cfg: &cmacme.ACMEChallengeSolverDNS01{}, errs: []*field.Error{ field.Required(fldPath, "no DNS01 provider configured"), }, }, "missing azuredns config": { - cfg: &v1alpha2.ACMEChallengeSolverDNS01{ - AzureDNS: &v1alpha2.ACMEIssuerDNS01ProviderAzureDNS{}, + cfg: &cmacme.ACMEChallengeSolverDNS01{ + AzureDNS: &cmacme.ACMEIssuerDNS01ProviderAzureDNS{}, }, errs: []*field.Error{ field.Required(fldPath.Child("azuredns", "clientSecretSecretRef", "name"), "secret name is required"), @@ -571,8 +572,8 @@ func TestValidateACMEIssuerDNS01Config(t *testing.T) { }, }, "invalid azuredns environment": { - cfg: &v1alpha2.ACMEChallengeSolverDNS01{ - AzureDNS: &v1alpha2.ACMEIssuerDNS01ProviderAzureDNS{ + cfg: &cmacme.ACMEChallengeSolverDNS01{ + AzureDNS: &cmacme.ACMEIssuerDNS01ProviderAzureDNS{ Environment: "an env", }, }, @@ -583,13 +584,13 @@ func TestValidateACMEIssuerDNS01Config(t *testing.T) { field.Required(fldPath.Child("azuredns", "subscriptionID"), ""), field.Required(fldPath.Child("azuredns", "tenantID"), ""), field.Required(fldPath.Child("azuredns", "resourceGroupName"), ""), - field.Invalid(fldPath.Child("azuredns", "environment"), v1alpha2.AzureDNSEnvironment("an env"), + field.Invalid(fldPath.Child("azuredns", "environment"), cmacme.AzureDNSEnvironment("an env"), "must be either empty or one of AzurePublicCloud, AzureChinaCloud, AzureGermanCloud or AzureUSGovernmentCloud"), }, }, "missing akamai config": { - cfg: &v1alpha2.ACMEChallengeSolverDNS01{ - Akamai: &v1alpha2.ACMEIssuerDNS01ProviderAkamai{}, + cfg: &cmacme.ACMEChallengeSolverDNS01{ + Akamai: &cmacme.ACMEIssuerDNS01ProviderAkamai{}, }, errs: []*field.Error{ field.Required(fldPath.Child("akamai", "accessToken", "name"), "secret name is required"), @@ -602,8 +603,8 @@ func TestValidateACMEIssuerDNS01Config(t *testing.T) { }, }, "valid akamai config": { - cfg: &v1alpha2.ACMEChallengeSolverDNS01{ - Akamai: &v1alpha2.ACMEIssuerDNS01ProviderAkamai{ + cfg: &cmacme.ACMEChallengeSolverDNS01{ + Akamai: &cmacme.ACMEIssuerDNS01ProviderAkamai{ AccessToken: validSecretKeyRef, ClientSecret: validSecretKeyRef, ClientToken: validSecretKeyRef, @@ -613,24 +614,24 @@ func TestValidateACMEIssuerDNS01Config(t *testing.T) { errs: []*field.Error{}, }, "valid rfc2136 config": { - cfg: &v1alpha2.ACMEChallengeSolverDNS01{ - RFC2136: &v1alpha2.ACMEIssuerDNS01ProviderRFC2136{ + cfg: &cmacme.ACMEChallengeSolverDNS01{ + RFC2136: &cmacme.ACMEIssuerDNS01ProviderRFC2136{ Nameserver: "127.0.0.1", }, }, errs: []*field.Error{}, }, "missing rfc2136 required field": { - cfg: &v1alpha2.ACMEChallengeSolverDNS01{ - RFC2136: &v1alpha2.ACMEIssuerDNS01ProviderRFC2136{}, + cfg: &cmacme.ACMEChallengeSolverDNS01{ + RFC2136: &cmacme.ACMEIssuerDNS01ProviderRFC2136{}, }, errs: []*field.Error{ field.Required(fldPath.Child("rfc2136", "nameserver"), ""), }, }, "rfc2136 provider invalid nameserver": { - cfg: &v1alpha2.ACMEChallengeSolverDNS01{ - RFC2136: &v1alpha2.ACMEIssuerDNS01ProviderRFC2136{ + cfg: &cmacme.ACMEChallengeSolverDNS01{ + RFC2136: &cmacme.ACMEIssuerDNS01ProviderRFC2136{ Nameserver: "dns.example.com", }, }, @@ -639,8 +640,8 @@ func TestValidateACMEIssuerDNS01Config(t *testing.T) { }, }, "rfc2136 provider using case-camel in algorithm": { - cfg: &v1alpha2.ACMEChallengeSolverDNS01{ - RFC2136: &v1alpha2.ACMEIssuerDNS01ProviderRFC2136{ + cfg: &cmacme.ACMEChallengeSolverDNS01{ + RFC2136: &cmacme.ACMEIssuerDNS01ProviderRFC2136{ Nameserver: "127.0.0.1", TSIGAlgorithm: "HmAcMd5", }, @@ -648,8 +649,8 @@ func TestValidateACMEIssuerDNS01Config(t *testing.T) { errs: []*field.Error{}, }, "rfc2136 provider using unsupported algorithm": { - cfg: &v1alpha2.ACMEChallengeSolverDNS01{ - RFC2136: &v1alpha2.ACMEIssuerDNS01ProviderRFC2136{ + cfg: &cmacme.ACMEChallengeSolverDNS01{ + RFC2136: &cmacme.ACMEIssuerDNS01ProviderRFC2136{ Nameserver: "127.0.0.1", TSIGAlgorithm: "HAMMOCK", }, @@ -659,8 +660,8 @@ func TestValidateACMEIssuerDNS01Config(t *testing.T) { }, }, "rfc2136 provider TSIGKeyName provided but no TSIGSecret": { - cfg: &v1alpha2.ACMEChallengeSolverDNS01{ - RFC2136: &v1alpha2.ACMEIssuerDNS01ProviderRFC2136{ + cfg: &cmacme.ACMEChallengeSolverDNS01{ + RFC2136: &cmacme.ACMEIssuerDNS01ProviderRFC2136{ Nameserver: "127.0.0.1", TSIGKeyName: "some-name", }, @@ -671,8 +672,8 @@ func TestValidateACMEIssuerDNS01Config(t *testing.T) { }, }, "rfc2136 provider TSIGSecret provided but no TSIGKeyName": { - cfg: &v1alpha2.ACMEChallengeSolverDNS01{ - RFC2136: &v1alpha2.ACMEIssuerDNS01ProviderRFC2136{ + cfg: &cmacme.ACMEChallengeSolverDNS01{ + RFC2136: &cmacme.ACMEIssuerDNS01ProviderRFC2136{ Nameserver: "127.0.0.1", TSIGSecret: validSecretKeyRef, }, @@ -682,11 +683,11 @@ func TestValidateACMEIssuerDNS01Config(t *testing.T) { }, }, "multiple providers configured": { - cfg: &v1alpha2.ACMEChallengeSolverDNS01{ - CloudDNS: &v1alpha2.ACMEIssuerDNS01ProviderCloudDNS{ + cfg: &cmacme.ACMEChallengeSolverDNS01{ + CloudDNS: &cmacme.ACMEIssuerDNS01ProviderCloudDNS{ Project: "something", }, - Cloudflare: &v1alpha2.ACMEIssuerDNS01ProviderCloudflare{}, + Cloudflare: &cmacme.ACMEIssuerDNS01ProviderCloudflare{}, }, errs: []*field.Error{ field.Forbidden(fldPath.Child("cloudflare"), "may not specify more than one provider type"), diff --git a/pkg/internal/apis/certmanager/zz_generated.deepcopy.go b/pkg/internal/apis/certmanager/zz_generated.deepcopy.go index 8aedbc6095d..066e32c045a 100644 --- a/pkg/internal/apis/certmanager/zz_generated.deepcopy.go +++ b/pkg/internal/apis/certmanager/zz_generated.deepcopy.go @@ -21,440 +21,11 @@ limitations under the License. package certmanager import ( - v1 "k8s.io/api/core/v1" - v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + acme "github.com/jetstack/cert-manager/pkg/internal/apis/acme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEAuthorization) DeepCopyInto(out *ACMEAuthorization) { - *out = *in - if in.Challenges != nil { - in, out := &in.Challenges, &out.Challenges - *out = make([]ACMEChallenge, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEAuthorization. -func (in *ACMEAuthorization) DeepCopy() *ACMEAuthorization { - if in == nil { - return nil - } - out := new(ACMEAuthorization) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEChallenge) DeepCopyInto(out *ACMEChallenge) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallenge. -func (in *ACMEChallenge) DeepCopy() *ACMEChallenge { - if in == nil { - return nil - } - out := new(ACMEChallenge) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEChallengeSolver) DeepCopyInto(out *ACMEChallengeSolver) { - *out = *in - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = new(CertificateDNSNameSelector) - (*in).DeepCopyInto(*out) - } - if in.HTTP01 != nil { - in, out := &in.HTTP01, &out.HTTP01 - *out = new(ACMEChallengeSolverHTTP01) - (*in).DeepCopyInto(*out) - } - if in.DNS01 != nil { - in, out := &in.DNS01, &out.DNS01 - *out = new(ACMEChallengeSolverDNS01) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolver. -func (in *ACMEChallengeSolver) DeepCopy() *ACMEChallengeSolver { - if in == nil { - return nil - } - out := new(ACMEChallengeSolver) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEChallengeSolverDNS01) DeepCopyInto(out *ACMEChallengeSolverDNS01) { - *out = *in - if in.Akamai != nil { - in, out := &in.Akamai, &out.Akamai - *out = new(ACMEIssuerDNS01ProviderAkamai) - **out = **in - } - if in.CloudDNS != nil { - in, out := &in.CloudDNS, &out.CloudDNS - *out = new(ACMEIssuerDNS01ProviderCloudDNS) - **out = **in - } - if in.Cloudflare != nil { - in, out := &in.Cloudflare, &out.Cloudflare - *out = new(ACMEIssuerDNS01ProviderCloudflare) - **out = **in - } - if in.Route53 != nil { - in, out := &in.Route53, &out.Route53 - *out = new(ACMEIssuerDNS01ProviderRoute53) - **out = **in - } - if in.AzureDNS != nil { - in, out := &in.AzureDNS, &out.AzureDNS - *out = new(ACMEIssuerDNS01ProviderAzureDNS) - **out = **in - } - if in.DigitalOcean != nil { - in, out := &in.DigitalOcean, &out.DigitalOcean - *out = new(ACMEIssuerDNS01ProviderDigitalOcean) - **out = **in - } - if in.AcmeDNS != nil { - in, out := &in.AcmeDNS, &out.AcmeDNS - *out = new(ACMEIssuerDNS01ProviderAcmeDNS) - **out = **in - } - if in.RFC2136 != nil { - in, out := &in.RFC2136, &out.RFC2136 - *out = new(ACMEIssuerDNS01ProviderRFC2136) - **out = **in - } - if in.Webhook != nil { - in, out := &in.Webhook, &out.Webhook - *out = new(ACMEIssuerDNS01ProviderWebhook) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolverDNS01. -func (in *ACMEChallengeSolverDNS01) DeepCopy() *ACMEChallengeSolverDNS01 { - if in == nil { - return nil - } - out := new(ACMEChallengeSolverDNS01) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEChallengeSolverHTTP01) DeepCopyInto(out *ACMEChallengeSolverHTTP01) { - *out = *in - if in.Ingress != nil { - in, out := &in.Ingress, &out.Ingress - *out = new(ACMEChallengeSolverHTTP01Ingress) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolverHTTP01. -func (in *ACMEChallengeSolverHTTP01) DeepCopy() *ACMEChallengeSolverHTTP01 { - if in == nil { - return nil - } - out := new(ACMEChallengeSolverHTTP01) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEChallengeSolverHTTP01Ingress) DeepCopyInto(out *ACMEChallengeSolverHTTP01Ingress) { - *out = *in - if in.Class != nil { - in, out := &in.Class, &out.Class - *out = new(string) - **out = **in - } - if in.PodTemplate != nil { - in, out := &in.PodTemplate, &out.PodTemplate - *out = new(ACMEChallengeSolverHTTP01IngressPodTemplate) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolverHTTP01Ingress. -func (in *ACMEChallengeSolverHTTP01Ingress) DeepCopy() *ACMEChallengeSolverHTTP01Ingress { - if in == nil { - return nil - } - out := new(ACMEChallengeSolverHTTP01Ingress) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEChallengeSolverHTTP01IngressPodSpec) DeepCopyInto(out *ACMEChallengeSolverHTTP01IngressPodSpec) { - *out = *in - if in.NodeSelector != nil { - in, out := &in.NodeSelector, &out.NodeSelector - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Affinity != nil { - in, out := &in.Affinity, &out.Affinity - *out = new(v1.Affinity) - (*in).DeepCopyInto(*out) - } - if in.Tolerations != nil { - in, out := &in.Tolerations, &out.Tolerations - *out = make([]v1.Toleration, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolverHTTP01IngressPodSpec. -func (in *ACMEChallengeSolverHTTP01IngressPodSpec) DeepCopy() *ACMEChallengeSolverHTTP01IngressPodSpec { - if in == nil { - return nil - } - out := new(ACMEChallengeSolverHTTP01IngressPodSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEChallengeSolverHTTP01IngressPodTemplate) DeepCopyInto(out *ACMEChallengeSolverHTTP01IngressPodTemplate) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEChallengeSolverHTTP01IngressPodTemplate. -func (in *ACMEChallengeSolverHTTP01IngressPodTemplate) DeepCopy() *ACMEChallengeSolverHTTP01IngressPodTemplate { - if in == nil { - return nil - } - out := new(ACMEChallengeSolverHTTP01IngressPodTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuer) DeepCopyInto(out *ACMEIssuer) { - *out = *in - out.PrivateKey = in.PrivateKey - if in.Solvers != nil { - in, out := &in.Solvers, &out.Solvers - *out = make([]ACMEChallengeSolver, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuer. -func (in *ACMEIssuer) DeepCopy() *ACMEIssuer { - if in == nil { - return nil - } - out := new(ACMEIssuer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuerDNS01ProviderAcmeDNS) DeepCopyInto(out *ACMEIssuerDNS01ProviderAcmeDNS) { - *out = *in - out.AccountSecret = in.AccountSecret - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderAcmeDNS. -func (in *ACMEIssuerDNS01ProviderAcmeDNS) DeepCopy() *ACMEIssuerDNS01ProviderAcmeDNS { - if in == nil { - return nil - } - out := new(ACMEIssuerDNS01ProviderAcmeDNS) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuerDNS01ProviderAkamai) DeepCopyInto(out *ACMEIssuerDNS01ProviderAkamai) { - *out = *in - out.ClientToken = in.ClientToken - out.ClientSecret = in.ClientSecret - out.AccessToken = in.AccessToken - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderAkamai. -func (in *ACMEIssuerDNS01ProviderAkamai) DeepCopy() *ACMEIssuerDNS01ProviderAkamai { - if in == nil { - return nil - } - out := new(ACMEIssuerDNS01ProviderAkamai) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuerDNS01ProviderAzureDNS) DeepCopyInto(out *ACMEIssuerDNS01ProviderAzureDNS) { - *out = *in - out.ClientSecret = in.ClientSecret - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderAzureDNS. -func (in *ACMEIssuerDNS01ProviderAzureDNS) DeepCopy() *ACMEIssuerDNS01ProviderAzureDNS { - if in == nil { - return nil - } - out := new(ACMEIssuerDNS01ProviderAzureDNS) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuerDNS01ProviderCloudDNS) DeepCopyInto(out *ACMEIssuerDNS01ProviderCloudDNS) { - *out = *in - out.ServiceAccount = in.ServiceAccount - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderCloudDNS. -func (in *ACMEIssuerDNS01ProviderCloudDNS) DeepCopy() *ACMEIssuerDNS01ProviderCloudDNS { - if in == nil { - return nil - } - out := new(ACMEIssuerDNS01ProviderCloudDNS) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuerDNS01ProviderCloudflare) DeepCopyInto(out *ACMEIssuerDNS01ProviderCloudflare) { - *out = *in - out.APIKey = in.APIKey - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderCloudflare. -func (in *ACMEIssuerDNS01ProviderCloudflare) DeepCopy() *ACMEIssuerDNS01ProviderCloudflare { - if in == nil { - return nil - } - out := new(ACMEIssuerDNS01ProviderCloudflare) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuerDNS01ProviderDigitalOcean) DeepCopyInto(out *ACMEIssuerDNS01ProviderDigitalOcean) { - *out = *in - out.Token = in.Token - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderDigitalOcean. -func (in *ACMEIssuerDNS01ProviderDigitalOcean) DeepCopy() *ACMEIssuerDNS01ProviderDigitalOcean { - if in == nil { - return nil - } - out := new(ACMEIssuerDNS01ProviderDigitalOcean) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuerDNS01ProviderRFC2136) DeepCopyInto(out *ACMEIssuerDNS01ProviderRFC2136) { - *out = *in - out.TSIGSecret = in.TSIGSecret - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderRFC2136. -func (in *ACMEIssuerDNS01ProviderRFC2136) DeepCopy() *ACMEIssuerDNS01ProviderRFC2136 { - if in == nil { - return nil - } - out := new(ACMEIssuerDNS01ProviderRFC2136) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuerDNS01ProviderRoute53) DeepCopyInto(out *ACMEIssuerDNS01ProviderRoute53) { - *out = *in - out.SecretAccessKey = in.SecretAccessKey - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderRoute53. -func (in *ACMEIssuerDNS01ProviderRoute53) DeepCopy() *ACMEIssuerDNS01ProviderRoute53 { - if in == nil { - return nil - } - out := new(ACMEIssuerDNS01ProviderRoute53) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuerDNS01ProviderWebhook) DeepCopyInto(out *ACMEIssuerDNS01ProviderWebhook) { - *out = *in - if in.Config != nil { - in, out := &in.Config, &out.Config - *out = new(v1beta1.JSON) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerDNS01ProviderWebhook. -func (in *ACMEIssuerDNS01ProviderWebhook) DeepCopy() *ACMEIssuerDNS01ProviderWebhook { - if in == nil { - return nil - } - out := new(ACMEIssuerDNS01ProviderWebhook) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ACMEIssuerStatus) DeepCopyInto(out *ACMEIssuerStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACMEIssuerStatus. -func (in *ACMEIssuerStatus) DeepCopy() *ACMEIssuerStatus { - if in == nil { - return nil - } - out := new(ACMEIssuerStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CAIssuer) DeepCopyInto(out *CAIssuer) { *out = *in @@ -519,39 +90,6 @@ func (in *CertificateCondition) DeepCopy() *CertificateCondition { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CertificateDNSNameSelector) DeepCopyInto(out *CertificateDNSNameSelector) { - *out = *in - if in.MatchLabels != nil { - in, out := &in.MatchLabels, &out.MatchLabels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.DNSNames != nil { - in, out := &in.DNSNames, &out.DNSNames - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.DNSZones != nil { - in, out := &in.DNSZones, &out.DNSZones - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateDNSNameSelector. -func (in *CertificateDNSNameSelector) DeepCopy() *CertificateDNSNameSelector { - if in == nil { - return nil - } - out := new(CertificateDNSNameSelector) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CertificateList) DeepCopyInto(out *CertificateList) { *out = *in @@ -671,7 +209,7 @@ func (in *CertificateRequestSpec) DeepCopyInto(out *CertificateRequestSpec) { *out = *in if in.Duration != nil { in, out := &in.Duration, &out.Duration - *out = new(metav1.Duration) + *out = new(v1.Duration) (*in).DeepCopyInto(*out) } out.IssuerRef = in.IssuerRef @@ -745,12 +283,12 @@ func (in *CertificateSpec) DeepCopyInto(out *CertificateSpec) { } if in.Duration != nil { in, out := &in.Duration, &out.Duration - *out = new(metav1.Duration) + *out = new(v1.Duration) (*in).DeepCopyInto(*out) } if in.RenewBefore != nil { in, out := &in.RenewBefore, &out.RenewBefore - *out = new(metav1.Duration) + *out = new(v1.Duration) (*in).DeepCopyInto(*out) } if in.DNSNames != nil { @@ -813,105 +351,6 @@ func (in *CertificateStatus) DeepCopy() *CertificateStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Challenge) DeepCopyInto(out *Challenge) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Challenge. -func (in *Challenge) DeepCopy() *Challenge { - if in == nil { - return nil - } - out := new(Challenge) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Challenge) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ChallengeList) DeepCopyInto(out *ChallengeList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Challenge, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChallengeList. -func (in *ChallengeList) DeepCopy() *ChallengeList { - if in == nil { - return nil - } - out := new(ChallengeList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ChallengeList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ChallengeSpec) DeepCopyInto(out *ChallengeSpec) { - *out = *in - if in.Solver != nil { - in, out := &in.Solver, &out.Solver - *out = new(ACMEChallengeSolver) - (*in).DeepCopyInto(*out) - } - out.IssuerRef = in.IssuerRef - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChallengeSpec. -func (in *ChallengeSpec) DeepCopy() *ChallengeSpec { - if in == nil { - return nil - } - out := new(ChallengeSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ChallengeStatus) DeepCopyInto(out *ChallengeStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChallengeStatus. -func (in *ChallengeStatus) DeepCopy() *ChallengeStatus { - if in == nil { - return nil - } - out := new(ChallengeStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterIssuer) DeepCopyInto(out *ClusterIssuer) { *out = *in @@ -1026,7 +465,7 @@ func (in *IssuerConfig) DeepCopyInto(out *IssuerConfig) { *out = *in if in.ACME != nil { in, out := &in.ACME, &out.ACME - *out = new(ACMEIssuer) + *out = new(acme.ACMEIssuer) (*in).DeepCopyInto(*out) } if in.CA != nil { @@ -1124,7 +563,7 @@ func (in *IssuerStatus) DeepCopyInto(out *IssuerStatus) { } if in.ACME != nil { in, out := &in.ACME, &out.ACME - *out = new(ACMEIssuerStatus) + *out = new(acme.ACMEIssuerStatus) **out = **in } return @@ -1140,126 +579,6 @@ func (in *IssuerStatus) DeepCopy() *IssuerStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Order) DeepCopyInto(out *Order) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Order. -func (in *Order) DeepCopy() *Order { - if in == nil { - return nil - } - out := new(Order) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Order) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OrderList) DeepCopyInto(out *OrderList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Order, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OrderList. -func (in *OrderList) DeepCopy() *OrderList { - if in == nil { - return nil - } - out := new(OrderList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OrderList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OrderSpec) DeepCopyInto(out *OrderSpec) { - *out = *in - if in.CSR != nil { - in, out := &in.CSR, &out.CSR - *out = make([]byte, len(*in)) - copy(*out, *in) - } - out.IssuerRef = in.IssuerRef - if in.DNSNames != nil { - in, out := &in.DNSNames, &out.DNSNames - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OrderSpec. -func (in *OrderSpec) DeepCopy() *OrderSpec { - if in == nil { - return nil - } - out := new(OrderSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OrderStatus) DeepCopyInto(out *OrderStatus) { - *out = *in - if in.Certificate != nil { - in, out := &in.Certificate, &out.Certificate - *out = make([]byte, len(*in)) - copy(*out, *in) - } - if in.Authorizations != nil { - in, out := &in.Authorizations, &out.Authorizations - *out = make([]ACMEAuthorization, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.FailureTime != nil { - in, out := &in.FailureTime, &out.FailureTime - *out = (*in).DeepCopy() - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OrderStatus. -func (in *OrderStatus) DeepCopy() *OrderStatus { - if in == nil { - return nil - } - out := new(OrderStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SelfSignedIssuer) DeepCopyInto(out *SelfSignedIssuer) { *out = *in diff --git a/pkg/issuer/acme/BUILD.bazel b/pkg/issuer/acme/BUILD.bazel index 8f8c3edf219..5498e0367ff 100644 --- a/pkg/issuer/acme/BUILD.bazel +++ b/pkg/issuer/acme/BUILD.bazel @@ -14,7 +14,7 @@ go_library( "//pkg/api/util:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", - "//pkg/client/listers/certmanager/v1alpha2:go_default_library", + "//pkg/client/listers/acme/v1alpha2:go_default_library", "//pkg/controller:go_default_library", "//pkg/issuer:go_default_library", "//pkg/logs:go_default_library", @@ -38,6 +38,7 @@ go_test( embed = [":go_default_library"], deps = [ "//pkg/acme/client:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", "//pkg/controller/test:go_default_library", diff --git a/pkg/issuer/acme/acme.go b/pkg/issuer/acme/acme.go index 4aef55c8745..34c2f378145 100644 --- a/pkg/issuer/acme/acme.go +++ b/pkg/issuer/acme/acme.go @@ -25,7 +25,7 @@ import ( "github.com/jetstack/cert-manager/pkg/acme" apiutil "github.com/jetstack/cert-manager/pkg/api/util" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" - cmlisters "github.com/jetstack/cert-manager/pkg/client/listers/certmanager/v1alpha2" + cmacmelisters "github.com/jetstack/cert-manager/pkg/client/listers/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/controller" "github.com/jetstack/cert-manager/pkg/issuer" ) @@ -39,7 +39,7 @@ type Acme struct { helper acme.Helper secretsLister corelisters.SecretLister - orderLister cmlisters.OrderLister + orderLister cmacmelisters.OrderLister // used for testing clock clock.Clock @@ -55,7 +55,7 @@ func New(ctx *controller.Context, issuer v1alpha2.GenericIssuer) (issuer.Interfa // we are interested in secretsLister := ctx.KubeSharedInformerFactory.Core().V1().Secrets().Lister() - orderLister := ctx.SharedInformerFactory.Certmanager().V1alpha2().Orders().Lister() + orderLister := ctx.SharedInformerFactory.Acme().V1alpha2().Orders().Lister() a := &Acme{ Context: ctx, diff --git a/pkg/issuer/acme/dns/BUILD.bazel b/pkg/issuer/acme/dns/BUILD.bazel index fb706d6131b..6ca20faecf0 100644 --- a/pkg/issuer/acme/dns/BUILD.bazel +++ b/pkg/issuer/acme/dns/BUILD.bazel @@ -8,6 +8,7 @@ go_library( deps = [ "//pkg/acme/webhook:go_default_library", "//pkg/acme/webhook/apis/acme/v1alpha1:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", "//pkg/controller:go_default_library", @@ -36,6 +37,7 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", "//pkg/controller:go_default_library", diff --git a/pkg/issuer/acme/dns/dns.go b/pkg/issuer/acme/dns/dns.go index 286c72273b3..ae229a73cfc 100644 --- a/pkg/issuer/acme/dns/dns.go +++ b/pkg/issuer/acme/dns/dns.go @@ -29,6 +29,7 @@ import ( "github.com/jetstack/cert-manager/pkg/acme/webhook" whapi "github.com/jetstack/cert-manager/pkg/acme/webhook/apis/acme/v1alpha1" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" "github.com/jetstack/cert-manager/pkg/controller" @@ -79,7 +80,7 @@ type Solver struct { } // Present performs the work to configure DNS to resolve a DNS01 challenge. -func (s *Solver) Present(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *v1alpha2.Challenge) error { +func (s *Solver) Present(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *cmacme.Challenge) error { log := logs.WithResource(logs.FromContext(ctx, "Present"), ch).WithValues("domain", ch.Spec.DNSName) ctx = logs.NewContext(ctx, log) @@ -108,7 +109,7 @@ func (s *Solver) Present(ctx context.Context, issuer v1alpha2.GenericIssuer, ch } // Check verifies that the DNS records for the ACME challenge have propagated. -func (s *Solver) Check(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *v1alpha2.Challenge) error { +func (s *Solver) Check(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *cmacme.Challenge) error { log := logs.WithResource(logs.FromContext(ctx, "Check"), ch).WithValues("domain", ch.Spec.DNSName) ctx = logs.NewContext(ctx, log) @@ -138,7 +139,7 @@ func (s *Solver) Check(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *v // CleanUp removes DNS records which are no longer needed after // certificate issuance. -func (s *Solver) CleanUp(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *v1alpha2.Challenge) error { +func (s *Solver) CleanUp(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *cmacme.Challenge) error { log := logs.WithResource(logs.FromContext(ctx, "CleanUp"), ch).WithValues("domain", ch.Spec.DNSName) ctx = logs.NewContext(ctx, log) @@ -164,14 +165,14 @@ func (s *Solver) CleanUp(ctx context.Context, issuer v1alpha2.GenericIssuer, ch return slv.CleanUp(ch.Spec.DNSName, fqdn, ch.Spec.Key) } -func followCNAME(strategy v1alpha2.CNAMEStrategy) bool { - if strategy == v1alpha2.FollowStrategy { +func followCNAME(strategy cmacme.CNAMEStrategy) bool { + if strategy == cmacme.FollowStrategy { return true } return false } -func extractChallengeSolverConfig(ch *v1alpha2.Challenge) (*v1alpha2.ACMEChallengeSolverDNS01, error) { +func extractChallengeSolverConfig(ch *cmacme.Challenge) (*cmacme.ACMEChallengeSolverDNS01, error) { switch { case ch.Spec.Solver != nil: return ch.Spec.Solver.DNS01, nil @@ -183,7 +184,7 @@ func extractChallengeSolverConfig(ch *v1alpha2.Challenge) (*v1alpha2.ACMEChallen // solverForChallenge returns a Solver for the given providerName. // The providerName is the name of an ACME DNS-01 challenge provider as // specified on the Issuer resource for the Solver. -func (s *Solver) solverForChallenge(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *v1alpha2.Challenge) (solver, *v1alpha2.ACMEChallengeSolverDNS01, error) { +func (s *Solver) solverForChallenge(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *cmacme.Challenge) (solver, *cmacme.ACMEChallengeSolverDNS01, error) { log := logs.FromContext(ctx, "solverForChallenge") dbg := log.V(logs.DebugLevel) ctx = logs.NewContext(ctx, log) @@ -357,7 +358,7 @@ func (s *Solver) solverForChallenge(ctx context.Context, issuer v1alpha2.Generic return impl, providerConfig, nil } -func (s *Solver) prepareChallengeRequest(issuer v1alpha2.GenericIssuer, ch *v1alpha2.Challenge) (webhook.Solver, *whapi.ChallengeRequest, error) { +func (s *Solver) prepareChallengeRequest(issuer v1alpha2.GenericIssuer, ch *cmacme.Challenge) (webhook.Solver, *whapi.ChallengeRequest, error) { dns01Config, err := extractChallengeSolverConfig(ch) if err != nil { return nil, nil, err @@ -405,7 +406,7 @@ func (s *Solver) prepareChallengeRequest(issuer v1alpha2.GenericIssuer, ch *v1al var errNotFound = fmt.Errorf("failed to determine DNS01 solver type") -func (s *Solver) dns01SolverForConfig(config *v1alpha2.ACMEChallengeSolverDNS01) (webhook.Solver, interface{}, error) { +func (s *Solver) dns01SolverForConfig(config *cmacme.ACMEChallengeSolverDNS01) (webhook.Solver, interface{}, error) { solverName := "" var c interface{} switch { diff --git a/pkg/issuer/acme/dns/dns_test.go b/pkg/issuer/acme/dns/dns_test.go index 5281ede7a9d..25af557b13c 100644 --- a/pkg/issuer/acme/dns/dns_test.go +++ b/pkg/issuer/acme/dns/dns_test.go @@ -25,6 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" "github.com/jetstack/cert-manager/pkg/controller" @@ -42,7 +43,7 @@ func newIssuer(name, namespace string) *v1alpha2.Issuer { }, Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{}, + ACME: &cmacme.ACMEIssuer{}, }, }, } @@ -75,11 +76,11 @@ func TestSolverFor(t *testing.T) { }, }, Issuer: newIssuer("test", "default"), - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ - Solver: &v1alpha2.ACMEChallengeSolver{ - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - Cloudflare: &v1alpha2.ACMEIssuerDNS01ProviderCloudflare{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ + Solver: &cmacme.ACMEChallengeSolver{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + Cloudflare: &cmacme.ACMEIssuerDNS01ProviderCloudflare{ Email: "test", APIKey: cmmeta.SecretKeySelector{ LocalObjectReference: cmmeta.LocalObjectReference{ @@ -100,11 +101,11 @@ func TestSolverFor(t *testing.T) { solverFixture: &solverFixture{ Issuer: newIssuer("test", "default"), // don't include any secrets in the lister - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ - Solver: &v1alpha2.ACMEChallengeSolver{ - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - Cloudflare: &v1alpha2.ACMEIssuerDNS01ProviderCloudflare{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ + Solver: &cmacme.ACMEChallengeSolver{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + Cloudflare: &cmacme.ACMEIssuerDNS01ProviderCloudflare{ Email: "test", APIKey: cmmeta.SecretKeySelector{ LocalObjectReference: cmmeta.LocalObjectReference{ @@ -131,11 +132,11 @@ func TestSolverFor(t *testing.T) { }, }, Issuer: newIssuer("test", "default"), - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ - Solver: &v1alpha2.ACMEChallengeSolver{ - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - Cloudflare: &v1alpha2.ACMEIssuerDNS01ProviderCloudflare{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ + Solver: &cmacme.ACMEChallengeSolver{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + Cloudflare: &cmacme.ACMEIssuerDNS01ProviderCloudflare{ Email: "test", APIKey: cmmeta.SecretKeySelector{ LocalObjectReference: cmmeta.LocalObjectReference{ @@ -162,11 +163,11 @@ func TestSolverFor(t *testing.T) { }, }, Issuer: newIssuer("test", "default"), - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ - Solver: &v1alpha2.ACMEChallengeSolver{ - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - AcmeDNS: &v1alpha2.ACMEIssuerDNS01ProviderAcmeDNS{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ + Solver: &cmacme.ACMEChallengeSolver{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + AcmeDNS: &cmacme.ACMEIssuerDNS01ProviderAcmeDNS{ Host: "http://127.0.0.1/", AccountSecret: cmmeta.SecretKeySelector{ LocalObjectReference: cmmeta.LocalObjectReference{ @@ -216,11 +217,11 @@ func TestSolveForDigitalOcean(t *testing.T) { }, }, Issuer: newIssuer("test", "default"), - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ - Solver: &v1alpha2.ACMEChallengeSolver{ - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - DigitalOcean: &v1alpha2.ACMEIssuerDNS01ProviderDigitalOcean{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ + Solver: &cmacme.ACMEChallengeSolver{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + DigitalOcean: &cmacme.ACMEIssuerDNS01ProviderDigitalOcean{ Token: cmmeta.SecretKeySelector{ LocalObjectReference: cmmeta.LocalObjectReference{ Name: "digitalocean", @@ -267,11 +268,11 @@ func TestRoute53TrimCreds(t *testing.T) { }, }, Issuer: newIssuer("test", "default"), - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ - Solver: &v1alpha2.ACMEChallengeSolver{ - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - Route53: &v1alpha2.ACMEIssuerDNS01ProviderRoute53{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ + Solver: &cmacme.ACMEChallengeSolver{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + Route53: &cmacme.ACMEIssuerDNS01ProviderRoute53{ AccessKeyID: " test_with_spaces ", Region: "us-west-2", SecretAccessKey: cmmeta.SecretKeySelector{ @@ -330,11 +331,11 @@ func TestRoute53AmbientCreds(t *testing.T) { }, Issuer: newIssuer("test", "default"), dnsProviders: newFakeDNSProviders(), - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ - Solver: &v1alpha2.ACMEChallengeSolver{ - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - Route53: &v1alpha2.ACMEIssuerDNS01ProviderRoute53{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ + Solver: &cmacme.ACMEChallengeSolver{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + Route53: &cmacme.ACMEIssuerDNS01ProviderRoute53{ Region: "us-west-2", }, }, @@ -360,11 +361,11 @@ func TestRoute53AmbientCreds(t *testing.T) { }, Issuer: newIssuer("test", "default"), dnsProviders: newFakeDNSProviders(), - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ - Solver: &v1alpha2.ACMEChallengeSolver{ - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - Route53: &v1alpha2.ACMEIssuerDNS01ProviderRoute53{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ + Solver: &cmacme.ACMEChallengeSolver{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + Route53: &cmacme.ACMEIssuerDNS01ProviderRoute53{ Region: "us-west-2", }, }, @@ -420,11 +421,11 @@ func TestRoute53AssumeRole(t *testing.T) { }, Issuer: newIssuer("test", "default"), dnsProviders: newFakeDNSProviders(), - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ - Solver: &v1alpha2.ACMEChallengeSolver{ - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - Route53: &v1alpha2.ACMEIssuerDNS01ProviderRoute53{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ + Solver: &cmacme.ACMEChallengeSolver{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + Route53: &cmacme.ACMEIssuerDNS01ProviderRoute53{ Region: "us-west-2", Role: "my-role", }, @@ -451,11 +452,11 @@ func TestRoute53AssumeRole(t *testing.T) { }, Issuer: newIssuer("test", "default"), dnsProviders: newFakeDNSProviders(), - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ - Solver: &v1alpha2.ACMEChallengeSolver{ - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - Route53: &v1alpha2.ACMEIssuerDNS01ProviderRoute53{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ + Solver: &cmacme.ACMEChallengeSolver{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + Route53: &cmacme.ACMEIssuerDNS01ProviderRoute53{ Region: "us-west-2", Role: "my-other-role", }, diff --git a/pkg/issuer/acme/dns/rfc2136/BUILD.bazel b/pkg/issuer/acme/dns/rfc2136/BUILD.bazel index 8c7c0ca827e..aed6ff343ba 100644 --- a/pkg/issuer/acme/dns/rfc2136/BUILD.bazel +++ b/pkg/issuer/acme/dns/rfc2136/BUILD.bazel @@ -10,7 +10,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/acme/webhook/apis/acme/v1alpha1:go_default_library", - "//pkg/apis/certmanager/v1alpha2:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", "//pkg/internal/apis/certmanager/validation/util:go_default_library", "//vendor/github.com/miekg/dns:go_default_library", @@ -32,7 +32,7 @@ go_test( data = glob(["testdata/**"]), embed = [":go_default_library"], deps = [ - "//pkg/apis/certmanager/v1alpha2:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", "//pkg/logs:go_default_library", "//test/acme/dns:go_default_library", diff --git a/pkg/issuer/acme/dns/rfc2136/provider.go b/pkg/issuer/acme/dns/rfc2136/provider.go index 0370b9c3db0..bf24fbc08ca 100644 --- a/pkg/issuer/acme/dns/rfc2136/provider.go +++ b/pkg/issuer/acme/dns/rfc2136/provider.go @@ -29,7 +29,7 @@ import ( restclient "k8s.io/client-go/rest" whapi "github.com/jetstack/cert-manager/pkg/acme/webhook/apis/acme/v1alpha1" - cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" ) @@ -106,8 +106,8 @@ func (s *Solver) Initialize(kubeClientConfig *restclient.Config, stopCh <-chan s return nil } -func (s *Solver) loadConfig(cfgJSON extapi.JSON) (*cmapi.ACMEIssuerDNS01ProviderRFC2136, error) { - cfg := cmapi.ACMEIssuerDNS01ProviderRFC2136{} +func (s *Solver) loadConfig(cfgJSON extapi.JSON) (*cmacme.ACMEIssuerDNS01ProviderRFC2136, error) { + cfg := cmacme.ACMEIssuerDNS01ProviderRFC2136{} if err := json.Unmarshal(cfgJSON.Raw, &cfg); err != nil { return nil, fmt.Errorf("error decoding solver config: %v", err) } diff --git a/pkg/issuer/acme/dns/rfc2136/provider_test.go b/pkg/issuer/acme/dns/rfc2136/provider_test.go index 61695a191ee..b70ef1780ec 100644 --- a/pkg/issuer/acme/dns/rfc2136/provider_test.go +++ b/pkg/issuer/acme/dns/rfc2136/provider_test.go @@ -19,7 +19,7 @@ package rfc2136 import ( "testing" - cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" logf "github.com/jetstack/cert-manager/pkg/logs" "github.com/jetstack/cert-manager/test/acme/dns" @@ -40,7 +40,7 @@ func TestRunSuiteWithTSIG(t *testing.T) { } defer server.Shutdown() - var validConfig = cmapi.ACMEIssuerDNS01ProviderRFC2136{ + var validConfig = cmacme.ACMEIssuerDNS01ProviderRFC2136{ Nameserver: server.ListenAddr(), TSIGSecret: cmmeta.SecretKeySelector{ LocalObjectReference: cmmeta.LocalObjectReference{ @@ -75,7 +75,7 @@ func TestRunSuiteNoTSIG(t *testing.T) { } defer server.Shutdown() - var validConfig = cmapi.ACMEIssuerDNS01ProviderRFC2136{ + var validConfig = cmacme.ACMEIssuerDNS01ProviderRFC2136{ Nameserver: server.ListenAddr(), } diff --git a/pkg/issuer/acme/dns/util_test.go b/pkg/issuer/acme/dns/util_test.go index 4cb289b3102..5c262c12178 100644 --- a/pkg/issuer/acme/dns/util_test.go +++ b/pkg/issuer/acme/dns/util_test.go @@ -20,6 +20,7 @@ import ( "errors" "testing" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" "github.com/jetstack/cert-manager/pkg/controller/test" "github.com/jetstack/cert-manager/pkg/issuer/acme/dns/acmedns" @@ -47,7 +48,7 @@ type solverFixture struct { // Issuer to be passed to functions on the Solver (a default will be used if nil) Issuer v1alpha2.GenericIssuer // Challenge resource to use during tests - Challenge *v1alpha2.Challenge + Challenge *cmacme.Challenge dnsProviders *fakeDNSProviders @@ -69,7 +70,7 @@ type solverFixture struct { func (s *solverFixture) Setup(t *testing.T) { if s.Issuer == nil { - s.Issuer = gen.Issuer(defaultTestIssuerName, gen.SetIssuerACME(v1alpha2.ACMEIssuer{})) + s.Issuer = gen.Issuer(defaultTestIssuerName, gen.SetIssuerACME(cmacme.ACMEIssuer{})) } if s.testResources == nil { s.testResources = map[string]interface{}{} diff --git a/pkg/issuer/acme/dns/webhook/BUILD.bazel b/pkg/issuer/acme/dns/webhook/BUILD.bazel index e358e2f8067..b7251070c12 100644 --- a/pkg/issuer/acme/dns/webhook/BUILD.bazel +++ b/pkg/issuer/acme/dns/webhook/BUILD.bazel @@ -7,7 +7,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/acme/webhook/apis/acme/v1alpha1:go_default_library", - "//pkg/apis/certmanager/v1alpha2:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/client/clientset/versioned/scheme:go_default_library", "//vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", diff --git a/pkg/issuer/acme/dns/webhook/webhook.go b/pkg/issuer/acme/dns/webhook/webhook.go index 932007aa81b..fe92049d818 100644 --- a/pkg/issuer/acme/dns/webhook/webhook.go +++ b/pkg/issuer/acme/dns/webhook/webhook.go @@ -29,7 +29,7 @@ import ( "k8s.io/klog" "github.com/jetstack/cert-manager/pkg/acme/webhook/apis/acme/v1alpha1" - cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/client/clientset/versioned/scheme" ) @@ -159,8 +159,8 @@ func (r *Webhook) buildPayload(ch *v1alpha1.ChallengeRequest, action v1alpha1.Ch return cl, pl, cfg.SolverName, nil } -func loadConfig(cfgJSON apiext.JSON) (*cmapi.ACMEIssuerDNS01ProviderWebhook, error) { - cfg := cmapi.ACMEIssuerDNS01ProviderWebhook{} +func loadConfig(cfgJSON apiext.JSON) (*cmacme.ACMEIssuerDNS01ProviderWebhook, error) { + cfg := cmacme.ACMEIssuerDNS01ProviderWebhook{} if err := json.Unmarshal(cfgJSON.Raw, &cfg); err != nil { return nil, fmt.Errorf("error decoding solver config: %v", err) } diff --git a/pkg/issuer/acme/http/BUILD.bazel b/pkg/issuer/acme/http/BUILD.bazel index 770e7464cd2..ce0509fb452 100644 --- a/pkg/issuer/acme/http/BUILD.bazel +++ b/pkg/issuer/acme/http/BUILD.bazel @@ -11,6 +11,7 @@ go_library( importpath = "github.com/jetstack/cert-manager/pkg/issuer/acme/http", visibility = ["//visibility:public"], deps = [ + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/controller:go_default_library", "//pkg/issuer/acme/http/solver:go_default_library", @@ -40,7 +41,7 @@ go_test( ], embed = [":go_default_library"], deps = [ - "//pkg/apis/certmanager/v1alpha2:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/controller/test:go_default_library", "//test/unit/gen:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", diff --git a/pkg/issuer/acme/http/http.go b/pkg/issuer/acme/http/http.go index f4f28a00bd2..ad71cba7f1b 100644 --- a/pkg/issuer/acme/http/http.go +++ b/pkg/issuer/acme/http/http.go @@ -29,6 +29,7 @@ import ( corev1listers "k8s.io/client-go/listers/core/v1" extv1beta1listers "k8s.io/client-go/listers/extensions/v1beta1" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" "github.com/jetstack/cert-manager/pkg/controller" "github.com/jetstack/cert-manager/pkg/issuer/acme/http/solver" @@ -82,7 +83,7 @@ func http01LogCtx(ctx context.Context) context.Context { return logf.NewContext(ctx, nil, "http01") } -func httpDomainCfgForChallenge(ch *v1alpha2.Challenge) (*v1alpha2.ACMEChallengeSolverHTTP01Ingress, error) { +func httpDomainCfgForChallenge(ch *cmacme.Challenge) (*cmacme.ACMEChallengeSolverHTTP01Ingress, error) { if ch.Spec.Solver != nil { if ch.Spec.Solver.HTTP01 == nil || ch.Spec.Solver.HTTP01.Ingress == nil { return nil, fmt.Errorf("challenge's 'solver' field is specified but no HTTP01 ingress config provided. " + @@ -96,7 +97,7 @@ func httpDomainCfgForChallenge(ch *v1alpha2.Challenge) (*v1alpha2.ACMEChallengeS // Present will realise the resources required to solve the given HTTP01 // challenge validation in the apiserver. If those resources already exist, it // will return nil (i.e. this function is idempotent). -func (s *Solver) Present(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *v1alpha2.Challenge) error { +func (s *Solver) Present(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *cmacme.Challenge) error { ctx = http01LogCtx(ctx) _, podErr := s.ensurePod(ctx, ch) @@ -108,7 +109,7 @@ func (s *Solver) Present(ctx context.Context, issuer v1alpha2.GenericIssuer, ch return utilerrors.NewAggregate([]error{podErr, svcErr, ingressErr}) } -func (s *Solver) Check(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *v1alpha2.Challenge) error { +func (s *Solver) Check(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *cmacme.Challenge) error { ctx = logf.NewContext(http01LogCtx(ctx), nil, "selfCheck") log := logf.FromContext(ctx) @@ -149,7 +150,7 @@ func (s *Solver) Check(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *v // CleanUp will ensure the created service, ingress and pod are clean/deleted of any // cert-manager created data. -func (s *Solver) CleanUp(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *v1alpha2.Challenge) error { +func (s *Solver) CleanUp(ctx context.Context, issuer v1alpha2.GenericIssuer, ch *cmacme.Challenge) error { var errs []error errs = append(errs, s.cleanupPods(ctx, ch)) errs = append(errs, s.cleanupServices(ctx, ch)) @@ -157,7 +158,7 @@ func (s *Solver) CleanUp(ctx context.Context, issuer v1alpha2.GenericIssuer, ch return utilerrors.NewAggregate(errs) } -func (s *Solver) buildChallengeUrl(ch *v1alpha2.Challenge) *url.URL { +func (s *Solver) buildChallengeUrl(ch *cmacme.Challenge) *url.URL { url := &url.URL{} url.Scheme = "http" url.Host = ch.Spec.DNSName diff --git a/pkg/issuer/acme/http/http_test.go b/pkg/issuer/acme/http/http_test.go index 668bd51755a..0fae6a7f909 100644 --- a/pkg/issuer/acme/http/http_test.go +++ b/pkg/issuer/acme/http/http_test.go @@ -22,7 +22,7 @@ import ( "net/url" "testing" - "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" ) // countReachabilityTestCalls is a wrapper function that allows us to count the number @@ -38,7 +38,7 @@ func TestCheck(t *testing.T) { type testT struct { name string reachabilityTest reachabilityTest - challenge *v1alpha2.Challenge + challenge *cmacme.Challenge expectedErr bool } tests := []testT{ @@ -64,7 +64,7 @@ func TestCheck(t *testing.T) { calls := 0 requiredCallsForPass := 2 if test.challenge == nil { - test.challenge = &v1alpha2.Challenge{} + test.challenge = &cmacme.Challenge{} } s := Solver{ testReachability: countReachabilityTestCalls(&calls, test.reachabilityTest), diff --git a/pkg/issuer/acme/http/ingress.go b/pkg/issuer/acme/http/ingress.go index e3964a1f4e8..f43e3ccdc4e 100644 --- a/pkg/issuer/acme/http/ingress.go +++ b/pkg/issuer/acme/http/ingress.go @@ -28,7 +28,7 @@ import ( utilerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/intstr" - "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/issuer/acme/http/solver" logf "github.com/jetstack/cert-manager/pkg/logs" "github.com/jetstack/cert-manager/pkg/util" @@ -36,7 +36,7 @@ import ( // getIngressesForChallenge returns a list of Ingresses that were created to solve // http challenges for the given domain -func (s *Solver) getIngressesForChallenge(ctx context.Context, ch *v1alpha2.Challenge) ([]*extv1beta1.Ingress, error) { +func (s *Solver) getIngressesForChallenge(ctx context.Context, ch *cmacme.Challenge) ([]*extv1beta1.Ingress, error) { log := logf.FromContext(ctx) podLabels := podLabels(ch) @@ -71,7 +71,7 @@ func (s *Solver) getIngressesForChallenge(ctx context.Context, ch *v1alpha2.Chal // ensureIngress will ensure the ingress required to solve this challenge // exists, or if an existing ingress is specified on the secret will ensure // that the ingress has an appropriate challenge path configured -func (s *Solver) ensureIngress(ctx context.Context, ch *v1alpha2.Challenge, svcName string) (ing *extv1beta1.Ingress, err error) { +func (s *Solver) ensureIngress(ctx context.Context, ch *cmacme.Challenge, svcName string) (ing *extv1beta1.Ingress, err error) { log := logf.FromContext(ctx).WithName("ensureIngress") httpDomainCfg, err := httpDomainCfgForChallenge(ch) if err != nil { @@ -106,7 +106,7 @@ func (s *Solver) ensureIngress(ctx context.Context, ch *v1alpha2.Challenge, svcN // createIngress will create a challenge solving pod for the given certificate, // domain, token and key. -func (s *Solver) createIngress(ch *v1alpha2.Challenge, svcName string) (*extv1beta1.Ingress, error) { +func (s *Solver) createIngress(ch *cmacme.Challenge, svcName string) (*extv1beta1.Ingress, error) { ing, err := buildIngressResource(ch, svcName) if err != nil { return nil, err @@ -114,7 +114,7 @@ func (s *Solver) createIngress(ch *v1alpha2.Challenge, svcName string) (*extv1be return s.Client.ExtensionsV1beta1().Ingresses(ch.Namespace).Create(ing) } -func buildIngressResource(ch *v1alpha2.Challenge, svcName string) (*extv1beta1.Ingress, error) { +func buildIngressResource(ch *cmacme.Challenge, svcName string) (*extv1beta1.Ingress, error) { httpDomainCfg, err := httpDomainCfgForChallenge(ch) if err != nil { return nil, err @@ -158,7 +158,7 @@ func buildIngressResource(ch *v1alpha2.Challenge, svcName string) (*extv1beta1.I }, nil } -func (s *Solver) addChallengePathToIngress(ctx context.Context, ch *v1alpha2.Challenge, svcName string) (*extv1beta1.Ingress, error) { +func (s *Solver) addChallengePathToIngress(ctx context.Context, ch *cmacme.Challenge, svcName string) (*extv1beta1.Ingress, error) { httpDomainCfg, err := httpDomainCfgForChallenge(ch) if err != nil { return nil, err @@ -210,7 +210,7 @@ func (s *Solver) addChallengePathToIngress(ctx context.Context, ch *v1alpha2.Cha // cleanupIngresses will remove the rules added by cert-manager to an existing // ingress, or delete the ingress if an existing ingress name is not specified // on the certificate. -func (s *Solver) cleanupIngresses(ctx context.Context, ch *v1alpha2.Challenge) error { +func (s *Solver) cleanupIngresses(ctx context.Context, ch *cmacme.Challenge) error { log := logf.FromContext(ctx, "cleanupPods") httpDomainCfg, err := httpDomainCfgForChallenge(ch) diff --git a/pkg/issuer/acme/http/ingress_test.go b/pkg/issuer/acme/http/ingress_test.go index 4b57cb317e0..ff334a3a379 100644 --- a/pkg/issuer/acme/http/ingress_test.go +++ b/pkg/issuer/acme/http/ingress_test.go @@ -30,7 +30,7 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" coretesting "k8s.io/client-go/testing" - "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/controller/test" ) @@ -38,12 +38,12 @@ func TestGetIngressesForChallenge(t *testing.T) { const createdIngressKey = "createdIngress" tests := map[string]solverFixture{ "should return one ingress that matches": { - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ DNSName: "example.com", - Solver: &v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{}, + Solver: &cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{}, }, }, }, @@ -71,12 +71,12 @@ func TestGetIngressesForChallenge(t *testing.T) { }, }, "should not return an ingress for the same certificate but different domain": { - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ DNSName: "example.com", - Solver: &v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{}, + Solver: &cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{}, }, }, }, @@ -120,13 +120,13 @@ func TestCleanupIngresses(t *testing.T) { const createdIngressKey = "createdIngress" tests := map[string]solverFixture{ "should delete ingress resource": { - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ DNSName: "example.com", Token: "abcd", - Solver: &v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + Solver: &cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Class: strPtr("nginx"), }, }, @@ -153,13 +153,13 @@ func TestCleanupIngresses(t *testing.T) { }, }, "should not delete ingress resources without appropriate labels": { - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ DNSName: "example.com", Token: "abcd", - Solver: &v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + Solver: &cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Class: strPtr("nginx"), }, }, @@ -221,13 +221,13 @@ func TestCleanupIngresses(t *testing.T) { }, }, }, - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ DNSName: "example.com", Token: "abcd", - Solver: &v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + Solver: &cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "testingress", }, }, @@ -304,13 +304,13 @@ func TestCleanupIngresses(t *testing.T) { }, }, }, - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ DNSName: "example.com", Token: "abcd", - Solver: &v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + Solver: &cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: "testingress", }, }, @@ -337,13 +337,13 @@ func TestCleanupIngresses(t *testing.T) { }, }, "should return an error if a delete fails": { - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ DNSName: "example.com", Token: "abcd", - Solver: &v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + Solver: &cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Class: strPtr("nginx"), }, }, diff --git a/pkg/issuer/acme/http/pod.go b/pkg/issuer/acme/http/pod.go index cbd2870de64..480a13144f8 100644 --- a/pkg/issuer/acme/http/pod.go +++ b/pkg/issuer/acme/http/pod.go @@ -27,11 +27,11 @@ import ( "k8s.io/apimachinery/pkg/selection" utilerrors "k8s.io/apimachinery/pkg/util/errors" - "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" logf "github.com/jetstack/cert-manager/pkg/logs" ) -func podLabels(ch *v1alpha2.Challenge) map[string]string { +func podLabels(ch *cmacme.Challenge) map[string]string { domainHash := fmt.Sprintf("%d", adler32.Checksum([]byte(ch.Spec.DNSName))) tokenHash := fmt.Sprintf("%d", adler32.Checksum([]byte(ch.Spec.Token))) solverIdent := "true" @@ -46,7 +46,7 @@ func podLabels(ch *v1alpha2.Challenge) map[string]string { } } -func (s *Solver) ensurePod(ctx context.Context, ch *v1alpha2.Challenge) (*corev1.Pod, error) { +func (s *Solver) ensurePod(ctx context.Context, ch *cmacme.Challenge) (*corev1.Pod, error) { log := logf.FromContext(ctx).WithName("ensurePod") log.V(logf.DebugLevel).Info("checking for existing HTTP01 solver pods") @@ -74,7 +74,7 @@ func (s *Solver) ensurePod(ctx context.Context, ch *v1alpha2.Challenge) (*corev1 // getPodsForChallenge returns a list of pods that were created to solve // the given challenge -func (s *Solver) getPodsForChallenge(ctx context.Context, ch *v1alpha2.Challenge) ([]*corev1.Pod, error) { +func (s *Solver) getPodsForChallenge(ctx context.Context, ch *cmacme.Challenge) ([]*corev1.Pod, error) { log := logf.FromContext(ctx) podLabels := podLabels(ch) @@ -105,7 +105,7 @@ func (s *Solver) getPodsForChallenge(ctx context.Context, ch *v1alpha2.Challenge return relevantPods, nil } -func (s *Solver) cleanupPods(ctx context.Context, ch *v1alpha2.Challenge) error { +func (s *Solver) cleanupPods(ctx context.Context, ch *cmacme.Challenge) error { log := logf.FromContext(ctx, "cleanupPods") pods, err := s.getPodsForChallenge(ctx, ch) @@ -131,14 +131,14 @@ func (s *Solver) cleanupPods(ctx context.Context, ch *v1alpha2.Challenge) error // createPod will create a challenge solving pod for the given certificate, // domain, token and key. -func (s *Solver) createPod(ch *v1alpha2.Challenge) (*corev1.Pod, error) { +func (s *Solver) createPod(ch *cmacme.Challenge) (*corev1.Pod, error) { return s.Client.CoreV1().Pods(ch.Namespace).Create( s.buildPod(ch)) } // buildPod will build a challenge solving pod for the given certificate, // domain, token and key. It will not create it in the API server -func (s *Solver) buildPod(ch *v1alpha2.Challenge) *corev1.Pod { +func (s *Solver) buildPod(ch *cmacme.Challenge) *corev1.Pod { pod := s.buildDefaultPod(ch) // Override defaults if they have changed in the pod template. @@ -152,7 +152,7 @@ func (s *Solver) buildPod(ch *v1alpha2.Challenge) *corev1.Pod { return pod } -func (s *Solver) buildDefaultPod(ch *v1alpha2.Challenge) *corev1.Pod { +func (s *Solver) buildDefaultPod(ch *cmacme.Challenge) *corev1.Pod { podLabels := podLabels(ch) return &corev1.Pod{ @@ -203,7 +203,7 @@ func (s *Solver) buildDefaultPod(ch *v1alpha2.Challenge) *corev1.Pod { } // Merge object meta from the pod template. Fall back to default values. -func (s *Solver) mergePodObjectMetaWithPodTemplate(pod *corev1.Pod, podTempl *v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate) *corev1.Pod { +func (s *Solver) mergePodObjectMetaWithPodTemplate(pod *corev1.Pod, podTempl *cmacme.ACMEChallengeSolverHTTP01IngressPodTemplate) *corev1.Pod { if podTempl == nil { return pod } diff --git a/pkg/issuer/acme/http/pod_test.go b/pkg/issuer/acme/http/pod_test.go index d4880161b31..04e75d82fdb 100644 --- a/pkg/issuer/acme/http/pod_test.go +++ b/pkg/issuer/acme/http/pod_test.go @@ -27,21 +27,21 @@ import ( "k8s.io/apimachinery/pkg/runtime" coretesting "k8s.io/client-go/testing" - "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" ) func TestEnsurePod(t *testing.T) { const createdPodKey = "createdPod" tests := map[string]solverFixture{ "should return an existing pod if one already exists": { - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ DNSName: "example.com", Token: "token", Key: "key", - Solver: &v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{}, + Solver: &cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{}, }, }, }, @@ -77,14 +77,14 @@ func TestEnsurePod(t *testing.T) { }, }, "should create a new pod if one does not exist": { - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ DNSName: "example.com", Token: "token", Key: "key", - Solver: &v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{}, + Solver: &cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{}, }, }, }, @@ -129,14 +129,14 @@ func TestEnsurePod(t *testing.T) { }, }, "should clean up if multiple pods exist": { - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ DNSName: "example.com", Token: "token", Key: "key", - Solver: &v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{}, + Solver: &cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{}, }, }, }, @@ -186,12 +186,12 @@ func TestGetPodsForCertificate(t *testing.T) { const createdPodKey = "createdPod" tests := map[string]solverFixture{ "should return one pod that matches": { - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ DNSName: "example.com", - Solver: &v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{}, + Solver: &cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{}, }, }, }, @@ -219,12 +219,12 @@ func TestGetPodsForCertificate(t *testing.T) { }, }, "should not return a pod for the same certificate but different domain": { - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ DNSName: "example.com", - Solver: &v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{}, + Solver: &cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{}, }, }, }, @@ -268,13 +268,13 @@ func TestMergePodObjectMetaWithPodTemplate(t *testing.T) { const createdPodKey = "createdPod" tests := map[string]solverFixture{ "should use labels and annotations from template": { - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ DNSName: "example.com", - Solver: &v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ - PodTemplate: &v1alpha2.ACMEChallengeSolverHTTP01IngressPodTemplate{ + Solver: &cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ + PodTemplate: &cmacme.ACMEChallengeSolverHTTP01IngressPodTemplate{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ "this is a": "label", @@ -285,7 +285,7 @@ func TestMergePodObjectMetaWithPodTemplate(t *testing.T) { "foo": "bar", }, }, - Spec: v1alpha2.ACMEChallengeSolverHTTP01IngressPodSpec{ + Spec: cmacme.ACMEChallengeSolverHTTP01IngressPodSpec{ NodeSelector: map[string]string{ "node": "selector", }, @@ -350,12 +350,12 @@ func TestMergePodObjectMetaWithPodTemplate(t *testing.T) { }, }, "should use default if nothing has changed in template": { - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ DNSName: "example.com", - Solver: &v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{}, + Solver: &cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{}, }, }, }, diff --git a/pkg/issuer/acme/http/service.go b/pkg/issuer/acme/http/service.go index 804488fcb00..c45ebf155d7 100644 --- a/pkg/issuer/acme/http/service.go +++ b/pkg/issuer/acme/http/service.go @@ -27,11 +27,11 @@ import ( utilerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/intstr" - "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" logf "github.com/jetstack/cert-manager/pkg/logs" ) -func (s *Solver) ensureService(ctx context.Context, ch *v1alpha2.Challenge) (*corev1.Service, error) { +func (s *Solver) ensureService(ctx context.Context, ch *cmacme.Challenge) (*corev1.Service, error) { log := logf.FromContext(ctx).WithName("ensureService") log.V(logf.DebugLevel).Info("checking for existing HTTP01 solver services for challenge") @@ -58,7 +58,7 @@ func (s *Solver) ensureService(ctx context.Context, ch *v1alpha2.Challenge) (*co // getServicesForChallenge returns a list of services that were created to solve // http challenges for the given domain -func (s *Solver) getServicesForChallenge(ctx context.Context, ch *v1alpha2.Challenge) ([]*corev1.Service, error) { +func (s *Solver) getServicesForChallenge(ctx context.Context, ch *cmacme.Challenge) ([]*corev1.Service, error) { log := logf.FromContext(ctx) podLabels := podLabels(ch) @@ -91,7 +91,7 @@ func (s *Solver) getServicesForChallenge(ctx context.Context, ch *v1alpha2.Chall // createService will create the service required to solve this challenge // in the target API server. -func (s *Solver) createService(ch *v1alpha2.Challenge) (*corev1.Service, error) { +func (s *Solver) createService(ch *cmacme.Challenge) (*corev1.Service, error) { svc, err := buildService(ch) if err != nil { return nil, err @@ -99,7 +99,7 @@ func (s *Solver) createService(ch *v1alpha2.Challenge) (*corev1.Service, error) return s.Client.CoreV1().Services(ch.Namespace).Create(svc) } -func buildService(ch *v1alpha2.Challenge) (*corev1.Service, error) { +func buildService(ch *cmacme.Challenge) (*corev1.Service, error) { podLabels := podLabels(ch) service := &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ @@ -136,7 +136,7 @@ func buildService(ch *v1alpha2.Challenge) (*corev1.Service, error) { return service, nil } -func (s *Solver) cleanupServices(ctx context.Context, ch *v1alpha2.Challenge) error { +func (s *Solver) cleanupServices(ctx context.Context, ch *cmacme.Challenge) error { log := logf.FromContext(ctx, "cleanupPods") services, err := s.getServicesForChallenge(ctx, ch) diff --git a/pkg/issuer/acme/http/service_test.go b/pkg/issuer/acme/http/service_test.go index 2f11cd97801..de00620bb10 100644 --- a/pkg/issuer/acme/http/service_test.go +++ b/pkg/issuer/acme/http/service_test.go @@ -26,19 +26,19 @@ import ( "k8s.io/apimachinery/pkg/runtime" coretesting "k8s.io/client-go/testing" - "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" ) func TestEnsureService(t *testing.T) { const createdServiceKey = "createdService" tests := map[string]solverFixture{ "should return an existing service if one already exists": { - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ DNSName: "example.com", - Solver: &v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{}, + Solver: &cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{}, }, }, }, @@ -74,12 +74,12 @@ func TestEnsureService(t *testing.T) { }, }, "should create a new service if one does not exist": { - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ DNSName: "example.com", - Solver: &v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{}, + Solver: &cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{}, }, }, }, @@ -127,12 +127,12 @@ func TestEnsureService(t *testing.T) { }, }, "should clean up if multiple services exist": { - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ DNSName: "example.com", - Solver: &v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{}, + Solver: &cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{}, }, }, }, @@ -182,12 +182,12 @@ func TestGetServicesForChallenge(t *testing.T) { const createdServiceKey = "createdService" tests := map[string]solverFixture{ "should return one service that matches": { - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ DNSName: "example.com", - Solver: &v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{}, + Solver: &cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{}, }, }, }, @@ -215,12 +215,12 @@ func TestGetServicesForChallenge(t *testing.T) { }, }, "should not return a service for the same certificate but different domain": { - Challenge: &v1alpha2.Challenge{ - Spec: v1alpha2.ChallengeSpec{ + Challenge: &cmacme.Challenge{ + Spec: cmacme.ChallengeSpec{ DNSName: "example.com", - Solver: &v1alpha2.ACMEChallengeSolver{ - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{}, + Solver: &cmacme.ACMEChallengeSolver{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{}, }, }, }, diff --git a/pkg/issuer/acme/http/util_test.go b/pkg/issuer/acme/http/util_test.go index cb28321ac4e..2c95d05f1e0 100644 --- a/pkg/issuer/acme/http/util_test.go +++ b/pkg/issuer/acme/http/util_test.go @@ -19,7 +19,7 @@ package http import ( "testing" - "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/controller/test" "github.com/jetstack/cert-manager/test/unit/gen" ) @@ -34,7 +34,7 @@ type solverFixture struct { *test.Builder // Challenge resource to use during tests - Challenge *v1alpha2.Challenge + Challenge *cmacme.Challenge // PreFn will run before the test is run, but after the fixture has been initialised. // This is useful if you want to load the clientset with some resources *after* the diff --git a/pkg/issuer/acme/util_test.go b/pkg/issuer/acme/util_test.go index 768cd174495..93a937a85c6 100644 --- a/pkg/issuer/acme/util_test.go +++ b/pkg/issuer/acme/util_test.go @@ -26,6 +26,7 @@ import ( fakeclock "k8s.io/utils/clock/testing" "github.com/jetstack/cert-manager/pkg/acme/client" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" "github.com/jetstack/cert-manager/pkg/controller/test" @@ -57,7 +58,7 @@ func (s *acmeFixture) Setup(t *testing.T) { s.Issuer = &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{}, + ACME: &cmacme.ACMEIssuer{}, }, }, } diff --git a/pkg/issuer/ca/util_test.go b/pkg/issuer/ca/util_test.go index 19a95b4fe90..b9daa1acb42 100644 --- a/pkg/issuer/ca/util_test.go +++ b/pkg/issuer/ca/util_test.go @@ -24,11 +24,6 @@ import ( "github.com/jetstack/cert-manager/pkg/controller/test" ) -const ( - defaultTestAcmeClusterResourceNamespace = "default" - defaultTestSolverImage = "fake-solver-image" -) - type caFixture struct { CA *CA *test.Builder @@ -49,7 +44,7 @@ func (s *caFixture) Setup(t *testing.T) { s.Issuer = &v1alpha2.Issuer{ Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{}, + CA: &v1alpha2.CAIssuer{}, }, }, } diff --git a/pkg/webhook/BUILD.bazel b/pkg/webhook/BUILD.bazel index 5bd13a2ee24..72c299a4f7b 100644 --- a/pkg/webhook/BUILD.bazel +++ b/pkg/webhook/BUILD.bazel @@ -9,6 +9,7 @@ go_library( importpath = "github.com/jetstack/cert-manager/pkg/webhook", visibility = ["//visibility:public"], deps = [ + "//pkg/internal/apis/acme/install:go_default_library", "//pkg/internal/apis/certmanager/install:go_default_library", "//pkg/internal/apis/certmanager/validation:go_default_library", "//pkg/internal/apis/meta/install:go_default_library", diff --git a/pkg/webhook/scheme.go b/pkg/webhook/scheme.go index c5e6ea8926c..a94878e2475 100644 --- a/pkg/webhook/scheme.go +++ b/pkg/webhook/scheme.go @@ -19,6 +19,7 @@ package webhook import ( "k8s.io/apimachinery/pkg/runtime" + acmeinstall "github.com/jetstack/cert-manager/pkg/internal/apis/acme/install" cminstall "github.com/jetstack/cert-manager/pkg/internal/apis/certmanager/install" metainstall "github.com/jetstack/cert-manager/pkg/internal/apis/meta/install" ) @@ -36,5 +37,6 @@ var ( func init() { cminstall.Install(Scheme) + acmeinstall.Install(Scheme) metainstall.Install(Scheme) } diff --git a/test/e2e/suite/conformance/certificates/acme/BUILD.bazel b/test/e2e/suite/conformance/certificates/acme/BUILD.bazel index 914c5c0322f..9b071ba9c41 100644 --- a/test/e2e/suite/conformance/certificates/acme/BUILD.bazel +++ b/test/e2e/suite/conformance/certificates/acme/BUILD.bazel @@ -6,6 +6,7 @@ go_library( importpath = "github.com/jetstack/cert-manager/test/e2e/suite/conformance/certificates/acme", visibility = ["//visibility:public"], deps = [ + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", "//test/e2e/framework:go_default_library", diff --git a/test/e2e/suite/conformance/certificates/acme/acme.go b/test/e2e/suite/conformance/certificates/acme/acme.go index 207088c7508..5589c4a8c8d 100644 --- a/test/e2e/suite/conformance/certificates/acme/acme.go +++ b/test/e2e/suite/conformance/certificates/acme/acme.go @@ -21,6 +21,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" "github.com/jetstack/cert-manager/test/e2e/framework" @@ -100,7 +101,7 @@ func (a *acmeIssuerProvisioner) create(f *framework.Framework) cmmeta.ObjectRefe }, Spec: cmapi.IssuerSpec{ IssuerConfig: cmapi.IssuerConfig{ - ACME: &cmapi.ACMEIssuer{ + ACME: &cmacme.ACMEIssuer{ Server: a.pebble.Details().Host, SkipTLSVerify: true, PrivateKey: cmmeta.SecretKeySelector{ @@ -108,13 +109,13 @@ func (a *acmeIssuerProvisioner) create(f *framework.Framework) cmmeta.ObjectRefe Name: "acme-private-key", }, }, - Solvers: []cmapi.ACMEChallengeSolver{ + Solvers: []cmacme.ACMEChallengeSolver{ { - HTTP01: &cmapi.ACMEChallengeSolverHTTP01{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ // Not setting the Class or Name field will cause cert-manager to create // new ingress resources that do not specify a class to solve challenges, // which means all Ingress controllers should act on the ingresses. - Ingress: &cmapi.ACMEChallengeSolverHTTP01Ingress{}, + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{}, }, }, }, diff --git a/test/e2e/suite/issuers/acme/certificate/BUILD.bazel b/test/e2e/suite/issuers/acme/certificate/BUILD.bazel index a56edbdc5cd..f9a86f76565 100644 --- a/test/e2e/suite/issuers/acme/certificate/BUILD.bazel +++ b/test/e2e/suite/issuers/acme/certificate/BUILD.bazel @@ -11,6 +11,7 @@ go_library( tags = ["manual"], visibility = ["//visibility:public"], deps = [ + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", "//pkg/client/clientset/versioned:go_default_library", diff --git a/test/e2e/suite/issuers/acme/certificate/dns01.go b/test/e2e/suite/issuers/acme/certificate/dns01.go index 4aac787b159..18058476480 100644 --- a/test/e2e/suite/issuers/acme/certificate/dns01.go +++ b/test/e2e/suite/issuers/acme/certificate/dns01.go @@ -23,6 +23,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" "github.com/jetstack/cert-manager/test/e2e/framework" @@ -67,7 +68,7 @@ func testDNSProvider(name string, p dns01Provider) bool { By("Creating an Issuer") issuer := gen.Issuer(issuerName, - gen.SetIssuerACME(v1alpha2.ACMEIssuer{ + gen.SetIssuerACME(cmacme.ACMEIssuer{ SkipTLSVerify: true, Server: "https://acme-staging-v02.api.letsencrypt.org/directory", Email: testingACMEEmail, @@ -76,7 +77,7 @@ func testDNSProvider(name string, p dns01Provider) bool { Name: testingACMEPrivateKey, }, }, - Solvers: []v1alpha2.ACMEChallengeSolver{ + Solvers: []cmacme.ACMEChallengeSolver{ { DNS01: &p.Details().ProviderConfig, }, diff --git a/test/e2e/suite/issuers/acme/certificate/http01.go b/test/e2e/suite/issuers/acme/certificate/http01.go index ccaf01ca7e6..c57b3c27b04 100644 --- a/test/e2e/suite/issuers/acme/certificate/http01.go +++ b/test/e2e/suite/issuers/acme/certificate/http01.go @@ -29,6 +29,7 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/wait" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" cmutil "github.com/jetstack/cert-manager/pkg/util" @@ -83,22 +84,22 @@ var _ = framework.CertManagerDescribe("ACME Certificate (HTTP01)", func() { BeforeEach(func() { acmeURL := pebble.Details().Host acmeIssuer := util.NewCertManagerACMEIssuer(issuerName, acmeURL, testingACMEEmail, testingACMEPrivateKey) - acmeIssuer.Spec.ACME.Solvers = []v1alpha2.ACMEChallengeSolver{ + acmeIssuer.Spec.ACME.Solvers = []cmacme.ACMEChallengeSolver{ { - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Class: &addon.NginxIngress.Details().IngressClass, }, }, }, { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ MatchLabels: map[string]string{ "testing.cert-manager.io/fixed-ingress": "true", }, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: fixedIngressName, }, }, diff --git a/test/e2e/suite/issuers/acme/certificate/webhook.go b/test/e2e/suite/issuers/acme/certificate/webhook.go index 573fed91c43..1473cc1fc8d 100644 --- a/test/e2e/suite/issuers/acme/certificate/webhook.go +++ b/test/e2e/suite/issuers/acme/certificate/webhook.go @@ -25,6 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" "github.com/jetstack/cert-manager/pkg/client/clientset/versioned" @@ -80,7 +81,7 @@ var _ = framework.CertManagerDescribe("ACME webhook DNS provider", func() { By("Creating an Issuer") issuer := gen.Issuer(issuerName, - gen.SetIssuerACME(v1alpha2.ACMEIssuer{ + gen.SetIssuerACME(cmacme.ACMEIssuer{ SkipTLSVerify: true, Server: pebble.Details().Host, Email: testingACMEEmail, @@ -89,10 +90,10 @@ var _ = framework.CertManagerDescribe("ACME webhook DNS provider", func() { Name: testingACMEPrivateKey, }, }, - Solvers: []v1alpha2.ACMEChallengeSolver{ + Solvers: []cmacme.ACMEChallengeSolver{ { - DNS01: &v1alpha2.ACMEChallengeSolverDNS01{ - Webhook: &v1alpha2.ACMEIssuerDNS01ProviderWebhook{ + DNS01: &cmacme.ACMEChallengeSolverDNS01{ + Webhook: &cmacme.ACMEIssuerDNS01ProviderWebhook{ GroupName: webhook.Details().GroupName, SolverName: webhook.Details().SolverName, Config: &v1beta1.JSON{ @@ -154,7 +155,7 @@ var _ = framework.CertManagerDescribe("ACME webhook DNS provider", func() { cert, err := certClient.Create(cert) Expect(err).NotTo(HaveOccurred()) - var order *v1alpha2.Order + var order *cmacme.Order pollErr := wait.PollImmediate(500*time.Millisecond, time.Second*30, func() (bool, error) { orders, err := listOwnedOrders(f.CertManagerClientSet, cert) @@ -202,13 +203,13 @@ var _ = framework.CertManagerDescribe("ACME webhook DNS provider", func() { }) }) -func listOwnedChallenges(cl versioned.Interface, owner *v1alpha2.Order) ([]*v1alpha2.Challenge, error) { - l, err := cl.CertmanagerV1alpha2().Challenges(owner.Namespace).List(metav1.ListOptions{}) +func listOwnedChallenges(cl versioned.Interface, owner *cmacme.Order) ([]*cmacme.Challenge, error) { + l, err := cl.AcmeV1alpha2().Challenges(owner.Namespace).List(metav1.ListOptions{}) if err != nil { return nil, err } - var owned []*v1alpha2.Challenge + var owned []*cmacme.Challenge for _, ch := range l.Items { if !metav1.IsControlledBy(&ch, owner) { continue @@ -219,13 +220,13 @@ func listOwnedChallenges(cl versioned.Interface, owner *v1alpha2.Order) ([]*v1al return owned, nil } -func listOwnedOrders(cl versioned.Interface, owner *v1alpha2.Certificate) ([]*v1alpha2.Order, error) { - l, err := cl.CertmanagerV1alpha2().Orders(owner.Namespace).List(metav1.ListOptions{}) +func listOwnedOrders(cl versioned.Interface, owner *v1alpha2.Certificate) ([]*cmacme.Order, error) { + l, err := cl.AcmeV1alpha2().Orders(owner.Namespace).List(metav1.ListOptions{}) if err != nil { return nil, err } - var owned []*v1alpha2.Order + var owned []*cmacme.Order for _, o := range l.Items { v, ok := o.Annotations[v1alpha2.CertificateNameKey] if !ok || v != owner.Name { diff --git a/test/e2e/suite/issuers/acme/certificaterequest/BUILD.bazel b/test/e2e/suite/issuers/acme/certificaterequest/BUILD.bazel index 81c91a6af65..32fb299e2cf 100644 --- a/test/e2e/suite/issuers/acme/certificaterequest/BUILD.bazel +++ b/test/e2e/suite/issuers/acme/certificaterequest/BUILD.bazel @@ -9,6 +9,7 @@ go_library( importpath = "github.com/jetstack/cert-manager/test/e2e/suite/issuers/acme/certificaterequest", visibility = ["//visibility:public"], deps = [ + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", "//pkg/util:go_default_library", diff --git a/test/e2e/suite/issuers/acme/certificaterequest/dns01.go b/test/e2e/suite/issuers/acme/certificaterequest/dns01.go index 13db90fac13..86bd8465c9c 100644 --- a/test/e2e/suite/issuers/acme/certificaterequest/dns01.go +++ b/test/e2e/suite/issuers/acme/certificaterequest/dns01.go @@ -24,6 +24,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" "github.com/jetstack/cert-manager/test/e2e/framework" @@ -70,7 +71,7 @@ func testDNSProvider(name string, p dns01Provider) bool { By("Creating an Issuer") issuer := gen.Issuer(issuerName, - gen.SetIssuerACME(v1alpha2.ACMEIssuer{ + gen.SetIssuerACME(cmacme.ACMEIssuer{ SkipTLSVerify: true, Server: "https://acme-staging-v02.api.letsencrypt.org/directory", Email: testingACMEEmail, @@ -79,7 +80,7 @@ func testDNSProvider(name string, p dns01Provider) bool { Name: testingACMEPrivateKey, }, }, - Solvers: []v1alpha2.ACMEChallengeSolver{ + Solvers: []cmacme.ACMEChallengeSolver{ { DNS01: &p.Details().ProviderConfig, }, diff --git a/test/e2e/suite/issuers/acme/certificaterequest/http01.go b/test/e2e/suite/issuers/acme/certificaterequest/http01.go index f844ddcf45c..38c8c0a8381 100644 --- a/test/e2e/suite/issuers/acme/certificaterequest/http01.go +++ b/test/e2e/suite/issuers/acme/certificaterequest/http01.go @@ -28,6 +28,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" cmutil "github.com/jetstack/cert-manager/pkg/util" @@ -76,22 +77,22 @@ var _ = framework.CertManagerDescribe("ACME CertificateRequest (HTTP01)", func() BeforeEach(func() { acmeURL := pebble.Details().Host acmeIssuer := util.NewCertManagerACMEIssuer(issuerName, acmeURL, testingACMEEmail, testingACMEPrivateKey) - acmeIssuer.Spec.ACME.Solvers = []v1alpha2.ACMEChallengeSolver{ + acmeIssuer.Spec.ACME.Solvers = []cmacme.ACMEChallengeSolver{ { - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Class: &addon.NginxIngress.Details().IngressClass, }, }, }, { - Selector: &v1alpha2.CertificateDNSNameSelector{ + Selector: &cmacme.CertificateDNSNameSelector{ MatchLabels: map[string]string{ "testing.cert-manager.io/fixed-ingress": "true", }, }, - HTTP01: &v1alpha2.ACMEChallengeSolverHTTP01{ - Ingress: &v1alpha2.ACMEChallengeSolverHTTP01Ingress{ + HTTP01: &cmacme.ACMEChallengeSolverHTTP01{ + Ingress: &cmacme.ACMEChallengeSolverHTTP01Ingress{ Name: fixedIngressName, }, }, diff --git a/test/e2e/suite/issuers/acme/dnsproviders/BUILD.bazel b/test/e2e/suite/issuers/acme/dnsproviders/BUILD.bazel index 3eee2997c3f..d7c80c75c9b 100644 --- a/test/e2e/suite/issuers/acme/dnsproviders/BUILD.bazel +++ b/test/e2e/suite/issuers/acme/dnsproviders/BUILD.bazel @@ -10,7 +10,7 @@ go_library( tags = ["manual"], visibility = ["//visibility:public"], deps = [ - "//pkg/apis/certmanager/v1alpha2:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", "//pkg/util:go_default_library", "//test/e2e/framework/addon/base:go_default_library", diff --git a/test/e2e/suite/issuers/acme/dnsproviders/cloudflare.go b/test/e2e/suite/issuers/acme/dnsproviders/cloudflare.go index dbdfad90ffe..4f034c92b97 100644 --- a/test/e2e/suite/issuers/acme/dnsproviders/cloudflare.go +++ b/test/e2e/suite/issuers/acme/dnsproviders/cloudflare.go @@ -20,7 +20,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" "github.com/jetstack/cert-manager/test/e2e/framework/addon/base" "github.com/jetstack/cert-manager/test/e2e/framework/config" @@ -83,8 +83,8 @@ func (b *Cloudflare) Provision() error { } b.createdSecret = s - b.details.ProviderConfig = cmapi.ACMEChallengeSolverDNS01{ - Cloudflare: &cmapi.ACMEIssuerDNS01ProviderCloudflare{ + b.details.ProviderConfig = cmacme.ACMEChallengeSolverDNS01{ + Cloudflare: &cmacme.ACMEIssuerDNS01ProviderCloudflare{ Email: b.cf.Email, APIKey: cmmeta.SecretKeySelector{ LocalObjectReference: cmmeta.LocalObjectReference{ diff --git a/test/e2e/suite/issuers/acme/dnsproviders/dnsproviders.go b/test/e2e/suite/issuers/acme/dnsproviders/dnsproviders.go index 830f3d7cad2..f81f0534681 100644 --- a/test/e2e/suite/issuers/acme/dnsproviders/dnsproviders.go +++ b/test/e2e/suite/issuers/acme/dnsproviders/dnsproviders.go @@ -23,7 +23,7 @@ package dnsproviders import ( "fmt" - cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" cmutil "github.com/jetstack/cert-manager/pkg/util" ) @@ -36,7 +36,7 @@ type Details struct { BaseDomain string // ProviderConfig is the issuer config needed to use these newly created credentials - ProviderConfig cmapi.ACMEChallengeSolverDNS01 + ProviderConfig cmacme.ACMEChallengeSolverDNS01 } func (d *Details) NewTestDomain() string { diff --git a/test/e2e/util/BUILD.bazel b/test/e2e/util/BUILD.bazel index 785aebaf99d..351d8124ae6 100644 --- a/test/e2e/util/BUILD.bazel +++ b/test/e2e/util/BUILD.bazel @@ -7,6 +7,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/api/util:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", "//pkg/client/clientset/versioned/scheme:go_default_library", diff --git a/test/e2e/util/util.go b/test/e2e/util/util.go index dae5a48a916..9b33a908194 100644 --- a/test/e2e/util/util.go +++ b/test/e2e/util/util.go @@ -38,6 +38,7 @@ import ( "k8s.io/client-go/kubernetes" apiutil "github.com/jetstack/cert-manager/pkg/api/util" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" intscheme "github.com/jetstack/cert-manager/pkg/client/clientset/versioned/scheme" @@ -416,7 +417,7 @@ func NewCertManagerACMEIssuer(name, acmeURL, acmeEmail, acmePrivateKey string) * }, Spec: v1alpha2.IssuerSpec{ IssuerConfig: v1alpha2.IssuerConfig{ - ACME: &v1alpha2.ACMEIssuer{ + ACME: &cmacme.ACMEIssuer{ Email: acmeEmail, Server: acmeURL, SkipTLSVerify: true, diff --git a/test/unit/gen/BUILD.bazel b/test/unit/gen/BUILD.bazel index baa80d3dd06..dcd2f83b57e 100644 --- a/test/unit/gen/BUILD.bazel +++ b/test/unit/gen/BUILD.bazel @@ -15,6 +15,7 @@ go_library( importpath = "github.com/jetstack/cert-manager/test/unit/gen", visibility = ["//visibility:public"], deps = [ + "//pkg/apis/acme/v1alpha2:go_default_library", "//pkg/apis/certmanager/v1alpha2:go_default_library", "//pkg/apis/meta/v1:go_default_library", "//pkg/util/pki:go_default_library", diff --git a/test/unit/gen/challenge.go b/test/unit/gen/challenge.go index 2905df28c62..055cf8fd222 100644 --- a/test/unit/gen/challenge.go +++ b/test/unit/gen/challenge.go @@ -17,14 +17,14 @@ limitations under the License. package gen import ( - "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" ) -type ChallengeModifier func(*v1alpha2.Challenge) +type ChallengeModifier func(*cmacme.Challenge) -func Challenge(name string, mods ...ChallengeModifier) *v1alpha2.Challenge { - c := &v1alpha2.Challenge{ +func Challenge(name string, mods ...ChallengeModifier) *cmacme.Challenge { + c := &cmacme.Challenge{ ObjectMeta: ObjectMeta(name), } for _, mod := range mods { @@ -33,7 +33,7 @@ func Challenge(name string, mods ...ChallengeModifier) *v1alpha2.Challenge { return c } -func ChallengeFrom(ch *v1alpha2.Challenge, mods ...ChallengeModifier) *v1alpha2.Challenge { +func ChallengeFrom(ch *cmacme.Challenge, mods ...ChallengeModifier) *cmacme.Challenge { ch = ch.DeepCopy() for _, mod := range mods { mod(ch) @@ -42,56 +42,56 @@ func ChallengeFrom(ch *v1alpha2.Challenge, mods ...ChallengeModifier) *v1alpha2. } func SetChallengeType(t string) ChallengeModifier { - return func(ch *v1alpha2.Challenge) { - ch.Spec.Type = v1alpha2.ACMEChallengeType(t) + return func(ch *cmacme.Challenge) { + ch.Spec.Type = cmacme.ACMEChallengeType(t) } } // SetIssuer sets the challenge.spec.issuerRef field func SetChallengeIssuer(o cmmeta.ObjectReference) ChallengeModifier { - return func(c *v1alpha2.Challenge) { + return func(c *cmacme.Challenge) { c.Spec.IssuerRef = o } } func SetChallengeDNSName(dnsName string) ChallengeModifier { - return func(ch *v1alpha2.Challenge) { + return func(ch *cmacme.Challenge) { ch.Spec.DNSName = dnsName } } func SetChallengePresented(p bool) ChallengeModifier { - return func(ch *v1alpha2.Challenge) { + return func(ch *cmacme.Challenge) { ch.Status.Presented = p } } func SetChallengeWildcard(p bool) ChallengeModifier { - return func(ch *v1alpha2.Challenge) { + return func(ch *cmacme.Challenge) { ch.Spec.Wildcard = p } } -func SetChallengeState(s v1alpha2.State) ChallengeModifier { - return func(ch *v1alpha2.Challenge) { +func SetChallengeState(s cmacme.State) ChallengeModifier { + return func(ch *cmacme.Challenge) { ch.Status.State = s } } func SetChallengeReason(s string) ChallengeModifier { - return func(ch *v1alpha2.Challenge) { + return func(ch *cmacme.Challenge) { ch.Status.Reason = s } } func SetChallengeURL(s string) ChallengeModifier { - return func(ch *v1alpha2.Challenge) { + return func(ch *cmacme.Challenge) { ch.Spec.URL = s } } func SetChallengeProcessing(b bool) ChallengeModifier { - return func(ch *v1alpha2.Challenge) { + return func(ch *cmacme.Challenge) { ch.Status.Processing = b } } diff --git a/test/unit/gen/issuer.go b/test/unit/gen/issuer.go index 3c895667f2d..358671541a6 100644 --- a/test/unit/gen/issuer.go +++ b/test/unit/gen/issuer.go @@ -17,6 +17,7 @@ limitations under the License. package gen import ( + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" ) @@ -58,7 +59,7 @@ func IssuerFrom(iss *v1alpha2.Issuer, mods ...IssuerModifier) *v1alpha2.Issuer { return iss } -func SetIssuerACME(a v1alpha2.ACMEIssuer) IssuerModifier { +func SetIssuerACME(a cmacme.ACMEIssuer) IssuerModifier { return func(iss v1alpha2.GenericIssuer) { iss.GetSpec().ACME = &a } diff --git a/test/unit/gen/order.go b/test/unit/gen/order.go index 186733ce291..87219eef418 100644 --- a/test/unit/gen/order.go +++ b/test/unit/gen/order.go @@ -17,14 +17,14 @@ limitations under the License. package gen import ( - "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1" ) -type OrderModifier func(*v1alpha2.Order) +type OrderModifier func(*cmacme.Order) -func Order(name string, mods ...OrderModifier) *v1alpha2.Order { - c := &v1alpha2.Order{ +func Order(name string, mods ...OrderModifier) *cmacme.Order { + c := &cmacme.Order{ ObjectMeta: ObjectMeta(name), } for _, mod := range mods { @@ -33,7 +33,7 @@ func Order(name string, mods ...OrderModifier) *v1alpha2.Order { return c } -func OrderFrom(crt *v1alpha2.Order, mods ...OrderModifier) *v1alpha2.Order { +func OrderFrom(crt *cmacme.Order, mods ...OrderModifier) *cmacme.Order { crt = crt.DeepCopy() for _, mod := range mods { mod(crt) @@ -43,49 +43,49 @@ func OrderFrom(crt *v1alpha2.Order, mods ...OrderModifier) *v1alpha2.Order { // SetIssuer sets the Order.spec.issuerRef field func SetOrderIssuer(o cmmeta.ObjectReference) OrderModifier { - return func(c *v1alpha2.Order) { + return func(c *cmacme.Order) { c.Spec.IssuerRef = o } } func SetOrderDNSNames(dnsNames ...string) OrderModifier { - return func(crt *v1alpha2.Order) { + return func(crt *cmacme.Order) { crt.Spec.DNSNames = dnsNames } } func SetOrderURL(url string) OrderModifier { - return func(crt *v1alpha2.Order) { + return func(crt *cmacme.Order) { crt.Status.URL = url } } -func SetOrderState(s v1alpha2.State) OrderModifier { - return func(crt *v1alpha2.Order) { +func SetOrderState(s cmacme.State) OrderModifier { + return func(crt *cmacme.Order) { crt.Status.State = s } } -func SetOrderStatus(s v1alpha2.OrderStatus) OrderModifier { - return func(o *v1alpha2.Order) { +func SetOrderStatus(s cmacme.OrderStatus) OrderModifier { + return func(o *cmacme.Order) { o.Status = s } } func SetOrderCertificate(d []byte) OrderModifier { - return func(crt *v1alpha2.Order) { + return func(crt *cmacme.Order) { crt.Status.Certificate = d } } func SetOrderCommonName(commonName string) OrderModifier { - return func(crt *v1alpha2.Order) { + return func(crt *cmacme.Order) { crt.Spec.CommonName = commonName } } func SetOrderNamespace(namespace string) OrderModifier { - return func(crt *v1alpha2.Order) { + return func(crt *cmacme.Order) { crt.ObjectMeta.Namespace = namespace } } diff --git a/test/unit/listers/BUILD.bazel b/test/unit/listers/BUILD.bazel index 1a510359209..168b5ee134e 100644 --- a/test/unit/listers/BUILD.bazel +++ b/test/unit/listers/BUILD.bazel @@ -9,8 +9,8 @@ go_library( importpath = "github.com/jetstack/cert-manager/test/unit/listers", visibility = ["//visibility:public"], deps = [ - "//pkg/apis/certmanager/v1alpha2:go_default_library", - "//pkg/client/listers/certmanager/v1alpha2:go_default_library", + "//pkg/apis/acme/v1alpha2:go_default_library", + "//pkg/client/listers/acme/v1alpha2:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", "//vendor/k8s.io/client-go/listers/core/v1:go_default_library", diff --git a/test/unit/listers/order.go b/test/unit/listers/order.go index 4a3d5b9a2cf..d43eafe8c20 100644 --- a/test/unit/listers/order.go +++ b/test/unit/listers/order.go @@ -19,30 +19,30 @@ package listers import ( "k8s.io/apimachinery/pkg/labels" - "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" - cmlisters "github.com/jetstack/cert-manager/pkg/client/listers/certmanager/v1alpha2" + cmacme "github.com/jetstack/cert-manager/pkg/apis/acme/v1alpha2" + acmelisters "github.com/jetstack/cert-manager/pkg/client/listers/acme/v1alpha2" ) -var _ cmlisters.OrderLister = &FakeOrderLister{} -var _ cmlisters.OrderNamespaceLister = &FakeOrderNamespaceLister{} +var _ acmelisters.OrderLister = &FakeOrderLister{} +var _ acmelisters.OrderNamespaceLister = &FakeOrderNamespaceLister{} type FakeOrderLister struct { - ListFn func(selector labels.Selector) (ret []*v1alpha2.Order, err error) - OrdersFn func(namespace string) cmlisters.OrderNamespaceLister + ListFn func(selector labels.Selector) (ret []*cmacme.Order, err error) + OrdersFn func(namespace string) acmelisters.OrderNamespaceLister } type FakeOrderNamespaceLister struct { - ListFn func(selector labels.Selector) (ret []*v1alpha2.Order, err error) - GetFn func(name string) (ret *v1alpha2.Order, err error) + ListFn func(selector labels.Selector) (ret []*cmacme.Order, err error) + GetFn func(name string) (ret *cmacme.Order, err error) } func NewFakeOrderLister() *FakeOrderLister { return &FakeOrderLister{ - ListFn: func(selector labels.Selector) (ret []*v1alpha2.Order, err error) { + ListFn: func(selector labels.Selector) (ret []*cmacme.Order, err error) { return nil, nil }, - OrdersFn: func(namespace string) cmlisters.OrderNamespaceLister { + OrdersFn: func(namespace string) acmelisters.OrderNamespaceLister { return nil }, } @@ -50,27 +50,27 @@ func NewFakeOrderLister() *FakeOrderLister { func NewFakeOrderNamespaceLister() *FakeOrderNamespaceLister { return &FakeOrderNamespaceLister{ - ListFn: func(selector labels.Selector) (ret []*v1alpha2.Order, err error) { + ListFn: func(selector labels.Selector) (ret []*cmacme.Order, err error) { return nil, nil }, - GetFn: func(name string) (ret *v1alpha2.Order, err error) { + GetFn: func(name string) (ret *cmacme.Order, err error) { return nil, nil }, } } -func (f *FakeOrderLister) List(selector labels.Selector) (ret []*v1alpha2.Order, err error) { +func (f *FakeOrderLister) List(selector labels.Selector) (ret []*cmacme.Order, err error) { return f.ListFn(selector) } -func (f *FakeOrderLister) Orders(namespace string) cmlisters.OrderNamespaceLister { +func (f *FakeOrderLister) Orders(namespace string) acmelisters.OrderNamespaceLister { return f.OrdersFn(namespace) } -func (f *FakeOrderNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.Order, err error) { +func (f *FakeOrderNamespaceLister) List(selector labels.Selector) (ret []*cmacme.Order, err error) { return f.ListFn(selector) } -func (f *FakeOrderNamespaceLister) Get(name string) (*v1alpha2.Order, error) { +func (f *FakeOrderNamespaceLister) Get(name string) (*cmacme.Order, error) { return f.GetFn(name) } diff --git a/vendor/modules.txt b/vendor/modules.txt index e349a79340f..90632851237 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -592,6 +592,7 @@ k8s.io/apimachinery/pkg/util/diff k8s.io/apimachinery/pkg/apis/meta/v1/unstructured k8s.io/apimachinery/pkg/api/apitesting/roundtrip k8s.io/apimachinery/third_party/forked/golang/reflect +k8s.io/apimachinery/pkg/api/apitesting/fuzzer k8s.io/apimachinery/pkg/util/framer k8s.io/apimachinery/pkg/util/yaml k8s.io/apimachinery/pkg/util/mergepatch @@ -599,7 +600,6 @@ k8s.io/apimachinery/third_party/forked/golang/json k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/util/rand k8s.io/apimachinery/pkg/api/apitesting -k8s.io/apimachinery/pkg/api/apitesting/fuzzer k8s.io/apimachinery/pkg/apis/meta/fuzzer k8s.io/apimachinery/pkg/apis/meta/v1beta1/validation # k8s.io/apiserver v0.0.0-20190904200128-43b0be24f0d4 => k8s.io/apiserver v0.0.0-20190904200128-43b0be24f0d4