Documentation ¶
Overview ¶
package gen implements helper functions to construct API resource test fixtures.
Index ¶
- Constants
- func CSR(keyAlgorithm x509.PublicKeyAlgorithm, mods ...CSRModifier) (csr []byte, sk crypto.Signer, err error)
- func Certificate(name string, mods ...CertificateModifier) *v1alpha2.Certificate
- func CertificateFrom(crt *v1alpha2.Certificate, mods ...CertificateModifier) *v1alpha2.Certificate
- func CertificateRequest(name string, mods ...CertificateRequestModifier) *v1alpha2.CertificateRequest
- func CertificateRequestFrom(cr *v1alpha2.CertificateRequest, mods ...CertificateRequestModifier) *v1alpha2.CertificateRequest
- func Challenge(name string, mods ...ChallengeModifier) *cmacme.Challenge
- func ChallengeFrom(ch *cmacme.Challenge, mods ...ChallengeModifier) *cmacme.Challenge
- func ClusterIssuer(name string, mods ...IssuerModifier) *v1alpha2.ClusterIssuer
- func ClusterIssuerFrom(iss *v1alpha2.ClusterIssuer, mods ...IssuerModifier) *v1alpha2.ClusterIssuer
- func Issuer(name string, mods ...IssuerModifier) *v1alpha2.Issuer
- func IssuerFrom(iss *v1alpha2.Issuer, mods ...IssuerModifier) *v1alpha2.Issuer
- func ObjectMeta(name string, mods ...ObjectMetaModifier) metav1.ObjectMeta
- func Order(name string, mods ...OrderModifier) *cmacme.Order
- func OrderFrom(crt *cmacme.Order, mods ...OrderModifier) *cmacme.Order
- func Secret(name string, mods ...SecretModifier) *corev1.Secret
- func SecretFrom(sec *corev1.Secret, mods ...SecretModifier) *corev1.Secret
- type CSRModifier
- type CertificateModifier
- func SetCertificateCommonName(commonName string) CertificateModifier
- func SetCertificateDNSNames(dnsNames ...string) CertificateModifier
- func SetCertificateDuration(duration time.Duration) CertificateModifier
- func SetCertificateIPs(ips ...string) CertificateModifier
- func SetCertificateIsCA(isCA bool) CertificateModifier
- func SetCertificateIssuer(o cmmeta.ObjectReference) CertificateModifier
- func SetCertificateKeyAlgorithm(keyAlgorithm v1alpha2.KeyAlgorithm) CertificateModifier
- func SetCertificateKeyEncoding(keyEncoding v1alpha2.KeyEncoding) CertificateModifier
- func SetCertificateKeySize(keySize int) CertificateModifier
- func SetCertificateKeyUsages(usages ...v1alpha2.KeyUsage) CertificateModifier
- func SetCertificateLastFailureTime(p metav1.Time) CertificateModifier
- func SetCertificateNamespace(namespace string) CertificateModifier
- func SetCertificateNotAfter(p metav1.Time) CertificateModifier
- func SetCertificateOrganization(orgs ...string) CertificateModifier
- func SetCertificateRenewBefore(renewBefore time.Duration) CertificateModifier
- func SetCertificateSecretName(secretName string) CertificateModifier
- func SetCertificateStatusCondition(c v1alpha2.CertificateCondition) CertificateModifier
- func SetCertificateURIs(uris ...string) CertificateModifier
- type CertificateRequestModifier
- func AddCertificateRequestAnnotations(annotations map[string]string) CertificateRequestModifier
- func SetCertificateRequestAnnotations(annotations map[string]string) CertificateRequestModifier
- func SetCertificateRequestCA(ca []byte) CertificateRequestModifier
- func SetCertificateRequestCSR(csr []byte) CertificateRequestModifier
- func SetCertificateRequestCertificate(cert []byte) CertificateRequestModifier
- func SetCertificateRequestDuration(duration *metav1.Duration) CertificateRequestModifier
- func SetCertificateRequestFailureTime(p metav1.Time) CertificateRequestModifier
- func SetCertificateRequestIsCA(isCA bool) CertificateRequestModifier
- func SetCertificateRequestIssuer(o cmmeta.ObjectReference) CertificateRequestModifier
- func SetCertificateRequestKeyUsages(usages ...v1alpha2.KeyUsage) CertificateRequestModifier
- func SetCertificateRequestName(name string) CertificateRequestModifier
- func SetCertificateRequestNamespace(namespace string) CertificateRequestModifier
- func SetCertificateRequestStatusCondition(c v1alpha2.CertificateRequestCondition) CertificateRequestModifier
- type ChallengeModifier
- func SetChallengeDNSName(dnsName string) ChallengeModifier
- func SetChallengeIssuer(o cmmeta.ObjectReference) ChallengeModifier
- func SetChallengePresented(p bool) ChallengeModifier
- func SetChallengeProcessing(b bool) ChallengeModifier
- func SetChallengeReason(s string) ChallengeModifier
- func SetChallengeState(s cmacme.State) ChallengeModifier
- func SetChallengeType(t string) ChallengeModifier
- func SetChallengeURL(s string) ChallengeModifier
- func SetChallengeWildcard(p bool) ChallengeModifier
- type IssuerModifier
- func AddIssuerCondition(c v1alpha2.IssuerCondition) IssuerModifier
- func SetIssuerACME(a cmacme.ACMEIssuer) IssuerModifier
- func SetIssuerCA(a v1alpha2.CAIssuer) IssuerModifier
- func SetIssuerSelfSigned(a v1alpha2.SelfSignedIssuer) IssuerModifier
- func SetIssuerVault(v v1alpha2.VaultIssuer) IssuerModifier
- func SetIssuerVenafi(a v1alpha2.VenafiIssuer) IssuerModifier
- type ObjectMetaModifier
- type OrderModifier
- func SetOrderCertificate(d []byte) OrderModifier
- func SetOrderCommonName(commonName string) OrderModifier
- func SetOrderDNSNames(dnsNames ...string) OrderModifier
- func SetOrderIssuer(o cmmeta.ObjectReference) OrderModifier
- func SetOrderNamespace(namespace string) OrderModifier
- func SetOrderState(s cmacme.State) OrderModifier
- func SetOrderStatus(s cmacme.OrderStatus) OrderModifier
- func SetOrderURL(url string) OrderModifier
- type SecretModifier
Constants ¶
View Source
const ( // DefaultTestNamespace is the default namespace set on resources that // are namespaced. DefaultTestNamespace = "default-unit-test-ns" )
Variables ¶
This section is empty.
Functions ¶
func CSR ¶ added in v0.10.0
func CSR(keyAlgorithm x509.PublicKeyAlgorithm, mods ...CSRModifier) (csr []byte, sk crypto.Signer, err error)
func Certificate ¶
func Certificate(name string, mods ...CertificateModifier) *v1alpha2.Certificate
func CertificateFrom ¶
func CertificateFrom(crt *v1alpha2.Certificate, mods ...CertificateModifier) *v1alpha2.Certificate
func CertificateRequest ¶ added in v0.9.0
func CertificateRequest(name string, mods ...CertificateRequestModifier) *v1alpha2.CertificateRequest
func CertificateRequestFrom ¶ added in v0.9.0
func CertificateRequestFrom(cr *v1alpha2.CertificateRequest, mods ...CertificateRequestModifier) *v1alpha2.CertificateRequest
func ChallengeFrom ¶
func ChallengeFrom(ch *cmacme.Challenge, mods ...ChallengeModifier) *cmacme.Challenge
func ClusterIssuer ¶ added in v0.6.0
func ClusterIssuer(name string, mods ...IssuerModifier) *v1alpha2.ClusterIssuer
func ClusterIssuerFrom ¶ added in v0.6.0
func ClusterIssuerFrom(iss *v1alpha2.ClusterIssuer, mods ...IssuerModifier) *v1alpha2.ClusterIssuer
func IssuerFrom ¶
func IssuerFrom(iss *v1alpha2.Issuer, mods ...IssuerModifier) *v1alpha2.Issuer
func ObjectMeta ¶
func ObjectMeta(name string, mods ...ObjectMetaModifier) metav1.ObjectMeta
ObjectMeta creates a new metav1.ObjectMeta with the given name, optionally applying the provided ObjectMetaModifiers. It applies a DefaultTestNamespace by default. Cluster-scoped resource generators should explicitly add `SetNamespace("")` to their constructors.
func OrderFrom ¶ added in v0.10.0
func OrderFrom(crt *cmacme.Order, mods ...OrderModifier) *cmacme.Order
func SecretFrom ¶ added in v0.11.1
func SecretFrom(sec *corev1.Secret, mods ...SecretModifier) *corev1.Secret
Types ¶
type CSRModifier ¶ added in v0.10.0
type CSRModifier func(*x509.CertificateRequest)
func SetCSRDNSNames ¶ added in v0.10.0
func SetCSRDNSNames(dnsNames ...string) CSRModifier
func SetCSRIPAddresses ¶ added in v0.10.0
func SetCSRIPAddresses(ips ...net.IP) CSRModifier
func SetCSRURIs ¶ added in v0.10.0
func SetCSRURIs(uris ...*url.URL) CSRModifier
type CertificateModifier ¶
type CertificateModifier func(*v1alpha2.Certificate)
func SetCertificateCommonName ¶
func SetCertificateCommonName(commonName string) CertificateModifier
func SetCertificateDNSNames ¶
func SetCertificateDNSNames(dnsNames ...string) CertificateModifier
func SetCertificateDuration ¶ added in v0.9.0
func SetCertificateDuration(duration time.Duration) CertificateModifier
func SetCertificateIPs ¶ added in v0.11.0
func SetCertificateIPs(ips ...string) CertificateModifier
func SetCertificateIsCA ¶
func SetCertificateIsCA(isCA bool) CertificateModifier
func SetCertificateIssuer ¶
func SetCertificateIssuer(o cmmeta.ObjectReference) CertificateModifier
SetIssuer sets the Certificate.spec.issuerRef field
func SetCertificateKeyAlgorithm ¶
func SetCertificateKeyAlgorithm(keyAlgorithm v1alpha2.KeyAlgorithm) CertificateModifier
func SetCertificateKeyEncoding ¶ added in v0.9.0
func SetCertificateKeyEncoding(keyEncoding v1alpha2.KeyEncoding) CertificateModifier
func SetCertificateKeySize ¶
func SetCertificateKeySize(keySize int) CertificateModifier
func SetCertificateKeyUsages ¶ added in v0.10.0
func SetCertificateKeyUsages(usages ...v1alpha2.KeyUsage) CertificateModifier
func SetCertificateLastFailureTime ¶
func SetCertificateLastFailureTime(p metav1.Time) CertificateModifier
func SetCertificateNamespace ¶ added in v0.9.0
func SetCertificateNamespace(namespace string) CertificateModifier
func SetCertificateNotAfter ¶ added in v0.7.0
func SetCertificateNotAfter(p metav1.Time) CertificateModifier
func SetCertificateOrganization ¶ added in v0.7.0
func SetCertificateOrganization(orgs ...string) CertificateModifier
func SetCertificateRenewBefore ¶ added in v0.9.0
func SetCertificateRenewBefore(renewBefore time.Duration) CertificateModifier
func SetCertificateSecretName ¶
func SetCertificateSecretName(secretName string) CertificateModifier
func SetCertificateStatusCondition ¶ added in v0.7.0
func SetCertificateStatusCondition(c v1alpha2.CertificateCondition) CertificateModifier
func SetCertificateURIs ¶ added in v0.11.0
func SetCertificateURIs(uris ...string) CertificateModifier
type CertificateRequestModifier ¶ added in v0.9.0
type CertificateRequestModifier func(*v1alpha2.CertificateRequest)
func AddCertificateRequestAnnotations ¶ added in v0.10.0
func AddCertificateRequestAnnotations(annotations map[string]string) CertificateRequestModifier
func SetCertificateRequestAnnotations ¶ added in v0.10.0
func SetCertificateRequestAnnotations(annotations map[string]string) CertificateRequestModifier
func SetCertificateRequestCA ¶ added in v0.9.0
func SetCertificateRequestCA(ca []byte) CertificateRequestModifier
func SetCertificateRequestCSR ¶ added in v0.9.0
func SetCertificateRequestCSR(csr []byte) CertificateRequestModifier
func SetCertificateRequestCertificate ¶ added in v0.9.0
func SetCertificateRequestCertificate(cert []byte) CertificateRequestModifier
func SetCertificateRequestDuration ¶ added in v0.9.0
func SetCertificateRequestDuration(duration *metav1.Duration) CertificateRequestModifier
func SetCertificateRequestFailureTime ¶ added in v0.10.0
func SetCertificateRequestFailureTime(p metav1.Time) CertificateRequestModifier
func SetCertificateRequestIsCA ¶ added in v0.9.0
func SetCertificateRequestIsCA(isCA bool) CertificateRequestModifier
func SetCertificateRequestIssuer ¶ added in v0.9.0
func SetCertificateRequestIssuer(o cmmeta.ObjectReference) CertificateRequestModifier
SetIssuer sets the CertificateRequest.spec.issuerRef field
func SetCertificateRequestKeyUsages ¶ added in v0.10.0
func SetCertificateRequestKeyUsages(usages ...v1alpha2.KeyUsage) CertificateRequestModifier
func SetCertificateRequestName ¶ added in v0.9.0
func SetCertificateRequestName(name string) CertificateRequestModifier
func SetCertificateRequestNamespace ¶ added in v0.9.0
func SetCertificateRequestNamespace(namespace string) CertificateRequestModifier
func SetCertificateRequestStatusCondition ¶ added in v0.9.0
func SetCertificateRequestStatusCondition(c v1alpha2.CertificateRequestCondition) CertificateRequestModifier
type ChallengeModifier ¶
func SetChallengeDNSName ¶
func SetChallengeDNSName(dnsName string) ChallengeModifier
func SetChallengeIssuer ¶
func SetChallengeIssuer(o cmmeta.ObjectReference) ChallengeModifier
SetIssuer sets the challenge.spec.issuerRef field
func SetChallengePresented ¶
func SetChallengePresented(p bool) ChallengeModifier
func SetChallengeProcessing ¶
func SetChallengeProcessing(b bool) ChallengeModifier
func SetChallengeReason ¶
func SetChallengeReason(s string) ChallengeModifier
func SetChallengeState ¶
func SetChallengeState(s cmacme.State) ChallengeModifier
func SetChallengeType ¶
func SetChallengeType(t string) ChallengeModifier
func SetChallengeURL ¶
func SetChallengeURL(s string) ChallengeModifier
func SetChallengeWildcard ¶ added in v0.6.0
func SetChallengeWildcard(p bool) ChallengeModifier
type IssuerModifier ¶
type IssuerModifier func(v1alpha2.GenericIssuer)
func AddIssuerCondition ¶
func AddIssuerCondition(c v1alpha2.IssuerCondition) IssuerModifier
func SetIssuerACME ¶
func SetIssuerACME(a cmacme.ACMEIssuer) IssuerModifier
func SetIssuerCA ¶
func SetIssuerCA(a v1alpha2.CAIssuer) IssuerModifier
func SetIssuerSelfSigned ¶
func SetIssuerSelfSigned(a v1alpha2.SelfSignedIssuer) IssuerModifier
func SetIssuerVault ¶ added in v0.10.0
func SetIssuerVault(v v1alpha2.VaultIssuer) IssuerModifier
func SetIssuerVenafi ¶ added in v0.10.0
func SetIssuerVenafi(a v1alpha2.VenafiIssuer) IssuerModifier
type ObjectMetaModifier ¶
type ObjectMetaModifier func(*metav1.ObjectMeta)
ObjectMetaModifier applies a transformation to the provider ObjectMeta
type OrderModifier ¶ added in v0.10.0
func SetOrderCertificate ¶ added in v0.10.0
func SetOrderCertificate(d []byte) OrderModifier
func SetOrderCommonName ¶ added in v0.10.0
func SetOrderCommonName(commonName string) OrderModifier
func SetOrderDNSNames ¶ added in v0.10.0
func SetOrderDNSNames(dnsNames ...string) OrderModifier
func SetOrderIssuer ¶ added in v0.10.0
func SetOrderIssuer(o cmmeta.ObjectReference) OrderModifier
SetIssuer sets the Order.spec.issuerRef field
func SetOrderNamespace ¶ added in v0.10.0
func SetOrderNamespace(namespace string) OrderModifier
func SetOrderState ¶ added in v0.10.0
func SetOrderState(s cmacme.State) OrderModifier
func SetOrderStatus ¶ added in v0.11.0
func SetOrderStatus(s cmacme.OrderStatus) OrderModifier
func SetOrderURL ¶ added in v0.10.0
func SetOrderURL(url string) OrderModifier
type SecretModifier ¶ added in v0.11.1
func SetSecretAnnotations ¶ added in v0.11.1
func SetSecretAnnotations(an map[string]string) SecretModifier
Click to show internal directories.
Click to hide internal directories.