From 9ee6ea7b7db904d36116a0adb2cabb80dd86302a Mon Sep 17 00:00:00 2001 From: Joshua Mathianas Date: Thu, 16 Jan 2020 09:49:40 -0500 Subject: [PATCH] Fixed a typo and ran generators Signed-off-by: Joshua Mathianas --- .../cert-manager/crds/certificates.yaml | 77 +++++++++---------- deploy/manifests/00-crds.yaml | 77 +++++++++---------- .../v1alpha2/zz_generated.deepcopy.go | 43 +++++------ .../apis/certmanager/types_certificate.go | 3 +- .../v1alpha2/zz_generated.conversion.go | 66 +++++++--------- .../apis/certmanager/zz_generated.deepcopy.go | 39 ++++------ 6 files changed, 137 insertions(+), 168 deletions(-) diff --git a/deploy/charts/cert-manager/crds/certificates.yaml b/deploy/charts/cert-manager/crds/certificates.yaml index 18e6b2b99..29eabe698 100644 --- a/deploy/charts/cert-manager/crds/certificates.yaml +++ b/deploy/charts/cert-manager/crds/certificates.yaml @@ -144,6 +144,43 @@ spec: description: SecretName is the name of the secret resource to store this secret in type: string + subject: + description: Full X509 name specification (https://golang.org/pkg/crypto/x509/pkix/#Name). + type: object + properties: + country: + description: Countries to be used on the Certificate. + type: array + items: + type: string + locality: + description: Cities to be used on the Certificate. + type: array + items: + type: string + organizationalUnit: + description: Organizational Units to be used on the Certificate. + type: array + items: + type: string + postalCode: + description: Postal codes to be used on the Certificate. + type: array + items: + type: string + province: + description: State/Provinces to be used on the Certificate. + type: array + items: + type: string + serialNumber: + description: Serial number to be used on the Certificate. + type: string + streetAddress: + description: Street addresses to be used on the Certificate. + type: array + items: + type: string uriSANs: description: URISANs is a list of URI Subject Alternative Names to be set on this Certificate. @@ -190,46 +227,6 @@ spec: - ocsp signing - microsoft sgc - netscape sgc - x509Name: - description: Full X509 name specification (https://golang.org/pkg/crypto/x509/pkix/#Name). - If specified, overrides any other name elements below. - type: object - properties: - commonName: - type: string - country: - description: Country/Region - type: array - items: - type: string - locality: - description: City - type: array - items: - type: string - organization: - type: array - items: - type: string - organizationalUnit: - type: array - items: - type: string - postalCode: - type: array - items: - type: string - province: - description: State/Province - type: array - items: - type: string - serialNumber: - type: string - streetAddress: - type: array - items: - type: string status: description: CertificateStatus defines the observed state of Certificate type: object diff --git a/deploy/manifests/00-crds.yaml b/deploy/manifests/00-crds.yaml index 94fac9527..002ccb7f1 100644 --- a/deploy/manifests/00-crds.yaml +++ b/deploy/manifests/00-crds.yaml @@ -335,6 +335,43 @@ spec: description: SecretName is the name of the secret resource to store this secret in type: string + subject: + description: Full X509 name specification (https://golang.org/pkg/crypto/x509/pkix/#Name). + type: object + properties: + country: + description: Countries to be used on the Certificate. + type: array + items: + type: string + locality: + description: Cities to be used on the Certificate. + type: array + items: + type: string + organizationalUnit: + description: Organizational Units to be used on the Certificate. + type: array + items: + type: string + postalCode: + description: Postal codes to be used on the Certificate. + type: array + items: + type: string + province: + description: State/Provinces to be used on the Certificate. + type: array + items: + type: string + serialNumber: + description: Serial number to be used on the Certificate. + type: string + streetAddress: + description: Street addresses to be used on the Certificate. + type: array + items: + type: string uriSANs: description: URISANs is a list of URI Subject Alternative Names to be set on this Certificate. @@ -381,46 +418,6 @@ spec: - ocsp signing - microsoft sgc - netscape sgc - x509Name: - description: Full X509 name specification (https://golang.org/pkg/crypto/x509/pkix/#Name). - If specified, overrides any other name elements below. - type: object - properties: - commonName: - type: string - country: - description: Country/Region - type: array - items: - type: string - locality: - description: City - type: array - items: - type: string - organization: - type: array - items: - type: string - organizationalUnit: - type: array - items: - type: string - postalCode: - type: array - items: - type: string - province: - description: State/Province - type: array - items: - type: string - serialNumber: - type: string - streetAddress: - type: array - items: - type: string status: description: CertificateStatus defines the observed state of Certificate type: object diff --git a/pkg/apis/certmanager/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/certmanager/v1alpha2/zz_generated.deepcopy.go index 0419225ef..1ab249c59 100644 --- a/pkg/apis/certmanager/v1alpha2/zz_generated.deepcopy.go +++ b/pkg/apis/certmanager/v1alpha2/zz_generated.deepcopy.go @@ -277,9 +277,9 @@ func (in *CertificateRequestStatus) DeepCopy() *CertificateRequestStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CertificateSpec) DeepCopyInto(out *CertificateSpec) { *out = *in - if in.X509Name != nil { - in, out := &in.X509Name, &out.X509Name - *out = new(X509DistinguishedName) + if in.Subject != nil { + in, out := &in.Subject, &out.Subject + *out = new(X509Subject) (*in).DeepCopyInto(*out) } if in.Organization != nil { @@ -759,52 +759,47 @@ func (in *VenafiTPP) DeepCopy() *VenafiTPP { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *X509DistinguishedName) DeepCopyInto(out *X509DistinguishedName) { +func (in *X509Subject) DeepCopyInto(out *X509Subject) { *out = *in - if in.Country != nil { - in, out := &in.Country, &out.Country + if in.Countries != nil { + in, out := &in.Countries, &out.Countries *out = make([]string, len(*in)) copy(*out, *in) } - if in.Organization != nil { - in, out := &in.Organization, &out.Organization + if in.OrganizationalUnits != nil { + in, out := &in.OrganizationalUnits, &out.OrganizationalUnits *out = make([]string, len(*in)) copy(*out, *in) } - if in.OrganizationalUnit != nil { - in, out := &in.OrganizationalUnit, &out.OrganizationalUnit + if in.Localities != nil { + in, out := &in.Localities, &out.Localities *out = make([]string, len(*in)) copy(*out, *in) } - if in.Locality != nil { - in, out := &in.Locality, &out.Locality + if in.Provinces != nil { + in, out := &in.Provinces, &out.Provinces *out = make([]string, len(*in)) copy(*out, *in) } - if in.Province != nil { - in, out := &in.Province, &out.Province + if in.StreetAddresses != nil { + in, out := &in.StreetAddresses, &out.StreetAddresses *out = make([]string, len(*in)) copy(*out, *in) } - if in.StreetAddress != nil { - in, out := &in.StreetAddress, &out.StreetAddress - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.PostalCode != nil { - in, out := &in.PostalCode, &out.PostalCode + if in.PostalCodes != nil { + in, out := &in.PostalCodes, &out.PostalCodes *out = make([]string, len(*in)) copy(*out, *in) } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new X509DistinguishedName. -func (in *X509DistinguishedName) DeepCopy() *X509DistinguishedName { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new X509Subject. +func (in *X509Subject) DeepCopy() *X509Subject { if in == nil { return nil } - out := new(X509DistinguishedName) + out := new(X509Subject) in.DeepCopyInto(out) return out } diff --git a/pkg/internal/apis/certmanager/types_certificate.go b/pkg/internal/apis/certmanager/types_certificate.go index 0dfe61bd3..59826f085 100644 --- a/pkg/internal/apis/certmanager/types_certificate.go +++ b/pkg/internal/apis/certmanager/types_certificate.go @@ -60,9 +60,8 @@ const ( // CertificateSpec defines the desired state of Certificate type CertificateSpec struct { // Full X509 name specification (https://golang.org/pkg/crypto/x509/pkix/#Name). - // If specified, overrides any other name elements below. // +optional - X509Name *X509DistinguishedName `json:"x509Name,omitempty"` + X509Name *X509Subject `json:"x509Name,omitempty"` // A valid Certificate requires at least one of a CommonName, DNSName, or // URISAN to be valid. diff --git a/pkg/internal/apis/certmanager/v1alpha2/zz_generated.conversion.go b/pkg/internal/apis/certmanager/v1alpha2/zz_generated.conversion.go index 2072bb9e9..9a5ba34c2 100644 --- a/pkg/internal/apis/certmanager/v1alpha2/zz_generated.conversion.go +++ b/pkg/internal/apis/certmanager/v1alpha2/zz_generated.conversion.go @@ -311,13 +311,13 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha2.X509DistinguishedName)(nil), (*certmanager.X509DistinguishedName)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_X509DistinguishedName_To_certmanager_X509DistinguishedName(a.(*v1alpha2.X509DistinguishedName), b.(*certmanager.X509DistinguishedName), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha2.X509Subject)(nil), (*certmanager.X509Subject)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_X509Subject_To_certmanager_X509Subject(a.(*v1alpha2.X509Subject), b.(*certmanager.X509Subject), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*certmanager.X509DistinguishedName)(nil), (*v1alpha2.X509DistinguishedName)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_certmanager_X509DistinguishedName_To_v1alpha2_X509DistinguishedName(a.(*certmanager.X509DistinguishedName), b.(*v1alpha2.X509DistinguishedName), scope) + if err := s.AddGeneratedConversionFunc((*certmanager.X509Subject)(nil), (*v1alpha2.X509Subject)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_certmanager_X509Subject_To_v1alpha2_X509Subject(a.(*certmanager.X509Subject), b.(*v1alpha2.X509Subject), scope) }); err != nil { return err } @@ -569,7 +569,7 @@ 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.X509Name = (*certmanager.X509DistinguishedName)(unsafe.Pointer(in.X509Name)) + // WARNING: in.Subject requires manual conversion: does not exist in peer-type out.CommonName = in.CommonName out.Organization = *(*[]string)(unsafe.Pointer(&in.Organization)) out.Duration = (*v1.Duration)(unsafe.Pointer(in.Duration)) @@ -590,13 +590,8 @@ func autoConvert_v1alpha2_CertificateSpec_To_certmanager_CertificateSpec(in *v1a return nil } -// Convert_v1alpha2_CertificateSpec_To_certmanager_CertificateSpec is an autogenerated conversion function. -func Convert_v1alpha2_CertificateSpec_To_certmanager_CertificateSpec(in *v1alpha2.CertificateSpec, out *certmanager.CertificateSpec, s conversion.Scope) error { - return autoConvert_v1alpha2_CertificateSpec_To_certmanager_CertificateSpec(in, out, s) -} - func autoConvert_certmanager_CertificateSpec_To_v1alpha2_CertificateSpec(in *certmanager.CertificateSpec, out *v1alpha2.CertificateSpec, s conversion.Scope) error { - out.X509Name = (*v1alpha2.X509DistinguishedName)(unsafe.Pointer(in.X509Name)) + // WARNING: in.X509Name requires manual conversion: does not exist in peer-type out.CommonName = in.CommonName out.Organization = *(*[]string)(unsafe.Pointer(&in.Organization)) out.Duration = (*v1.Duration)(unsafe.Pointer(in.Duration)) @@ -617,11 +612,6 @@ func autoConvert_certmanager_CertificateSpec_To_v1alpha2_CertificateSpec(in *cer return nil } -// Convert_certmanager_CertificateSpec_To_v1alpha2_CertificateSpec is an autogenerated conversion function. -func Convert_certmanager_CertificateSpec_To_v1alpha2_CertificateSpec(in *certmanager.CertificateSpec, out *v1alpha2.CertificateSpec, s conversion.Scope) error { - return autoConvert_certmanager_CertificateSpec_To_v1alpha2_CertificateSpec(in, out, s) -} - 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 = (*v1.Time)(unsafe.Pointer(in.LastFailureTime)) @@ -1070,38 +1060,34 @@ func Convert_certmanager_VenafiTPP_To_v1alpha2_VenafiTPP(in *certmanager.VenafiT return autoConvert_certmanager_VenafiTPP_To_v1alpha2_VenafiTPP(in, out, s) } -func autoConvert_v1alpha2_X509DistinguishedName_To_certmanager_X509DistinguishedName(in *v1alpha2.X509DistinguishedName, out *certmanager.X509DistinguishedName, s conversion.Scope) error { - out.Country = *(*[]string)(unsafe.Pointer(&in.Country)) - out.Organization = *(*[]string)(unsafe.Pointer(&in.Organization)) - out.OrganizationalUnit = *(*[]string)(unsafe.Pointer(&in.OrganizationalUnit)) - out.Locality = *(*[]string)(unsafe.Pointer(&in.Locality)) - out.Province = *(*[]string)(unsafe.Pointer(&in.Province)) - out.StreetAddress = *(*[]string)(unsafe.Pointer(&in.StreetAddress)) - out.PostalCode = *(*[]string)(unsafe.Pointer(&in.PostalCode)) +func autoConvert_v1alpha2_X509Subject_To_certmanager_X509Subject(in *v1alpha2.X509Subject, out *certmanager.X509Subject, s conversion.Scope) error { + out.Countries = *(*[]string)(unsafe.Pointer(&in.Countries)) + out.OrganizationalUnits = *(*[]string)(unsafe.Pointer(&in.OrganizationalUnits)) + out.Localities = *(*[]string)(unsafe.Pointer(&in.Localities)) + out.Provinces = *(*[]string)(unsafe.Pointer(&in.Provinces)) + out.StreetAddresses = *(*[]string)(unsafe.Pointer(&in.StreetAddresses)) + out.PostalCodes = *(*[]string)(unsafe.Pointer(&in.PostalCodes)) out.SerialNumber = in.SerialNumber - out.CommonName = in.CommonName return nil } -// Convert_v1alpha2_X509DistinguishedName_To_certmanager_X509DistinguishedName is an autogenerated conversion function. -func Convert_v1alpha2_X509DistinguishedName_To_certmanager_X509DistinguishedName(in *v1alpha2.X509DistinguishedName, out *certmanager.X509DistinguishedName, s conversion.Scope) error { - return autoConvert_v1alpha2_X509DistinguishedName_To_certmanager_X509DistinguishedName(in, out, s) +// Convert_v1alpha2_X509Subject_To_certmanager_X509Subject is an autogenerated conversion function. +func Convert_v1alpha2_X509Subject_To_certmanager_X509Subject(in *v1alpha2.X509Subject, out *certmanager.X509Subject, s conversion.Scope) error { + return autoConvert_v1alpha2_X509Subject_To_certmanager_X509Subject(in, out, s) } -func autoConvert_certmanager_X509DistinguishedName_To_v1alpha2_X509DistinguishedName(in *certmanager.X509DistinguishedName, out *v1alpha2.X509DistinguishedName, s conversion.Scope) error { - out.Country = *(*[]string)(unsafe.Pointer(&in.Country)) - out.Organization = *(*[]string)(unsafe.Pointer(&in.Organization)) - out.OrganizationalUnit = *(*[]string)(unsafe.Pointer(&in.OrganizationalUnit)) - out.Locality = *(*[]string)(unsafe.Pointer(&in.Locality)) - out.Province = *(*[]string)(unsafe.Pointer(&in.Province)) - out.StreetAddress = *(*[]string)(unsafe.Pointer(&in.StreetAddress)) - out.PostalCode = *(*[]string)(unsafe.Pointer(&in.PostalCode)) +func autoConvert_certmanager_X509Subject_To_v1alpha2_X509Subject(in *certmanager.X509Subject, out *v1alpha2.X509Subject, s conversion.Scope) error { + out.Countries = *(*[]string)(unsafe.Pointer(&in.Countries)) + out.OrganizationalUnits = *(*[]string)(unsafe.Pointer(&in.OrganizationalUnits)) + out.Localities = *(*[]string)(unsafe.Pointer(&in.Localities)) + out.Provinces = *(*[]string)(unsafe.Pointer(&in.Provinces)) + out.StreetAddresses = *(*[]string)(unsafe.Pointer(&in.StreetAddresses)) + out.PostalCodes = *(*[]string)(unsafe.Pointer(&in.PostalCodes)) out.SerialNumber = in.SerialNumber - out.CommonName = in.CommonName return nil } -// Convert_certmanager_X509DistinguishedName_To_v1alpha2_X509DistinguishedName is an autogenerated conversion function. -func Convert_certmanager_X509DistinguishedName_To_v1alpha2_X509DistinguishedName(in *certmanager.X509DistinguishedName, out *v1alpha2.X509DistinguishedName, s conversion.Scope) error { - return autoConvert_certmanager_X509DistinguishedName_To_v1alpha2_X509DistinguishedName(in, out, s) +// Convert_certmanager_X509Subject_To_v1alpha2_X509Subject is an autogenerated conversion function. +func Convert_certmanager_X509Subject_To_v1alpha2_X509Subject(in *certmanager.X509Subject, out *v1alpha2.X509Subject, s conversion.Scope) error { + return autoConvert_certmanager_X509Subject_To_v1alpha2_X509Subject(in, out, s) } diff --git a/pkg/internal/apis/certmanager/zz_generated.deepcopy.go b/pkg/internal/apis/certmanager/zz_generated.deepcopy.go index c065bbc56..97c0f6530 100644 --- a/pkg/internal/apis/certmanager/zz_generated.deepcopy.go +++ b/pkg/internal/apis/certmanager/zz_generated.deepcopy.go @@ -279,7 +279,7 @@ func (in *CertificateSpec) DeepCopyInto(out *CertificateSpec) { *out = *in if in.X509Name != nil { in, out := &in.X509Name, &out.X509Name - *out = new(X509DistinguishedName) + *out = new(X509Subject) (*in).DeepCopyInto(*out) } if in.Organization != nil { @@ -759,52 +759,47 @@ func (in *VenafiTPP) DeepCopy() *VenafiTPP { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *X509DistinguishedName) DeepCopyInto(out *X509DistinguishedName) { +func (in *X509Subject) DeepCopyInto(out *X509Subject) { *out = *in - if in.Country != nil { - in, out := &in.Country, &out.Country + if in.Countries != nil { + in, out := &in.Countries, &out.Countries *out = make([]string, len(*in)) copy(*out, *in) } - if in.Organization != nil { - in, out := &in.Organization, &out.Organization + if in.OrganizationalUnits != nil { + in, out := &in.OrganizationalUnits, &out.OrganizationalUnits *out = make([]string, len(*in)) copy(*out, *in) } - if in.OrganizationalUnit != nil { - in, out := &in.OrganizationalUnit, &out.OrganizationalUnit + if in.Localities != nil { + in, out := &in.Localities, &out.Localities *out = make([]string, len(*in)) copy(*out, *in) } - if in.Locality != nil { - in, out := &in.Locality, &out.Locality + if in.Provinces != nil { + in, out := &in.Provinces, &out.Provinces *out = make([]string, len(*in)) copy(*out, *in) } - if in.Province != nil { - in, out := &in.Province, &out.Province + if in.StreetAddresses != nil { + in, out := &in.StreetAddresses, &out.StreetAddresses *out = make([]string, len(*in)) copy(*out, *in) } - if in.StreetAddress != nil { - in, out := &in.StreetAddress, &out.StreetAddress - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.PostalCode != nil { - in, out := &in.PostalCode, &out.PostalCode + if in.PostalCodes != nil { + in, out := &in.PostalCodes, &out.PostalCodes *out = make([]string, len(*in)) copy(*out, *in) } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new X509DistinguishedName. -func (in *X509DistinguishedName) DeepCopy() *X509DistinguishedName { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new X509Subject. +func (in *X509Subject) DeepCopy() *X509Subject { if in == nil { return nil } - out := new(X509DistinguishedName) + out := new(X509Subject) in.DeepCopyInto(out) return out }