From ff2384d896487c788c6ce6d3ef54caa7e69822a6 Mon Sep 17 00:00:00 2001 From: Matthew Christopher Date: Wed, 4 Oct 2023 08:50:52 -0700 Subject: [PATCH] Small APIM fixups --- .../service_spec_arm_types_gen.go | 5 +- .../service_status_arm_types_gen.go | 3 - .../service_status_arm_types_gen_test.go | 1 - .../v1api20220801/service_types_gen.go | 98 ++++++++++--------- .../v1api20220801/service_types_gen_test.go | 3 - .../apimanagement/v1api20220801/structure.txt | 10 +- .../v1api20220801/zz_generated.deepcopy.go | 12 +-- .../v1api20220801storage/service_types_gen.go | 28 +++--- .../service_types_gen_test.go | 3 - .../v1api20220801storage/structure.txt | 7 +- .../zz_generated.deepcopy.go | 7 +- v2/azure-arm.yaml | 6 ++ .../controllers/controller_resources_gen.go | 36 +++++-- 13 files changed, 110 insertions(+), 109 deletions(-) diff --git a/v2/api/apimanagement/v1api20220801/service_spec_arm_types_gen.go b/v2/api/apimanagement/v1api20220801/service_spec_arm_types_gen.go index 6d7e56d6f9b..8a4079f9282 100644 --- a/v2/api/apimanagement/v1api20220801/service_spec_arm_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/service_spec_arm_types_gen.go @@ -103,10 +103,7 @@ type ApiManagementServiceProperties_ARM struct { // NotificationSenderEmail: Email address from which the notification will be sent. NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` - - // PublicIpAddressId: Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in - // the region. Supported only for Developer and Premium SKU being deployed in Virtual Network. - PublicIpAddressId *string `json:"publicIpAddressId,omitempty"` + PublicIpAddressId *string `json:"publicIpAddressId,omitempty"` // PublicNetworkAccess: Whether or not public endpoint access is allowed for this API Management service. Value is // optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access diff --git a/v2/api/apimanagement/v1api20220801/service_status_arm_types_gen.go b/v2/api/apimanagement/v1api20220801/service_status_arm_types_gen.go index 0b272b66863..a8c83e6bb2e 100644 --- a/v2/api/apimanagement/v1api20220801/service_status_arm_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/service_status_arm_types_gen.go @@ -293,9 +293,6 @@ type CertificateConfiguration_STATUS_ARM struct { // Certificate: Certificate information. Certificate *CertificateInformation_STATUS_ARM `json:"certificate,omitempty"` - // CertificatePassword: Certificate Password. - CertificatePassword *string `json:"certificatePassword,omitempty"` - // EncodedCertificate: Base64 Encoded certificate. EncodedCertificate *string `json:"encodedCertificate,omitempty"` diff --git a/v2/api/apimanagement/v1api20220801/service_status_arm_types_gen_test.go b/v2/api/apimanagement/v1api20220801/service_status_arm_types_gen_test.go index 3fa62397393..777f60ef750 100644 --- a/v2/api/apimanagement/v1api20220801/service_status_arm_types_gen_test.go +++ b/v2/api/apimanagement/v1api20220801/service_status_arm_types_gen_test.go @@ -647,7 +647,6 @@ func CertificateConfiguration_STATUS_ARMGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForCertificateConfiguration_STATUS_ARM is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForCertificateConfiguration_STATUS_ARM(gens map[string]gopter.Gen) { - gens["CertificatePassword"] = gen.PtrOf(gen.AlphaString()) gens["EncodedCertificate"] = gen.PtrOf(gen.AlphaString()) gens["StoreName"] = gen.PtrOf(gen.OneConstOf(CertificateConfiguration_StoreName_STATUS_CertificateAuthority, CertificateConfiguration_StoreName_STATUS_Root)) } diff --git a/v2/api/apimanagement/v1api20220801/service_types_gen.go b/v2/api/apimanagement/v1api20220801/service_types_gen.go index d82f8a129d0..405d734daf3 100644 --- a/v2/api/apimanagement/v1api20220801/service_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/service_types_gen.go @@ -405,9 +405,9 @@ type Service_Spec struct { // reference to a resources.azure.com/ResourceGroup resource Owner *genruntime.KnownResourceReference `group:"resources.azure.com" json:"owner,omitempty" kind:"ResourceGroup"` - // PublicIpAddressId: Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in - // the region. Supported only for Developer and Premium SKU being deployed in Virtual Network. - PublicIpAddressId *string `json:"publicIpAddressId,omitempty"` + // PublicIpAddressReference: Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed + // service in the region. Supported only for Developer and Premium SKU being deployed in Virtual Network. + PublicIpAddressReference *genruntime.ResourceReference `armReference:"PublicIpAddressId" json:"publicIpAddressReference,omitempty"` // PublicNetworkAccess: Whether or not public endpoint access is allowed for this API Management service. Value is // optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access @@ -486,7 +486,7 @@ func (service *Service_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolv service.HostnameConfigurations != nil || service.NatGatewayState != nil || service.NotificationSenderEmail != nil || - service.PublicIpAddressId != nil || + service.PublicIpAddressReference != nil || service.PublicNetworkAccess != nil || service.PublisherEmail != nil || service.PublisherName != nil || @@ -546,8 +546,12 @@ func (service *Service_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolv notificationSenderEmail := *service.NotificationSenderEmail result.Properties.NotificationSenderEmail = ¬ificationSenderEmail } - if service.PublicIpAddressId != nil { - publicIpAddressId := *service.PublicIpAddressId + if service.PublicIpAddressReference != nil { + publicIpAddressIdARMID, err := resolved.ResolvedReferences.Lookup(*service.PublicIpAddressReference) + if err != nil { + return nil, err + } + publicIpAddressId := publicIpAddressIdARMID result.Properties.PublicIpAddressId = &publicIpAddressId } if service.PublicNetworkAccess != nil { @@ -742,14 +746,7 @@ func (service *Service_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerRefe ARMID: owner.ARMID, } - // Set property "PublicIpAddressId": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.PublicIpAddressId != nil { - publicIpAddressId := *typedInput.Properties.PublicIpAddressId - service.PublicIpAddressId = &publicIpAddressId - } - } + // no assignment for property "PublicIpAddressReference" // Set property "PublicNetworkAccess": // copying flattened property: @@ -1018,8 +1015,13 @@ func (service *Service_Spec) AssignProperties_From_Service_Spec(source *v2022080 service.Owner = nil } - // PublicIpAddressId - service.PublicIpAddressId = genruntime.ClonePointerToString(source.PublicIpAddressId) + // PublicIpAddressReference + if source.PublicIpAddressReference != nil { + publicIpAddressReference := source.PublicIpAddressReference.Copy() + service.PublicIpAddressReference = &publicIpAddressReference + } else { + service.PublicIpAddressReference = nil + } // PublicNetworkAccess if source.PublicNetworkAccess != nil { @@ -1230,8 +1232,13 @@ func (service *Service_Spec) AssignProperties_To_Service_Spec(destination *v2022 destination.Owner = nil } - // PublicIpAddressId - destination.PublicIpAddressId = genruntime.ClonePointerToString(service.PublicIpAddressId) + // PublicIpAddressReference + if service.PublicIpAddressReference != nil { + publicIpAddressReference := service.PublicIpAddressReference.Copy() + destination.PublicIpAddressReference = &publicIpAddressReference + } else { + destination.PublicIpAddressReference = nil + } // PublicNetworkAccess if service.PublicNetworkAccess != nil { @@ -1433,8 +1440,13 @@ func (service *Service_Spec) Initialize_From_Service_STATUS(source *Service_STAT service.NotificationSenderEmail = nil } - // PublicIpAddressId - service.PublicIpAddressId = genruntime.ClonePointerToString(source.PublicIpAddressId) + // PublicIpAddressReference + if source.PublicIpAddressId != nil { + publicIpAddressReference := genruntime.CreateResourceReferenceFromARMID(*source.PublicIpAddressId) + service.PublicIpAddressReference = &publicIpAddressReference + } else { + service.PublicIpAddressReference = nil + } // PublicNetworkAccess if source.PublicNetworkAccess != nil { @@ -4056,7 +4068,7 @@ type CertificateConfiguration struct { Certificate *CertificateInformation `json:"certificate,omitempty"` // CertificatePassword: Certificate Password. - CertificatePassword *string `json:"certificatePassword,omitempty"` + CertificatePassword *genruntime.SecretReference `json:"certificatePassword,omitempty"` // EncodedCertificate: Base64 Encoded certificate. EncodedCertificate *string `json:"encodedCertificate,omitempty"` @@ -4088,7 +4100,11 @@ func (configuration *CertificateConfiguration) ConvertToARM(resolved genruntime. // Set property "CertificatePassword": if configuration.CertificatePassword != nil { - certificatePassword := *configuration.CertificatePassword + certificatePasswordSecret, err := resolved.ResolvedSecrets.Lookup(*configuration.CertificatePassword) + if err != nil { + return nil, errors.Wrap(err, "looking up secret for property CertificatePassword") + } + certificatePassword := certificatePasswordSecret result.CertificatePassword = &certificatePassword } @@ -4129,11 +4145,7 @@ func (configuration *CertificateConfiguration) PopulateFromARM(owner genruntime. configuration.Certificate = &certificate } - // Set property "CertificatePassword": - if typedInput.CertificatePassword != nil { - certificatePassword := *typedInput.CertificatePassword - configuration.CertificatePassword = &certificatePassword - } + // no assignment for property "CertificatePassword" // Set property "EncodedCertificate": if typedInput.EncodedCertificate != nil { @@ -4167,7 +4179,12 @@ func (configuration *CertificateConfiguration) AssignProperties_From_Certificate } // CertificatePassword - configuration.CertificatePassword = genruntime.ClonePointerToString(source.CertificatePassword) + if source.CertificatePassword != nil { + certificatePassword := source.CertificatePassword.Copy() + configuration.CertificatePassword = &certificatePassword + } else { + configuration.CertificatePassword = nil + } // EncodedCertificate configuration.EncodedCertificate = genruntime.ClonePointerToString(source.EncodedCertificate) @@ -4202,7 +4219,12 @@ func (configuration *CertificateConfiguration) AssignProperties_To_CertificateCo } // CertificatePassword - destination.CertificatePassword = genruntime.ClonePointerToString(configuration.CertificatePassword) + if configuration.CertificatePassword != nil { + certificatePassword := configuration.CertificatePassword.Copy() + destination.CertificatePassword = &certificatePassword + } else { + destination.CertificatePassword = nil + } // EncodedCertificate destination.EncodedCertificate = genruntime.ClonePointerToString(configuration.EncodedCertificate) @@ -4241,9 +4263,6 @@ func (configuration *CertificateConfiguration) Initialize_From_CertificateConfig configuration.Certificate = nil } - // CertificatePassword - configuration.CertificatePassword = genruntime.ClonePointerToString(source.CertificatePassword) - // EncodedCertificate configuration.EncodedCertificate = genruntime.ClonePointerToString(source.EncodedCertificate) @@ -4264,9 +4283,6 @@ type CertificateConfiguration_STATUS struct { // Certificate: Certificate information. Certificate *CertificateInformation_STATUS `json:"certificate,omitempty"` - // CertificatePassword: Certificate Password. - CertificatePassword *string `json:"certificatePassword,omitempty"` - // EncodedCertificate: Base64 Encoded certificate. EncodedCertificate *string `json:"encodedCertificate,omitempty"` @@ -4300,12 +4316,6 @@ func (configuration *CertificateConfiguration_STATUS) PopulateFromARM(owner genr configuration.Certificate = &certificate } - // Set property "CertificatePassword": - if typedInput.CertificatePassword != nil { - certificatePassword := *typedInput.CertificatePassword - configuration.CertificatePassword = &certificatePassword - } - // Set property "EncodedCertificate": if typedInput.EncodedCertificate != nil { encodedCertificate := *typedInput.EncodedCertificate @@ -4337,9 +4347,6 @@ func (configuration *CertificateConfiguration_STATUS) AssignProperties_From_Cert configuration.Certificate = nil } - // CertificatePassword - configuration.CertificatePassword = genruntime.ClonePointerToString(source.CertificatePassword) - // EncodedCertificate configuration.EncodedCertificate = genruntime.ClonePointerToString(source.EncodedCertificate) @@ -4372,9 +4379,6 @@ func (configuration *CertificateConfiguration_STATUS) AssignProperties_To_Certif destination.Certificate = nil } - // CertificatePassword - destination.CertificatePassword = genruntime.ClonePointerToString(configuration.CertificatePassword) - // EncodedCertificate destination.EncodedCertificate = genruntime.ClonePointerToString(configuration.EncodedCertificate) diff --git a/v2/api/apimanagement/v1api20220801/service_types_gen_test.go b/v2/api/apimanagement/v1api20220801/service_types_gen_test.go index ac48c56e701..879c4b0e138 100644 --- a/v2/api/apimanagement/v1api20220801/service_types_gen_test.go +++ b/v2/api/apimanagement/v1api20220801/service_types_gen_test.go @@ -279,7 +279,6 @@ func AddIndependentPropertyGeneratorsForService_Spec(gens map[string]gopter.Gen) gens["Location"] = gen.PtrOf(gen.AlphaString()) gens["NatGatewayState"] = gen.PtrOf(gen.OneConstOf(ApiManagementServiceProperties_NatGatewayState_Disabled, ApiManagementServiceProperties_NatGatewayState_Enabled)) gens["NotificationSenderEmail"] = gen.PtrOf(gen.AlphaString()) - gens["PublicIpAddressId"] = gen.PtrOf(gen.AlphaString()) gens["PublicNetworkAccess"] = gen.PtrOf(gen.OneConstOf(ApiManagementServiceProperties_PublicNetworkAccess_Disabled, ApiManagementServiceProperties_PublicNetworkAccess_Enabled)) gens["PublisherEmail"] = gen.PtrOf(gen.AlphaString()) gens["PublisherName"] = gen.PtrOf(gen.AlphaString()) @@ -1488,7 +1487,6 @@ func CertificateConfigurationGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForCertificateConfiguration is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForCertificateConfiguration(gens map[string]gopter.Gen) { - gens["CertificatePassword"] = gen.PtrOf(gen.AlphaString()) gens["EncodedCertificate"] = gen.PtrOf(gen.AlphaString()) gens["StoreName"] = gen.PtrOf(gen.OneConstOf(CertificateConfiguration_StoreName_CertificateAuthority, CertificateConfiguration_StoreName_Root)) } @@ -1607,7 +1605,6 @@ func CertificateConfiguration_STATUSGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForCertificateConfiguration_STATUS is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForCertificateConfiguration_STATUS(gens map[string]gopter.Gen) { - gens["CertificatePassword"] = gen.PtrOf(gen.AlphaString()) gens["EncodedCertificate"] = gen.PtrOf(gen.AlphaString()) gens["StoreName"] = gen.PtrOf(gen.OneConstOf(CertificateConfiguration_StoreName_STATUS_CertificateAuthority, CertificateConfiguration_StoreName_STATUS_Root)) } diff --git a/v2/api/apimanagement/v1api20220801/structure.txt b/v2/api/apimanagement/v1api20220801/structure.txt index a615ca0df18..ae33b195c1e 100644 --- a/v2/api/apimanagement/v1api20220801/structure.txt +++ b/v2/api/apimanagement/v1api20220801/structure.txt @@ -38,7 +38,7 @@ github.com/Azure/azure-service-operator/v2/api/apimanagement/v1api20220801 │ │ │ │ ├── SubjectFromConfig: *genruntime.ConfigMapReference │ │ │ │ ├── Thumbprint: *string │ │ │ │ └── ThumbprintFromConfig: *genruntime.ConfigMapReference -│ │ │ ├── CertificatePassword: *string +│ │ │ ├── CertificatePassword: *genruntime.SecretReference │ │ │ ├── EncodedCertificate: *string │ │ │ └── StoreName: *Enum (2 values) │ │ │ ├── "CertificateAuthority" @@ -92,7 +92,7 @@ github.com/Azure/azure-service-operator/v2/api/apimanagement/v1api20220801 │ │ ├── NotificationSenderEmail: Validated<*string> (1 rule) │ │ │ └── Rule 0: MaxLength: 100 │ │ ├── Owner: *genruntime.KnownResourceReference -│ │ ├── PublicIpAddressId: *string +│ │ ├── PublicIpAddressReference: *genruntime.ResourceReference │ │ ├── PublicNetworkAccess: *Enum (2 values) │ │ │ ├── "Disabled" │ │ │ └── "Enabled" @@ -151,12 +151,11 @@ github.com/Azure/azure-service-operator/v2/api/apimanagement/v1api20220801 │ │ └── Zones: string[] │ ├── ApiVersionConstraint: *Object (1 property) │ │ └── MinApiVersion: *string -│ ├── Certificates: Object (4 properties)[] +│ ├── Certificates: Object (3 properties)[] │ │ ├── Certificate: *Object (3 properties) │ │ │ ├── Expiry: *string │ │ │ ├── Subject: *string │ │ │ └── Thumbprint: *string -│ │ ├── CertificatePassword: *string │ │ ├── EncodedCertificate: *string │ │ └── StoreName: *Enum (2 values) │ │ ├── "CertificateAuthority" @@ -333,12 +332,11 @@ github.com/Azure/azure-service-operator/v2/api/apimanagement/v1api20220801 │ │ │ └── Zones: string[] │ │ ├── ApiVersionConstraint: *Object (1 property) │ │ │ └── MinApiVersion: *string -│ │ ├── Certificates: Object (4 properties)[] +│ │ ├── Certificates: Object (3 properties)[] │ │ │ ├── Certificate: *Object (3 properties) │ │ │ │ ├── Expiry: *string │ │ │ │ ├── Subject: *string │ │ │ │ └── Thumbprint: *string -│ │ │ ├── CertificatePassword: *string │ │ │ ├── EncodedCertificate: *string │ │ │ └── StoreName: *Enum (2 values) │ │ │ ├── "CertificateAuthority" diff --git a/v2/api/apimanagement/v1api20220801/zz_generated.deepcopy.go b/v2/api/apimanagement/v1api20220801/zz_generated.deepcopy.go index 8ea2a77805d..ff99ed45f21 100644 --- a/v2/api/apimanagement/v1api20220801/zz_generated.deepcopy.go +++ b/v2/api/apimanagement/v1api20220801/zz_generated.deepcopy.go @@ -899,7 +899,7 @@ func (in *CertificateConfiguration) DeepCopyInto(out *CertificateConfiguration) } if in.CertificatePassword != nil { in, out := &in.CertificatePassword, &out.CertificatePassword - *out = new(string) + *out = new(genruntime.SecretReference) **out = **in } if in.EncodedCertificate != nil { @@ -967,11 +967,6 @@ func (in *CertificateConfiguration_STATUS) DeepCopyInto(out *CertificateConfigur *out = new(CertificateInformation_STATUS) (*in).DeepCopyInto(*out) } - if in.CertificatePassword != nil { - in, out := &in.CertificatePassword, &out.CertificatePassword - *out = new(string) - **out = **in - } if in.EncodedCertificate != nil { in, out := &in.EncodedCertificate, &out.EncodedCertificate *out = new(string) @@ -1002,11 +997,6 @@ func (in *CertificateConfiguration_STATUS_ARM) DeepCopyInto(out *CertificateConf *out = new(CertificateInformation_STATUS_ARM) (*in).DeepCopyInto(*out) } - if in.CertificatePassword != nil { - in, out := &in.CertificatePassword, &out.CertificatePassword - *out = new(string) - **out = **in - } if in.EncodedCertificate != nil { in, out := &in.EncodedCertificate, &out.EncodedCertificate *out = new(string) diff --git a/v2/api/apimanagement/v1api20220801storage/service_types_gen.go b/v2/api/apimanagement/v1api20220801storage/service_types_gen.go index c7ecef0064b..2c8bc5605dd 100644 --- a/v2/api/apimanagement/v1api20220801storage/service_types_gen.go +++ b/v2/api/apimanagement/v1api20220801storage/service_types_gen.go @@ -161,9 +161,12 @@ type Service_Spec struct { // Owner: The owner of the resource. The owner controls where the resource goes when it is deployed. The owner also // controls the resources lifecycle. When the owner is deleted the resource will also be deleted. Owner is expected to be a // reference to a resources.azure.com/ResourceGroup resource - Owner *genruntime.KnownResourceReference `group:"resources.azure.com" json:"owner,omitempty" kind:"ResourceGroup"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - PublicIpAddressId *string `json:"publicIpAddressId,omitempty"` + Owner *genruntime.KnownResourceReference `group:"resources.azure.com" json:"owner,omitempty" kind:"ResourceGroup"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + + // PublicIpAddressReference: Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed + // service in the region. Supported only for Developer and Premium SKU being deployed in Virtual Network. + PublicIpAddressReference *genruntime.ResourceReference `armReference:"PublicIpAddressId" json:"publicIpAddressReference,omitempty"` PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"` PublisherEmail *string `json:"publisherEmail,omitempty"` PublisherName *string `json:"publisherName,omitempty"` @@ -346,21 +349,20 @@ type ApiVersionConstraint_STATUS struct { // Storage version of v1api20220801.CertificateConfiguration // Certificate configuration which consist of non-trusted intermediates and root certificates. type CertificateConfiguration struct { - Certificate *CertificateInformation `json:"certificate,omitempty"` - CertificatePassword *string `json:"certificatePassword,omitempty"` - EncodedCertificate *string `json:"encodedCertificate,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - StoreName *string `json:"storeName,omitempty"` + Certificate *CertificateInformation `json:"certificate,omitempty"` + CertificatePassword *genruntime.SecretReference `json:"certificatePassword,omitempty"` + EncodedCertificate *string `json:"encodedCertificate,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + StoreName *string `json:"storeName,omitempty"` } // Storage version of v1api20220801.CertificateConfiguration_STATUS // Certificate configuration which consist of non-trusted intermediates and root certificates. type CertificateConfiguration_STATUS struct { - Certificate *CertificateInformation_STATUS `json:"certificate,omitempty"` - CertificatePassword *string `json:"certificatePassword,omitempty"` - EncodedCertificate *string `json:"encodedCertificate,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - StoreName *string `json:"storeName,omitempty"` + Certificate *CertificateInformation_STATUS `json:"certificate,omitempty"` + EncodedCertificate *string `json:"encodedCertificate,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + StoreName *string `json:"storeName,omitempty"` } // Storage version of v1api20220801.HostnameConfiguration diff --git a/v2/api/apimanagement/v1api20220801storage/service_types_gen_test.go b/v2/api/apimanagement/v1api20220801storage/service_types_gen_test.go index 7158c85a1e6..3829d4de9c7 100644 --- a/v2/api/apimanagement/v1api20220801storage/service_types_gen_test.go +++ b/v2/api/apimanagement/v1api20220801storage/service_types_gen_test.go @@ -152,7 +152,6 @@ func AddIndependentPropertyGeneratorsForService_Spec(gens map[string]gopter.Gen) gens["NatGatewayState"] = gen.PtrOf(gen.AlphaString()) gens["NotificationSenderEmail"] = gen.PtrOf(gen.AlphaString()) gens["OriginalVersion"] = gen.AlphaString() - gens["PublicIpAddressId"] = gen.PtrOf(gen.AlphaString()) gens["PublicNetworkAccess"] = gen.PtrOf(gen.AlphaString()) gens["PublisherEmail"] = gen.PtrOf(gen.AlphaString()) gens["PublisherName"] = gen.PtrOf(gen.AlphaString()) @@ -913,7 +912,6 @@ func CertificateConfigurationGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForCertificateConfiguration is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForCertificateConfiguration(gens map[string]gopter.Gen) { - gens["CertificatePassword"] = gen.PtrOf(gen.AlphaString()) gens["EncodedCertificate"] = gen.PtrOf(gen.AlphaString()) gens["StoreName"] = gen.PtrOf(gen.AlphaString()) } @@ -990,7 +988,6 @@ func CertificateConfiguration_STATUSGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForCertificateConfiguration_STATUS is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForCertificateConfiguration_STATUS(gens map[string]gopter.Gen) { - gens["CertificatePassword"] = gen.PtrOf(gen.AlphaString()) gens["EncodedCertificate"] = gen.PtrOf(gen.AlphaString()) gens["StoreName"] = gen.PtrOf(gen.AlphaString()) } diff --git a/v2/api/apimanagement/v1api20220801storage/structure.txt b/v2/api/apimanagement/v1api20220801storage/structure.txt index 27729ad2a6c..2720b8e7627 100644 --- a/v2/api/apimanagement/v1api20220801storage/structure.txt +++ b/v2/api/apimanagement/v1api20220801storage/structure.txt @@ -35,7 +35,7 @@ github.com/Azure/azure-service-operator/v2/api/apimanagement/v1api20220801storag │ │ │ ├── SubjectFromConfig: *genruntime.ConfigMapReference │ │ │ ├── Thumbprint: *string │ │ │ └── ThumbprintFromConfig: *genruntime.ConfigMapReference - │ │ ├── CertificatePassword: *string + │ │ ├── CertificatePassword: *genruntime.SecretReference │ │ ├── EncodedCertificate: *string │ │ ├── PropertyBag: genruntime.PropertyBag │ │ └── StoreName: *string @@ -75,7 +75,7 @@ github.com/Azure/azure-service-operator/v2/api/apimanagement/v1api20220801storag │ ├── OriginalVersion: string │ ├── Owner: *genruntime.KnownResourceReference │ ├── PropertyBag: genruntime.PropertyBag - │ ├── PublicIpAddressId: *string + │ ├── PublicIpAddressReference: *genruntime.ResourceReference │ ├── PublicNetworkAccess: *string │ ├── PublisherEmail: *string │ ├── PublisherName: *string @@ -115,13 +115,12 @@ github.com/Azure/azure-service-operator/v2/api/apimanagement/v1api20220801storag ├── ApiVersionConstraint: *Object (2 properties) │ ├── MinApiVersion: *string │ └── PropertyBag: genruntime.PropertyBag - ├── Certificates: Object (5 properties)[] + ├── Certificates: Object (4 properties)[] │ ├── Certificate: *Object (4 properties) │ │ ├── Expiry: *string │ │ ├── PropertyBag: genruntime.PropertyBag │ │ ├── Subject: *string │ │ └── Thumbprint: *string - │ ├── CertificatePassword: *string │ ├── EncodedCertificate: *string │ ├── PropertyBag: genruntime.PropertyBag │ └── StoreName: *string diff --git a/v2/api/apimanagement/v1api20220801storage/zz_generated.deepcopy.go b/v2/api/apimanagement/v1api20220801storage/zz_generated.deepcopy.go index fe23df0ef8b..40a046155a8 100644 --- a/v2/api/apimanagement/v1api20220801storage/zz_generated.deepcopy.go +++ b/v2/api/apimanagement/v1api20220801storage/zz_generated.deepcopy.go @@ -387,7 +387,7 @@ func (in *CertificateConfiguration) DeepCopyInto(out *CertificateConfiguration) } if in.CertificatePassword != nil { in, out := &in.CertificatePassword, &out.CertificatePassword - *out = new(string) + *out = new(genruntime.SecretReference) **out = **in } if in.EncodedCertificate != nil { @@ -427,11 +427,6 @@ func (in *CertificateConfiguration_STATUS) DeepCopyInto(out *CertificateConfigur *out = new(CertificateInformation_STATUS) (*in).DeepCopyInto(*out) } - if in.CertificatePassword != nil { - in, out := &in.CertificatePassword, &out.CertificatePassword - *out = new(string) - **out = **in - } if in.EncodedCertificate != nil { in, out := &in.EncodedCertificate, &out.EncodedCertificate *out = new(string) diff --git a/v2/azure-arm.yaml b/v2/azure-arm.yaml index ffa0ff4f67c..b4cf01635b2 100644 --- a/v2/azure-arm.yaml +++ b/v2/azure-arm.yaml @@ -696,6 +696,9 @@ objectModelConfiguration: Service: $export: true $supportedFrom: v2.4.0 + ApiManagementServiceProperties: + PublicIpAddressId: + $armReference: true CertificateInformation: Expiry: $importConfigMapMode: optional @@ -703,6 +706,9 @@ objectModelConfiguration: $importConfigMapMode: optional Thumbprint: $importConfigMapMode: optional + CertificateConfiguration: + CertificatePassword: + $isSecret: true HostnameConfiguration: CertificatePassword: $isSecret: true diff --git a/v2/internal/controllers/controller_resources_gen.go b/v2/internal/controllers/controller_resources_gen.go index ff7c2452eb8..12aa8a6af1f 100644 --- a/v2/internal/controllers/controller_resources_gen.go +++ b/v2/internal/controllers/controller_resources_gen.go @@ -235,8 +235,8 @@ func getKnownStorageTypes() []*registration.StorageType { Obj: new(apimanagement_v20220801s.Service), Indexes: []registration.Index{ { - Key: ".spec.hostnameConfigurations.certificatePassword", - Func: indexApimanagementServiceCertificatePassword, + Key: ".spec.certificates.certificatePassword", + Func: indexApimanagementServiceCertificatesCertificatePassword, }, { Key: ".spec.certificates.certificate.expiryFromConfig", @@ -250,6 +250,10 @@ func getKnownStorageTypes() []*registration.StorageType { Key: ".spec.certificates.certificate.thumbprintFromConfig", Func: indexApimanagementServiceCertificatesThumbprintFromConfig, }, + { + Key: ".spec.hostnameConfigurations.certificatePassword", + Func: indexApimanagementServiceHostnameConfigurationsCertificatePassword, + }, { Key: ".spec.hostnameConfigurations.certificate.expiryFromConfig", Func: indexApimanagementServiceHostnameConfigurationsExpiryFromConfig, @@ -270,7 +274,7 @@ func getKnownStorageTypes() []*registration.StorageType { Watches: []registration.Watch{ { Type: &v1.Secret{}, - MakeEventHandler: watchSecretsFactory([]string{".spec.hostnameConfigurations.certificatePassword"}, &apimanagement_v20220801s.ServiceList{}), + MakeEventHandler: watchSecretsFactory([]string{".spec.certificates.certificatePassword", ".spec.hostnameConfigurations.certificatePassword"}, &apimanagement_v20220801s.ServiceList{}), }, { Type: &v1.ConfigMap{}, @@ -2003,18 +2007,18 @@ func getResourceExtensions() []genruntime.ResourceExtension { return result } -// indexApimanagementServiceCertificatePassword an index function for apimanagement_v20220801s.Service .spec.hostnameConfigurations.certificatePassword -func indexApimanagementServiceCertificatePassword(rawObj client.Object) []string { +// indexApimanagementServiceCertificatesCertificatePassword an index function for apimanagement_v20220801s.Service .spec.certificates.certificatePassword +func indexApimanagementServiceCertificatesCertificatePassword(rawObj client.Object) []string { obj, ok := rawObj.(*apimanagement_v20220801s.Service) if !ok { return nil } var result []string - for _, hostnameConfigurationItem := range obj.Spec.HostnameConfigurations { - if hostnameConfigurationItem.CertificatePassword == nil { + for _, certificateItem := range obj.Spec.Certificates { + if certificateItem.CertificatePassword == nil { continue } - result = append(result, hostnameConfigurationItem.CertificatePassword.Index()...) + result = append(result, certificateItem.CertificatePassword.Index()...) } return result } @@ -2076,6 +2080,22 @@ func indexApimanagementServiceCertificatesThumbprintFromConfig(rawObj client.Obj return result } +// indexApimanagementServiceHostnameConfigurationsCertificatePassword an index function for apimanagement_v20220801s.Service .spec.hostnameConfigurations.certificatePassword +func indexApimanagementServiceHostnameConfigurationsCertificatePassword(rawObj client.Object) []string { + obj, ok := rawObj.(*apimanagement_v20220801s.Service) + if !ok { + return nil + } + var result []string + for _, hostnameConfigurationItem := range obj.Spec.HostnameConfigurations { + if hostnameConfigurationItem.CertificatePassword == nil { + continue + } + result = append(result, hostnameConfigurationItem.CertificatePassword.Index()...) + } + return result +} + // indexApimanagementServiceHostnameConfigurationsExpiryFromConfig an index function for apimanagement_v20220801s.Service .spec.hostnameConfigurations.certificate.expiryFromConfig func indexApimanagementServiceHostnameConfigurationsExpiryFromConfig(rawObj client.Object) []string { obj, ok := rawObj.(*apimanagement_v20220801s.Service)