diff --git a/docs/hugo/content/reference/_index.md b/docs/hugo/content/reference/_index.md index 6163b904d3d..b9f26bf7858 100644 --- a/docs/hugo/content/reference/_index.md +++ b/docs/hugo/content/reference/_index.md @@ -22,18 +22,18 @@ To install the CRDs for these resources, your ASO configuration must include `ap Development of these new resources is complete and they will be available in the next release of ASO. -| Resource | ARM Version | CRD Version | Supported From | Sample | -|--------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|----------------------|----------------|------------------------------------------------------------------------------------------------------------------------------------------| -| [Api](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Api) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20220801/v1api20220801_api.yaml) | -| [Backend](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Backend) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20220801/v1api20220801_backend.yaml) | -| [NamedValue](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.NamedValue) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20220801/v1api20220801_namedvalue.yaml) | -| [Policy](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Policy) | 2022-08-01 | v1api20220801 | v2.4.0 | - | -| [PolicyFragment](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.PolicyFragment) | 2022-08-01 | v1api20220801 | v2.4.0 | - | -| [Product](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Product) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20220801/v1api20220801_product.yaml) | -| Service | 2023-03-01-preview | v1api20230301preview | v2.4.0 | - | -| [Service](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Service) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20220801/v1api20220801_service.yaml) | -| [Subscription](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Subscription) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20220801/v1api20220801_subscription.yaml) | -| [VersionSet](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.VersionSet) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20220801/v1api20220801_versionset.yaml) | +| Resource | ARM Version | CRD Version | Supported From | Sample | +|--------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|----------------------|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------| +| [Api](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Api) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20230301preview/v1api20220801_api.yaml) | +| [Backend](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Backend) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20230301preview/v1api20220801_backend.yaml) | +| [NamedValue](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.NamedValue) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20220801/v1api20220801_namedvalue.yaml) | +| [Policy](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Policy) | 2022-08-01 | v1api20220801 | v2.4.0 | - | +| [PolicyFragment](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.PolicyFragment) | 2022-08-01 | v1api20220801 | v2.4.0 | - | +| [Product](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Product) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20230301preview/v1api20220801_product.yaml) | +| Service | 2023-03-01-preview | v1api20230301preview | v2.4.0 | - | +| [Service](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Service) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20230301preview/v1api20220801_service.yaml) | +| [Subscription](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Subscription) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20230301preview/v1api20220801_subscription.yaml) | +| [VersionSet](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.VersionSet) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20230301preview/v1api20220801_versionset.yaml) | ## AppConfiguration diff --git a/docs/hugo/content/reference/apimanagement/_index.md b/docs/hugo/content/reference/apimanagement/_index.md index d11ea65fbb7..528291c05a5 100644 --- a/docs/hugo/content/reference/apimanagement/_index.md +++ b/docs/hugo/content/reference/apimanagement/_index.md @@ -9,16 +9,16 @@ To install the CRDs for these resources, your ASO configuration must include `ap Development of these new resources is complete and they will be available in the next release of ASO. -| Resource | ARM Version | CRD Version | Supported From | Sample | -|--------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|----------------------|----------------|------------------------------------------------------------------------------------------------------------------------------------------| -| [Api](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Api) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20220801/v1api20220801_api.yaml) | -| [Backend](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Backend) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20220801/v1api20220801_backend.yaml) | -| [NamedValue](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.NamedValue) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20220801/v1api20220801_namedvalue.yaml) | -| [Policy](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Policy) | 2022-08-01 | v1api20220801 | v2.4.0 | - | -| [PolicyFragment](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.PolicyFragment) | 2022-08-01 | v1api20220801 | v2.4.0 | - | -| [Product](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Product) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20220801/v1api20220801_product.yaml) | -| Service | 2023-03-01-preview | v1api20230301preview | v2.4.0 | - | -| [Service](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Service) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20220801/v1api20220801_service.yaml) | -| [Subscription](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Subscription) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20220801/v1api20220801_subscription.yaml) | -| [VersionSet](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.VersionSet) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20220801/v1api20220801_versionset.yaml) | +| Resource | ARM Version | CRD Version | Supported From | Sample | +|--------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|----------------------|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------| +| [Api](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Api) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20230301preview/v1api20220801_api.yaml) | +| [Backend](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Backend) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20230301preview/v1api20220801_backend.yaml) | +| [NamedValue](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.NamedValue) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20220801/v1api20220801_namedvalue.yaml) | +| [Policy](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Policy) | 2022-08-01 | v1api20220801 | v2.4.0 | - | +| [PolicyFragment](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.PolicyFragment) | 2022-08-01 | v1api20220801 | v2.4.0 | - | +| [Product](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Product) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20230301preview/v1api20220801_product.yaml) | +| Service | 2023-03-01-preview | v1api20230301preview | v2.4.0 | - | +| [Service](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Service) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20230301preview/v1api20220801_service.yaml) | +| [Subscription](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.Subscription) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20230301preview/v1api20220801_subscription.yaml) | +| [VersionSet](https://azure.github.io/azure-service-operator/reference/apimanagement/v1api20220801/#apimanagement.azure.com/v1api20220801.VersionSet) | 2022-08-01 | v1api20220801 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/apimanagement/v1api20230301preview/v1api20220801_versionset.yaml) | diff --git a/v2/api/apimanagement/v1api20220801/service_subscription_spec_arm_types_gen.go b/v2/api/apimanagement/v1api20220801/service_subscription_spec_arm_types_gen.go index 492a97de0a0..a0347b21516 100644 --- a/v2/api/apimanagement/v1api20220801/service_subscription_spec_arm_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/service_subscription_spec_arm_types_gen.go @@ -36,18 +36,16 @@ type SubscriptionCreateParameterProperties_ARM struct { // DisplayName: Subscription name. DisplayName *string `json:"displayName,omitempty"` - - // OwnerId: User (user id path) for whom subscription is being created in form /users/{userId} - OwnerId *string `json:"ownerId,omitempty"` + OwnerId *string `json:"ownerId,omitempty"` // PrimaryKey: Primary subscription key. If not specified during request key will be generated automatically. - PrimaryKey *string `json:"primaryKey,omitempty" optionalConfigMapPair:"PrimaryKey"` + PrimaryKey *string `json:"primaryKey,omitempty"` // Scope: Scope like /products/{productId} or /apis or /apis/{apiId}. Scope *string `json:"scope,omitempty"` // SecondaryKey: Secondary subscription key. If not specified during request key will be generated automatically. - SecondaryKey *string `json:"secondaryKey,omitempty" optionalConfigMapPair:"SecondaryKey"` + SecondaryKey *string `json:"secondaryKey,omitempty"` // State: Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible // states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber diff --git a/v2/api/apimanagement/v1api20220801/structure.txt b/v2/api/apimanagement/v1api20220801/structure.txt index 23a086d566d..9b2356e2bc1 100644 --- a/v2/api/apimanagement/v1api20220801/structure.txt +++ b/v2/api/apimanagement/v1api20220801/structure.txt @@ -1301,7 +1301,7 @@ github.com/Azure/azure-service-operator/v2/api/apimanagement/v1api20220801 │ └── "suspended" ├── Subscription: Resource │ ├── Owner: Service -│ ├── Spec: Object (12 properties) +│ ├── Spec: Object (9 properties) │ │ ├── AllowTracing: *bool │ │ ├── AzureName: Validated (2 rules) │ │ │ ├── Rule 0: MaxLength: 256 @@ -1309,21 +1309,11 @@ github.com/Azure/azure-service-operator/v2/api/apimanagement/v1api20220801 │ │ ├── DisplayName: Validated<*string> (2 rules) │ │ │ ├── Rule 0: MaxLength: 100 │ │ │ └── Rule 1: MinLength: 1 -│ │ ├── OperatorSpec: *Object (1 property) -│ │ │ └── Secrets: *Object (2 properties) -│ │ │ ├── PrimaryKey: *genruntime.SecretDestination -│ │ │ └── SecondaryKey: *genruntime.SecretDestination │ │ ├── Owner: *genruntime.KnownResourceReference -│ │ ├── OwnerId: *string -│ │ ├── PrimaryKey: Validated<*string> (2 rules) -│ │ │ ├── Rule 0: MaxLength: 256 -│ │ │ └── Rule 1: MinLength: 1 -│ │ ├── PrimaryKeyFromConfig: *genruntime.ConfigMapReference +│ │ ├── OwnerReference: *genruntime.ResourceReference +│ │ ├── PrimaryKey: *genruntime.SecretReference │ │ ├── Scope: *string -│ │ ├── SecondaryKey: Validated<*string> (2 rules) -│ │ │ ├── Rule 0: MaxLength: 256 -│ │ │ └── Rule 1: MinLength: 1 -│ │ ├── SecondaryKeyFromConfig: *genruntime.ConfigMapReference +│ │ ├── SecondaryKey: *genruntime.SecretReference │ │ └── State: *Enum (6 values) │ │ ├── "active" │ │ ├── "cancelled" diff --git a/v2/api/apimanagement/v1api20220801/subscription_types_gen.go b/v2/api/apimanagement/v1api20220801/subscription_types_gen.go index ee9e1aac658..7b30c5ad955 100644 --- a/v2/api/apimanagement/v1api20220801/subscription_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/subscription_types_gen.go @@ -199,7 +199,7 @@ func (subscription *Subscription) ValidateUpdate(old runtime.Object) (admission. // createValidations validates the creation of the resource func (subscription *Subscription) createValidations() []func() (admission.Warnings, error) { - return []func() (admission.Warnings, error){subscription.validateResourceReferences, subscription.validateOwnerReference, subscription.validateSecretDestinations, subscription.validateOptionalConfigMapReferences} + return []func() (admission.Warnings, error){subscription.validateResourceReferences, subscription.validateOwnerReference} } // deleteValidations validates the deletion of the resource @@ -217,24 +217,9 @@ func (subscription *Subscription) updateValidations() []func(old runtime.Object) func(old runtime.Object) (admission.Warnings, error) { return subscription.validateOwnerReference() }, - func(old runtime.Object) (admission.Warnings, error) { - return subscription.validateSecretDestinations() - }, - func(old runtime.Object) (admission.Warnings, error) { - return subscription.validateOptionalConfigMapReferences() - }, } } -// validateOptionalConfigMapReferences validates all optional configmap reference pairs to ensure that at most 1 is set -func (subscription *Subscription) validateOptionalConfigMapReferences() (admission.Warnings, error) { - refs, err := reflecthelpers.FindOptionalConfigMapReferences(&subscription.Spec) - if err != nil { - return nil, err - } - return genruntime.ValidateOptionalConfigMapReferences(refs) -} - // validateOwnerReference validates the owner field func (subscription *Subscription) validateOwnerReference() (admission.Warnings, error) { return genruntime.ValidateOwner(subscription) @@ -249,21 +234,6 @@ func (subscription *Subscription) validateResourceReferences() (admission.Warnin return genruntime.ValidateResourceReferences(refs) } -// validateSecretDestinations validates there are no colliding genruntime.SecretDestination's -func (subscription *Subscription) validateSecretDestinations() (admission.Warnings, error) { - if subscription.Spec.OperatorSpec == nil { - return nil, nil - } - if subscription.Spec.OperatorSpec.Secrets == nil { - return nil, nil - } - toValidate := []*genruntime.SecretDestination{ - subscription.Spec.OperatorSpec.Secrets.PrimaryKey, - subscription.Spec.OperatorSpec.Secrets.SecondaryKey, - } - return genruntime.ValidateSecretDestinations(toValidate) -} - // validateWriteOnceProperties validates all WriteOnce properties func (subscription *Subscription) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { oldObj, ok := old.(*Subscription) @@ -361,38 +331,24 @@ type Service_Subscription_Spec struct { // DisplayName: Subscription name. DisplayName *string `json:"displayName,omitempty"` - // OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not - // passed directly to Azure - OperatorSpec *SubscriptionOperatorSpec `json:"operatorSpec,omitempty"` - // +kubebuilder:validation:Required // 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 apimanagement.azure.com/Service resource Owner *genruntime.KnownResourceReference `group:"apimanagement.azure.com" json:"owner,omitempty" kind:"Service"` - // OwnerId: User (user id path) for whom subscription is being created in form /users/{userId} - OwnerId *string `json:"ownerId,omitempty"` + // OwnerReference: User (user id path) for whom subscription is being created in form /users/{userId} + OwnerReference *genruntime.ResourceReference `armReference:"OwnerId" json:"ownerReference,omitempty"` - // +kubebuilder:validation:MaxLength=256 - // +kubebuilder:validation:MinLength=1 // PrimaryKey: Primary subscription key. If not specified during request key will be generated automatically. - PrimaryKey *string `json:"primaryKey,omitempty" optionalConfigMapPair:"PrimaryKey"` - - // PrimaryKeyFromConfig: Primary subscription key. If not specified during request key will be generated automatically. - PrimaryKeyFromConfig *genruntime.ConfigMapReference `json:"primaryKeyFromConfig,omitempty" optionalConfigMapPair:"PrimaryKey"` + PrimaryKey *genruntime.SecretReference `json:"primaryKey,omitempty"` // +kubebuilder:validation:Required // Scope: Scope like /products/{productId} or /apis or /apis/{apiId}. Scope *string `json:"scope,omitempty"` - // +kubebuilder:validation:MaxLength=256 - // +kubebuilder:validation:MinLength=1 // SecondaryKey: Secondary subscription key. If not specified during request key will be generated automatically. - SecondaryKey *string `json:"secondaryKey,omitempty" optionalConfigMapPair:"SecondaryKey"` - - // SecondaryKeyFromConfig: Secondary subscription key. If not specified during request key will be generated automatically. - SecondaryKeyFromConfig *genruntime.ConfigMapReference `json:"secondaryKeyFromConfig,omitempty" optionalConfigMapPair:"SecondaryKey"` + SecondaryKey *genruntime.SecretReference `json:"secondaryKey,omitempty"` // State: Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible // states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber @@ -418,12 +374,10 @@ func (subscription *Service_Subscription_Spec) ConvertToARM(resolved genruntime. // Set property "Properties": if subscription.AllowTracing != nil || subscription.DisplayName != nil || - subscription.OwnerId != nil || + subscription.OwnerReference != nil || subscription.PrimaryKey != nil || - subscription.PrimaryKeyFromConfig != nil || subscription.Scope != nil || subscription.SecondaryKey != nil || - subscription.SecondaryKeyFromConfig != nil || subscription.State != nil { result.Properties = &SubscriptionCreateParameterProperties_ARM{} } @@ -435,20 +389,20 @@ func (subscription *Service_Subscription_Spec) ConvertToARM(resolved genruntime. displayName := *subscription.DisplayName result.Properties.DisplayName = &displayName } - if subscription.OwnerId != nil { - ownerId := *subscription.OwnerId + if subscription.OwnerReference != nil { + ownerIdARMID, err := resolved.ResolvedReferences.Lookup(*subscription.OwnerReference) + if err != nil { + return nil, err + } + ownerId := ownerIdARMID result.Properties.OwnerId = &ownerId } if subscription.PrimaryKey != nil { - primaryKey := *subscription.PrimaryKey - result.Properties.PrimaryKey = &primaryKey - } - if subscription.PrimaryKeyFromConfig != nil { - primaryKeyValue, err := resolved.ResolvedConfigMaps.Lookup(*subscription.PrimaryKeyFromConfig) + primaryKeySecret, err := resolved.ResolvedSecrets.Lookup(*subscription.PrimaryKey) if err != nil { - return nil, errors.Wrap(err, "looking up configmap for property PrimaryKey") + return nil, errors.Wrap(err, "looking up secret for property PrimaryKey") } - primaryKey := primaryKeyValue + primaryKey := primaryKeySecret result.Properties.PrimaryKey = &primaryKey } if subscription.Scope != nil { @@ -456,15 +410,11 @@ func (subscription *Service_Subscription_Spec) ConvertToARM(resolved genruntime. result.Properties.Scope = &scope } if subscription.SecondaryKey != nil { - secondaryKey := *subscription.SecondaryKey - result.Properties.SecondaryKey = &secondaryKey - } - if subscription.SecondaryKeyFromConfig != nil { - secondaryKeyValue, err := resolved.ResolvedConfigMaps.Lookup(*subscription.SecondaryKeyFromConfig) + secondaryKeySecret, err := resolved.ResolvedSecrets.Lookup(*subscription.SecondaryKey) if err != nil { - return nil, errors.Wrap(err, "looking up configmap for property SecondaryKey") + return nil, errors.Wrap(err, "looking up secret for property SecondaryKey") } - secondaryKey := secondaryKeyValue + secondaryKey := secondaryKeySecret result.Properties.SecondaryKey = &secondaryKey } if subscription.State != nil { @@ -507,33 +457,15 @@ func (subscription *Service_Subscription_Spec) PopulateFromARM(owner genruntime. } } - // no assignment for property "OperatorSpec" - // Set property "Owner": subscription.Owner = &genruntime.KnownResourceReference{ Name: owner.Name, ARMID: owner.ARMID, } - // Set property "OwnerId": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.OwnerId != nil { - ownerId := *typedInput.Properties.OwnerId - subscription.OwnerId = &ownerId - } - } + // no assignment for property "OwnerReference" - // Set property "PrimaryKey": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.PrimaryKey != nil { - primaryKey := *typedInput.Properties.PrimaryKey - subscription.PrimaryKey = &primaryKey - } - } - - // no assignment for property "PrimaryKeyFromConfig" + // no assignment for property "PrimaryKey" // Set property "Scope": // copying flattened property: @@ -544,16 +476,7 @@ func (subscription *Service_Subscription_Spec) PopulateFromARM(owner genruntime. } } - // Set property "SecondaryKey": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.SecondaryKey != nil { - secondaryKey := *typedInput.Properties.SecondaryKey - subscription.SecondaryKey = &secondaryKey - } - } - - // no assignment for property "SecondaryKeyFromConfig" + // no assignment for property "SecondaryKey" // Set property "State": // copying flattened property: @@ -640,18 +563,6 @@ func (subscription *Service_Subscription_Spec) AssignProperties_From_Service_Sub subscription.DisplayName = nil } - // OperatorSpec - if source.OperatorSpec != nil { - var operatorSpec SubscriptionOperatorSpec - err := operatorSpec.AssignProperties_From_SubscriptionOperatorSpec(source.OperatorSpec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_SubscriptionOperatorSpec() to populate field OperatorSpec") - } - subscription.OperatorSpec = &operatorSpec - } else { - subscription.OperatorSpec = nil - } - // Owner if source.Owner != nil { owner := source.Owner.Copy() @@ -660,44 +571,33 @@ func (subscription *Service_Subscription_Spec) AssignProperties_From_Service_Sub subscription.Owner = nil } - // OwnerId - subscription.OwnerId = genruntime.ClonePointerToString(source.OwnerId) + // OwnerReference + if source.OwnerReference != nil { + ownerReference := source.OwnerReference.Copy() + subscription.OwnerReference = &ownerReference + } else { + subscription.OwnerReference = nil + } // PrimaryKey if source.PrimaryKey != nil { - primaryKey := *source.PrimaryKey + primaryKey := source.PrimaryKey.Copy() subscription.PrimaryKey = &primaryKey } else { subscription.PrimaryKey = nil } - // PrimaryKeyFromConfig - if source.PrimaryKeyFromConfig != nil { - primaryKeyFromConfig := source.PrimaryKeyFromConfig.Copy() - subscription.PrimaryKeyFromConfig = &primaryKeyFromConfig - } else { - subscription.PrimaryKeyFromConfig = nil - } - // Scope subscription.Scope = genruntime.ClonePointerToString(source.Scope) // SecondaryKey if source.SecondaryKey != nil { - secondaryKey := *source.SecondaryKey + secondaryKey := source.SecondaryKey.Copy() subscription.SecondaryKey = &secondaryKey } else { subscription.SecondaryKey = nil } - // SecondaryKeyFromConfig - if source.SecondaryKeyFromConfig != nil { - secondaryKeyFromConfig := source.SecondaryKeyFromConfig.Copy() - subscription.SecondaryKeyFromConfig = &secondaryKeyFromConfig - } else { - subscription.SecondaryKeyFromConfig = nil - } - // State if source.State != nil { state := SubscriptionCreateParameterProperties_State(*source.State) @@ -734,18 +634,6 @@ func (subscription *Service_Subscription_Spec) AssignProperties_To_Service_Subsc destination.DisplayName = nil } - // OperatorSpec - if subscription.OperatorSpec != nil { - var operatorSpec v20220801s.SubscriptionOperatorSpec - err := subscription.OperatorSpec.AssignProperties_To_SubscriptionOperatorSpec(&operatorSpec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_SubscriptionOperatorSpec() to populate field OperatorSpec") - } - destination.OperatorSpec = &operatorSpec - } else { - destination.OperatorSpec = nil - } - // OriginalVersion destination.OriginalVersion = subscription.OriginalVersion() @@ -757,44 +645,33 @@ func (subscription *Service_Subscription_Spec) AssignProperties_To_Service_Subsc destination.Owner = nil } - // OwnerId - destination.OwnerId = genruntime.ClonePointerToString(subscription.OwnerId) + // OwnerReference + if subscription.OwnerReference != nil { + ownerReference := subscription.OwnerReference.Copy() + destination.OwnerReference = &ownerReference + } else { + destination.OwnerReference = nil + } // PrimaryKey if subscription.PrimaryKey != nil { - primaryKey := *subscription.PrimaryKey + primaryKey := subscription.PrimaryKey.Copy() destination.PrimaryKey = &primaryKey } else { destination.PrimaryKey = nil } - // PrimaryKeyFromConfig - if subscription.PrimaryKeyFromConfig != nil { - primaryKeyFromConfig := subscription.PrimaryKeyFromConfig.Copy() - destination.PrimaryKeyFromConfig = &primaryKeyFromConfig - } else { - destination.PrimaryKeyFromConfig = nil - } - // Scope destination.Scope = genruntime.ClonePointerToString(subscription.Scope) // SecondaryKey if subscription.SecondaryKey != nil { - secondaryKey := *subscription.SecondaryKey + secondaryKey := subscription.SecondaryKey.Copy() destination.SecondaryKey = &secondaryKey } else { destination.SecondaryKey = nil } - // SecondaryKeyFromConfig - if subscription.SecondaryKeyFromConfig != nil { - secondaryKeyFromConfig := subscription.SecondaryKeyFromConfig.Copy() - destination.SecondaryKeyFromConfig = &secondaryKeyFromConfig - } else { - destination.SecondaryKeyFromConfig = nil - } - // State if subscription.State != nil { state := string(*subscription.State) @@ -833,8 +710,13 @@ func (subscription *Service_Subscription_Spec) Initialize_From_Service_Subscript subscription.DisplayName = nil } - // OwnerId - subscription.OwnerId = genruntime.ClonePointerToString(source.OwnerId) + // OwnerReference + if source.OwnerId != nil { + ownerReference := genruntime.CreateResourceReferenceFromARMID(*source.OwnerId) + subscription.OwnerReference = &ownerReference + } else { + subscription.OwnerReference = nil + } // Scope subscription.Scope = genruntime.ClonePointerToString(source.Scope) @@ -1242,124 +1124,6 @@ func (subscription *Service_Subscription_STATUS) AssignProperties_To_Service_Sub return nil } -// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure -type SubscriptionOperatorSpec struct { - // Secrets: configures where to place Azure generated secrets. - Secrets *SubscriptionOperatorSecrets `json:"secrets,omitempty"` -} - -// AssignProperties_From_SubscriptionOperatorSpec populates our SubscriptionOperatorSpec from the provided source SubscriptionOperatorSpec -func (operator *SubscriptionOperatorSpec) AssignProperties_From_SubscriptionOperatorSpec(source *v20220801s.SubscriptionOperatorSpec) error { - - // Secrets - if source.Secrets != nil { - var secret SubscriptionOperatorSecrets - err := secret.AssignProperties_From_SubscriptionOperatorSecrets(source.Secrets) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_SubscriptionOperatorSecrets() to populate field Secrets") - } - operator.Secrets = &secret - } else { - operator.Secrets = nil - } - - // No error - return nil -} - -// AssignProperties_To_SubscriptionOperatorSpec populates the provided destination SubscriptionOperatorSpec from our SubscriptionOperatorSpec -func (operator *SubscriptionOperatorSpec) AssignProperties_To_SubscriptionOperatorSpec(destination *v20220801s.SubscriptionOperatorSpec) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // Secrets - if operator.Secrets != nil { - var secret v20220801s.SubscriptionOperatorSecrets - err := operator.Secrets.AssignProperties_To_SubscriptionOperatorSecrets(&secret) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_SubscriptionOperatorSecrets() to populate field Secrets") - } - destination.Secrets = &secret - } else { - destination.Secrets = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -type SubscriptionOperatorSecrets struct { - // PrimaryKey: indicates where the PrimaryKey secret should be placed. If omitted, the secret will not be retrieved from - // Azure. - PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` - - // SecondaryKey: indicates where the SecondaryKey secret should be placed. If omitted, the secret will not be retrieved - // from Azure. - SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` -} - -// AssignProperties_From_SubscriptionOperatorSecrets populates our SubscriptionOperatorSecrets from the provided source SubscriptionOperatorSecrets -func (secrets *SubscriptionOperatorSecrets) AssignProperties_From_SubscriptionOperatorSecrets(source *v20220801s.SubscriptionOperatorSecrets) error { - - // PrimaryKey - if source.PrimaryKey != nil { - primaryKey := source.PrimaryKey.Copy() - secrets.PrimaryKey = &primaryKey - } else { - secrets.PrimaryKey = nil - } - - // SecondaryKey - if source.SecondaryKey != nil { - secondaryKey := source.SecondaryKey.Copy() - secrets.SecondaryKey = &secondaryKey - } else { - secrets.SecondaryKey = nil - } - - // No error - return nil -} - -// AssignProperties_To_SubscriptionOperatorSecrets populates the provided destination SubscriptionOperatorSecrets from our SubscriptionOperatorSecrets -func (secrets *SubscriptionOperatorSecrets) AssignProperties_To_SubscriptionOperatorSecrets(destination *v20220801s.SubscriptionOperatorSecrets) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // PrimaryKey - if secrets.PrimaryKey != nil { - primaryKey := secrets.PrimaryKey.Copy() - destination.PrimaryKey = &primaryKey - } else { - destination.PrimaryKey = nil - } - - // SecondaryKey - if secrets.SecondaryKey != nil { - secondaryKey := secrets.SecondaryKey.Copy() - destination.SecondaryKey = &secondaryKey - } else { - destination.SecondaryKey = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - func init() { SchemeBuilder.Register(&Subscription{}, &SubscriptionList{}) } diff --git a/v2/api/apimanagement/v1api20220801/subscription_types_gen_test.go b/v2/api/apimanagement/v1api20220801/subscription_types_gen_test.go index 72015a29ca5..8da04818780 100644 --- a/v2/api/apimanagement/v1api20220801/subscription_types_gen_test.go +++ b/v2/api/apimanagement/v1api20220801/subscription_types_gen_test.go @@ -250,9 +250,6 @@ func RunJSONSerializationTestForService_Subscription_Spec(subject Service_Subscr var service_Subscription_SpecGenerator gopter.Gen // Service_Subscription_SpecGenerator returns a generator of Service_Subscription_Spec instances for property testing. -// We first initialize service_Subscription_SpecGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. func Service_Subscription_SpecGenerator() gopter.Gen { if service_Subscription_SpecGenerator != nil { return service_Subscription_SpecGenerator @@ -262,12 +259,6 @@ func Service_Subscription_SpecGenerator() gopter.Gen { AddIndependentPropertyGeneratorsForService_Subscription_Spec(generators) service_Subscription_SpecGenerator = gen.Struct(reflect.TypeOf(Service_Subscription_Spec{}), generators) - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForService_Subscription_Spec(generators) - AddRelatedPropertyGeneratorsForService_Subscription_Spec(generators) - service_Subscription_SpecGenerator = gen.Struct(reflect.TypeOf(Service_Subscription_Spec{}), generators) - return service_Subscription_SpecGenerator } @@ -276,10 +267,7 @@ func AddIndependentPropertyGeneratorsForService_Subscription_Spec(gens map[strin gens["AllowTracing"] = gen.PtrOf(gen.Bool()) gens["AzureName"] = gen.AlphaString() gens["DisplayName"] = gen.PtrOf(gen.AlphaString()) - gens["OwnerId"] = gen.PtrOf(gen.AlphaString()) - gens["PrimaryKey"] = gen.PtrOf(gen.AlphaString()) gens["Scope"] = gen.PtrOf(gen.AlphaString()) - gens["SecondaryKey"] = gen.PtrOf(gen.AlphaString()) gens["State"] = gen.PtrOf(gen.OneConstOf( SubscriptionCreateParameterProperties_State_Active, SubscriptionCreateParameterProperties_State_Cancelled, @@ -289,11 +277,6 @@ func AddIndependentPropertyGeneratorsForService_Subscription_Spec(gens map[strin SubscriptionCreateParameterProperties_State_Suspended)) } -// AddRelatedPropertyGeneratorsForService_Subscription_Spec is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForService_Subscription_Spec(gens map[string]gopter.Gen) { - gens["OperatorSpec"] = gen.PtrOf(SubscriptionOperatorSpecGenerator()) -} - func Test_Service_Subscription_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -415,203 +398,3 @@ func AddIndependentPropertyGeneratorsForService_Subscription_STATUS(gens map[str gens["StateComment"] = gen.PtrOf(gen.AlphaString()) gens["Type"] = gen.PtrOf(gen.AlphaString()) } - -func Test_SubscriptionOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from SubscriptionOperatorSpec to SubscriptionOperatorSpec via AssignProperties_To_SubscriptionOperatorSpec & AssignProperties_From_SubscriptionOperatorSpec returns original", - prop.ForAll(RunPropertyAssignmentTestForSubscriptionOperatorSpec, SubscriptionOperatorSpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForSubscriptionOperatorSpec tests if a specific instance of SubscriptionOperatorSpec can be assigned to v1api20220801storage and back losslessly -func RunPropertyAssignmentTestForSubscriptionOperatorSpec(subject SubscriptionOperatorSpec) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20220801s.SubscriptionOperatorSpec - err := copied.AssignProperties_To_SubscriptionOperatorSpec(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual SubscriptionOperatorSpec - err = actual.AssignProperties_From_SubscriptionOperatorSpec(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_SubscriptionOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of SubscriptionOperatorSpec via JSON returns original", - prop.ForAll(RunJSONSerializationTestForSubscriptionOperatorSpec, SubscriptionOperatorSpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForSubscriptionOperatorSpec runs a test to see if a specific instance of SubscriptionOperatorSpec round trips to JSON and back losslessly -func RunJSONSerializationTestForSubscriptionOperatorSpec(subject SubscriptionOperatorSpec) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual SubscriptionOperatorSpec - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of SubscriptionOperatorSpec instances for property testing - lazily instantiated by -// SubscriptionOperatorSpecGenerator() -var subscriptionOperatorSpecGenerator gopter.Gen - -// SubscriptionOperatorSpecGenerator returns a generator of SubscriptionOperatorSpec instances for property testing. -func SubscriptionOperatorSpecGenerator() gopter.Gen { - if subscriptionOperatorSpecGenerator != nil { - return subscriptionOperatorSpecGenerator - } - - generators := make(map[string]gopter.Gen) - AddRelatedPropertyGeneratorsForSubscriptionOperatorSpec(generators) - subscriptionOperatorSpecGenerator = gen.Struct(reflect.TypeOf(SubscriptionOperatorSpec{}), generators) - - return subscriptionOperatorSpecGenerator -} - -// AddRelatedPropertyGeneratorsForSubscriptionOperatorSpec is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForSubscriptionOperatorSpec(gens map[string]gopter.Gen) { - gens["Secrets"] = gen.PtrOf(SubscriptionOperatorSecretsGenerator()) -} - -func Test_SubscriptionOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from SubscriptionOperatorSecrets to SubscriptionOperatorSecrets via AssignProperties_To_SubscriptionOperatorSecrets & AssignProperties_From_SubscriptionOperatorSecrets returns original", - prop.ForAll(RunPropertyAssignmentTestForSubscriptionOperatorSecrets, SubscriptionOperatorSecretsGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForSubscriptionOperatorSecrets tests if a specific instance of SubscriptionOperatorSecrets can be assigned to v1api20220801storage and back losslessly -func RunPropertyAssignmentTestForSubscriptionOperatorSecrets(subject SubscriptionOperatorSecrets) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20220801s.SubscriptionOperatorSecrets - err := copied.AssignProperties_To_SubscriptionOperatorSecrets(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual SubscriptionOperatorSecrets - err = actual.AssignProperties_From_SubscriptionOperatorSecrets(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_SubscriptionOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of SubscriptionOperatorSecrets via JSON returns original", - prop.ForAll(RunJSONSerializationTestForSubscriptionOperatorSecrets, SubscriptionOperatorSecretsGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForSubscriptionOperatorSecrets runs a test to see if a specific instance of SubscriptionOperatorSecrets round trips to JSON and back losslessly -func RunJSONSerializationTestForSubscriptionOperatorSecrets(subject SubscriptionOperatorSecrets) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual SubscriptionOperatorSecrets - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of SubscriptionOperatorSecrets instances for property testing - lazily instantiated by -// SubscriptionOperatorSecretsGenerator() -var subscriptionOperatorSecretsGenerator gopter.Gen - -// SubscriptionOperatorSecretsGenerator returns a generator of SubscriptionOperatorSecrets instances for property testing. -func SubscriptionOperatorSecretsGenerator() gopter.Gen { - if subscriptionOperatorSecretsGenerator != nil { - return subscriptionOperatorSecretsGenerator - } - - generators := make(map[string]gopter.Gen) - subscriptionOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(SubscriptionOperatorSecrets{}), generators) - - return subscriptionOperatorSecretsGenerator -} diff --git a/v2/api/apimanagement/v1api20220801/zz_generated.deepcopy.go b/v2/api/apimanagement/v1api20220801/zz_generated.deepcopy.go index 6460166a40f..38e3ecc1751 100644 --- a/v2/api/apimanagement/v1api20220801/zz_generated.deepcopy.go +++ b/v2/api/apimanagement/v1api20220801/zz_generated.deepcopy.go @@ -6531,29 +6531,19 @@ func (in *Service_Subscription_Spec) DeepCopyInto(out *Service_Subscription_Spec *out = new(string) **out = **in } - if in.OperatorSpec != nil { - in, out := &in.OperatorSpec, &out.OperatorSpec - *out = new(SubscriptionOperatorSpec) - (*in).DeepCopyInto(*out) - } if in.Owner != nil { in, out := &in.Owner, &out.Owner *out = new(genruntime.KnownResourceReference) **out = **in } - if in.OwnerId != nil { - in, out := &in.OwnerId, &out.OwnerId - *out = new(string) + if in.OwnerReference != nil { + in, out := &in.OwnerReference, &out.OwnerReference + *out = new(genruntime.ResourceReference) **out = **in } if in.PrimaryKey != nil { in, out := &in.PrimaryKey, &out.PrimaryKey - *out = new(string) - **out = **in - } - if in.PrimaryKeyFromConfig != nil { - in, out := &in.PrimaryKeyFromConfig, &out.PrimaryKeyFromConfig - *out = new(genruntime.ConfigMapReference) + *out = new(genruntime.SecretReference) **out = **in } if in.Scope != nil { @@ -6563,12 +6553,7 @@ func (in *Service_Subscription_Spec) DeepCopyInto(out *Service_Subscription_Spec } if in.SecondaryKey != nil { in, out := &in.SecondaryKey, &out.SecondaryKey - *out = new(string) - **out = **in - } - if in.SecondaryKeyFromConfig != nil { - in, out := &in.SecondaryKeyFromConfig, &out.SecondaryKeyFromConfig - *out = new(genruntime.ConfigMapReference) + *out = new(genruntime.SecretReference) **out = **in } if in.State != nil { @@ -6887,51 +6872,6 @@ func (in *SubscriptionList) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SubscriptionOperatorSecrets) DeepCopyInto(out *SubscriptionOperatorSecrets) { - *out = *in - if in.PrimaryKey != nil { - in, out := &in.PrimaryKey, &out.PrimaryKey - *out = new(genruntime.SecretDestination) - **out = **in - } - if in.SecondaryKey != nil { - in, out := &in.SecondaryKey, &out.SecondaryKey - *out = new(genruntime.SecretDestination) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionOperatorSecrets. -func (in *SubscriptionOperatorSecrets) DeepCopy() *SubscriptionOperatorSecrets { - if in == nil { - return nil - } - out := new(SubscriptionOperatorSecrets) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SubscriptionOperatorSpec) DeepCopyInto(out *SubscriptionOperatorSpec) { - *out = *in - if in.Secrets != nil { - in, out := &in.Secrets, &out.Secrets - *out = new(SubscriptionOperatorSecrets) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionOperatorSpec. -func (in *SubscriptionOperatorSpec) DeepCopy() *SubscriptionOperatorSpec { - if in == nil { - return nil - } - out := new(SubscriptionOperatorSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SystemData_STATUS) DeepCopyInto(out *SystemData_STATUS) { *out = *in diff --git a/v2/api/apimanagement/v1api20220801storage/structure.txt b/v2/api/apimanagement/v1api20220801storage/structure.txt index f2ae8ca8b91..f8e49660932 100644 --- a/v2/api/apimanagement/v1api20220801storage/structure.txt +++ b/v2/api/apimanagement/v1api20220801storage/structure.txt @@ -541,27 +541,19 @@ github.com/Azure/azure-service-operator/v2/api/apimanagement/v1api20220801storag │ └── Zones: string[] ├── Subscription: Resource │ ├── Owner: github.com/Azure/azure-service-operator/v2/api/apimanagement/v1api20220801.Service -│ ├── Spec: Object (14 properties) +│ ├── Spec: Object (11 properties) │ │ ├── AllowTracing: *bool │ │ ├── AzureName: Validated (2 rules) │ │ │ ├── Rule 0: MaxLength: 256 │ │ │ └── Rule 1: Pattern: "^[^*#&+:<>?]+$" │ │ ├── DisplayName: *string -│ │ ├── OperatorSpec: *Object (2 properties) -│ │ │ ├── PropertyBag: genruntime.PropertyBag -│ │ │ └── Secrets: *Object (3 properties) -│ │ │ ├── PrimaryKey: *genruntime.SecretDestination -│ │ │ ├── PropertyBag: genruntime.PropertyBag -│ │ │ └── SecondaryKey: *genruntime.SecretDestination │ │ ├── OriginalVersion: string │ │ ├── Owner: *genruntime.KnownResourceReference -│ │ ├── OwnerId: *string -│ │ ├── PrimaryKey: *string -│ │ ├── PrimaryKeyFromConfig: *genruntime.ConfigMapReference +│ │ ├── OwnerReference: *genruntime.ResourceReference +│ │ ├── PrimaryKey: *genruntime.SecretReference │ │ ├── PropertyBag: genruntime.PropertyBag │ │ ├── Scope: *string -│ │ ├── SecondaryKey: *string -│ │ ├── SecondaryKeyFromConfig: *genruntime.ConfigMapReference +│ │ ├── SecondaryKey: *genruntime.SecretReference │ │ └── State: *string │ └── Status: Object (16 properties) │ ├── AllowTracing: *bool diff --git a/v2/api/apimanagement/v1api20220801storage/subscription_types_gen.go b/v2/api/apimanagement/v1api20220801storage/subscription_types_gen.go index 9f4d5d256e7..1cd67fef8a1 100644 --- a/v2/api/apimanagement/v1api20220801storage/subscription_types_gen.go +++ b/v2/api/apimanagement/v1api20220801storage/subscription_types_gen.go @@ -137,24 +137,23 @@ type Service_Subscription_Spec struct { // +kubebuilder:validation:Pattern="^[^*#&+:<>?]+$" // AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it // doesn't have to be. - AzureName string `json:"azureName,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - OperatorSpec *SubscriptionOperatorSpec `json:"operatorSpec,omitempty"` - OriginalVersion string `json:"originalVersion,omitempty"` + AzureName string `json:"azureName,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + OriginalVersion string `json:"originalVersion,omitempty"` // +kubebuilder:validation:Required // 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 apimanagement.azure.com/Service resource - Owner *genruntime.KnownResourceReference `group:"apimanagement.azure.com" json:"owner,omitempty" kind:"Service"` - OwnerId *string `json:"ownerId,omitempty"` - PrimaryKey *string `json:"primaryKey,omitempty" optionalConfigMapPair:"PrimaryKey"` - PrimaryKeyFromConfig *genruntime.ConfigMapReference `json:"primaryKeyFromConfig,omitempty" optionalConfigMapPair:"PrimaryKey"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Scope *string `json:"scope,omitempty"` - SecondaryKey *string `json:"secondaryKey,omitempty" optionalConfigMapPair:"SecondaryKey"` - SecondaryKeyFromConfig *genruntime.ConfigMapReference `json:"secondaryKeyFromConfig,omitempty" optionalConfigMapPair:"SecondaryKey"` - State *string `json:"state,omitempty"` + Owner *genruntime.KnownResourceReference `group:"apimanagement.azure.com" json:"owner,omitempty" kind:"Service"` + + // OwnerReference: User (user id path) for whom subscription is being created in form /users/{userId} + OwnerReference *genruntime.ResourceReference `armReference:"OwnerId" json:"ownerReference,omitempty"` + PrimaryKey *genruntime.SecretReference `json:"primaryKey,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Scope *string `json:"scope,omitempty"` + SecondaryKey *genruntime.SecretReference `json:"secondaryKey,omitempty"` + State *string `json:"state,omitempty"` } var _ genruntime.ConvertibleSpec = &Service_Subscription_Spec{} @@ -217,20 +216,6 @@ func (subscription *Service_Subscription_STATUS) ConvertStatusTo(destination gen return destination.ConvertStatusFrom(subscription) } -// Storage version of v1api20220801.SubscriptionOperatorSpec -// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure -type SubscriptionOperatorSpec struct { - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Secrets *SubscriptionOperatorSecrets `json:"secrets,omitempty"` -} - -// Storage version of v1api20220801.SubscriptionOperatorSecrets -type SubscriptionOperatorSecrets struct { - PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` -} - func init() { SchemeBuilder.Register(&Subscription{}, &SubscriptionList{}) } diff --git a/v2/api/apimanagement/v1api20220801storage/subscription_types_gen_test.go b/v2/api/apimanagement/v1api20220801storage/subscription_types_gen_test.go index f752d9db3b7..9d8cfd6c7ad 100644 --- a/v2/api/apimanagement/v1api20220801storage/subscription_types_gen_test.go +++ b/v2/api/apimanagement/v1api20220801storage/subscription_types_gen_test.go @@ -122,9 +122,6 @@ func RunJSONSerializationTestForService_Subscription_Spec(subject Service_Subscr var service_Subscription_SpecGenerator gopter.Gen // Service_Subscription_SpecGenerator returns a generator of Service_Subscription_Spec instances for property testing. -// We first initialize service_Subscription_SpecGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. func Service_Subscription_SpecGenerator() gopter.Gen { if service_Subscription_SpecGenerator != nil { return service_Subscription_SpecGenerator @@ -134,12 +131,6 @@ func Service_Subscription_SpecGenerator() gopter.Gen { AddIndependentPropertyGeneratorsForService_Subscription_Spec(generators) service_Subscription_SpecGenerator = gen.Struct(reflect.TypeOf(Service_Subscription_Spec{}), generators) - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForService_Subscription_Spec(generators) - AddRelatedPropertyGeneratorsForService_Subscription_Spec(generators) - service_Subscription_SpecGenerator = gen.Struct(reflect.TypeOf(Service_Subscription_Spec{}), generators) - return service_Subscription_SpecGenerator } @@ -149,18 +140,10 @@ func AddIndependentPropertyGeneratorsForService_Subscription_Spec(gens map[strin gens["AzureName"] = gen.AlphaString() gens["DisplayName"] = gen.PtrOf(gen.AlphaString()) gens["OriginalVersion"] = gen.AlphaString() - gens["OwnerId"] = gen.PtrOf(gen.AlphaString()) - gens["PrimaryKey"] = gen.PtrOf(gen.AlphaString()) gens["Scope"] = gen.PtrOf(gen.AlphaString()) - gens["SecondaryKey"] = gen.PtrOf(gen.AlphaString()) gens["State"] = gen.PtrOf(gen.AlphaString()) } -// AddRelatedPropertyGeneratorsForService_Subscription_Spec is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForService_Subscription_Spec(gens map[string]gopter.Gen) { - gens["OperatorSpec"] = gen.PtrOf(SubscriptionOperatorSpecGenerator()) -} - func Test_Service_Subscription_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -234,119 +217,3 @@ func AddIndependentPropertyGeneratorsForService_Subscription_STATUS(gens map[str gens["StateComment"] = gen.PtrOf(gen.AlphaString()) gens["Type"] = gen.PtrOf(gen.AlphaString()) } - -func Test_SubscriptionOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of SubscriptionOperatorSpec via JSON returns original", - prop.ForAll(RunJSONSerializationTestForSubscriptionOperatorSpec, SubscriptionOperatorSpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForSubscriptionOperatorSpec runs a test to see if a specific instance of SubscriptionOperatorSpec round trips to JSON and back losslessly -func RunJSONSerializationTestForSubscriptionOperatorSpec(subject SubscriptionOperatorSpec) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual SubscriptionOperatorSpec - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of SubscriptionOperatorSpec instances for property testing - lazily instantiated by -// SubscriptionOperatorSpecGenerator() -var subscriptionOperatorSpecGenerator gopter.Gen - -// SubscriptionOperatorSpecGenerator returns a generator of SubscriptionOperatorSpec instances for property testing. -func SubscriptionOperatorSpecGenerator() gopter.Gen { - if subscriptionOperatorSpecGenerator != nil { - return subscriptionOperatorSpecGenerator - } - - generators := make(map[string]gopter.Gen) - AddRelatedPropertyGeneratorsForSubscriptionOperatorSpec(generators) - subscriptionOperatorSpecGenerator = gen.Struct(reflect.TypeOf(SubscriptionOperatorSpec{}), generators) - - return subscriptionOperatorSpecGenerator -} - -// AddRelatedPropertyGeneratorsForSubscriptionOperatorSpec is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForSubscriptionOperatorSpec(gens map[string]gopter.Gen) { - gens["Secrets"] = gen.PtrOf(SubscriptionOperatorSecretsGenerator()) -} - -func Test_SubscriptionOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of SubscriptionOperatorSecrets via JSON returns original", - prop.ForAll(RunJSONSerializationTestForSubscriptionOperatorSecrets, SubscriptionOperatorSecretsGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForSubscriptionOperatorSecrets runs a test to see if a specific instance of SubscriptionOperatorSecrets round trips to JSON and back losslessly -func RunJSONSerializationTestForSubscriptionOperatorSecrets(subject SubscriptionOperatorSecrets) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual SubscriptionOperatorSecrets - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of SubscriptionOperatorSecrets instances for property testing - lazily instantiated by -// SubscriptionOperatorSecretsGenerator() -var subscriptionOperatorSecretsGenerator gopter.Gen - -// SubscriptionOperatorSecretsGenerator returns a generator of SubscriptionOperatorSecrets instances for property testing. -func SubscriptionOperatorSecretsGenerator() gopter.Gen { - if subscriptionOperatorSecretsGenerator != nil { - return subscriptionOperatorSecretsGenerator - } - - generators := make(map[string]gopter.Gen) - subscriptionOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(SubscriptionOperatorSecrets{}), generators) - - return subscriptionOperatorSecretsGenerator -} diff --git a/v2/api/apimanagement/v1api20220801storage/zz_generated.deepcopy.go b/v2/api/apimanagement/v1api20220801storage/zz_generated.deepcopy.go index 601382e8ace..911136d2142 100644 --- a/v2/api/apimanagement/v1api20220801storage/zz_generated.deepcopy.go +++ b/v2/api/apimanagement/v1api20220801storage/zz_generated.deepcopy.go @@ -3840,29 +3840,19 @@ func (in *Service_Subscription_Spec) DeepCopyInto(out *Service_Subscription_Spec *out = new(string) **out = **in } - if in.OperatorSpec != nil { - in, out := &in.OperatorSpec, &out.OperatorSpec - *out = new(SubscriptionOperatorSpec) - (*in).DeepCopyInto(*out) - } if in.Owner != nil { in, out := &in.Owner, &out.Owner *out = new(genruntime.KnownResourceReference) **out = **in } - if in.OwnerId != nil { - in, out := &in.OwnerId, &out.OwnerId - *out = new(string) + if in.OwnerReference != nil { + in, out := &in.OwnerReference, &out.OwnerReference + *out = new(genruntime.ResourceReference) **out = **in } if in.PrimaryKey != nil { in, out := &in.PrimaryKey, &out.PrimaryKey - *out = new(string) - **out = **in - } - if in.PrimaryKeyFromConfig != nil { - in, out := &in.PrimaryKeyFromConfig, &out.PrimaryKeyFromConfig - *out = new(genruntime.ConfigMapReference) + *out = new(genruntime.SecretReference) **out = **in } if in.PropertyBag != nil { @@ -3879,12 +3869,7 @@ func (in *Service_Subscription_Spec) DeepCopyInto(out *Service_Subscription_Spec } if in.SecondaryKey != nil { in, out := &in.SecondaryKey, &out.SecondaryKey - *out = new(string) - **out = **in - } - if in.SecondaryKeyFromConfig != nil { - in, out := &in.SecondaryKeyFromConfig, &out.SecondaryKeyFromConfig - *out = new(genruntime.ConfigMapReference) + *out = new(genruntime.SecretReference) **out = **in } if in.State != nil { @@ -4027,65 +4012,6 @@ func (in *SubscriptionList) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SubscriptionOperatorSecrets) DeepCopyInto(out *SubscriptionOperatorSecrets) { - *out = *in - if in.PrimaryKey != nil { - in, out := &in.PrimaryKey, &out.PrimaryKey - *out = new(genruntime.SecretDestination) - **out = **in - } - if in.PropertyBag != nil { - in, out := &in.PropertyBag, &out.PropertyBag - *out = make(genruntime.PropertyBag, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.SecondaryKey != nil { - in, out := &in.SecondaryKey, &out.SecondaryKey - *out = new(genruntime.SecretDestination) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionOperatorSecrets. -func (in *SubscriptionOperatorSecrets) DeepCopy() *SubscriptionOperatorSecrets { - if in == nil { - return nil - } - out := new(SubscriptionOperatorSecrets) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SubscriptionOperatorSpec) DeepCopyInto(out *SubscriptionOperatorSpec) { - *out = *in - if in.PropertyBag != nil { - in, out := &in.PropertyBag, &out.PropertyBag - *out = make(genruntime.PropertyBag, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Secrets != nil { - in, out := &in.Secrets, &out.Secrets - *out = new(SubscriptionOperatorSecrets) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionOperatorSpec. -func (in *SubscriptionOperatorSpec) DeepCopy() *SubscriptionOperatorSpec { - if in == nil { - return nil - } - out := new(SubscriptionOperatorSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SystemData_STATUS) DeepCopyInto(out *SystemData_STATUS) { *out = *in diff --git a/v2/azure-arm.yaml b/v2/azure-arm.yaml index 830739dce40..579f1f25521 100644 --- a/v2/azure-arm.yaml +++ b/v2/azure-arm.yaml @@ -760,14 +760,13 @@ objectModelConfiguration: Service_Subscription: $exportAs: Subscription $supportedFrom: v2.4.0 - $azureGeneratedSecrets: - - PrimaryKey - - SecondaryKey SubscriptionCreateParameterProperties: PrimaryKey: - $importConfigMapMode: optional + $isSecret: true SecondaryKey: - $importConfigMapMode: optional + $isSecret: true + OwnerId: + $armReference: true VirtualNetworkConfiguration: SubnetResourceId: $armReference: true diff --git a/v2/cmd/asoctl/go.mod b/v2/cmd/asoctl/go.mod index 62cc513979e..cb30250e821 100644 --- a/v2/cmd/asoctl/go.mod +++ b/v2/cmd/asoctl/go.mod @@ -7,7 +7,7 @@ replace github.com/Azure/azure-service-operator/v2 => ../../ replace github.com/Azure/azure-service-operator/v2/tools/generator => ../generator require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0-beta.3 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1 github.com/Azure/azure-service-operator/v2 v2.2.0 github.com/go-logr/logr v1.2.4 @@ -69,7 +69,6 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kylelemons/godebug v1.1.0 // indirect - github.com/leanovate/gopter v0.2.9 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect @@ -85,11 +84,11 @@ require ( github.com/prometheus/procfs v0.12.0 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/crypto v0.13.0 // indirect + golang.org/x/crypto v0.14.0 // indirect golang.org/x/net v0.15.0 // indirect golang.org/x/oauth2 v0.12.0 // indirect - golang.org/x/sys v0.12.0 // indirect - golang.org/x/term v0.12.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/term v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect diff --git a/v2/cmd/asoctl/go.sum b/v2/cmd/asoctl/go.sum index b5545aa1693..4fedb7e171c 100644 --- a/v2/cmd/asoctl/go.sum +++ b/v2/cmd/asoctl/go.sum @@ -1,5 +1,5 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0-beta.3 h1:XV/HZqgyUQQAc1/UwYXK/p9PyPuDrprwSXcKARy183U= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0-beta.3/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0 h1:9kDVnTz3vbfweTqAUmk/a/pH5pWFCHtvRpHYC0G/dcA= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0/go.mod h1:3Ug6Qzto9anB6mGlEdgYMDF5zHQ+wwhEaYR4s17PHMw= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1 h1:LNHhpdK7hzUcx/k1LIcuh5k7k1LGIWLQfCjaneSj7Fc= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1/go.mod h1:uE9zaUfEQT/nbQjVi2IblCG9iaLtZsuYZ8ne+PuQ02M= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= @@ -54,7 +54,6 @@ github.com/evanphx/json-patch/v5 v5.7.0 h1:nJqP7uwL84RJInrohHfW0Fx3awjbm8qZeFv0n github.com/evanphx/json-patch/v5 v5.7.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -75,7 +74,6 @@ github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEe github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= @@ -106,13 +104,10 @@ github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/ github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= github.com/jackc/pgx/v5 v5.4.3 h1:cxFyXhxlvAifxnkKKdlxv8XqUf59tDlYjnV5YYfsJJY= github.com/jackc/pgx/v5 v5.4.3/go.mod h1:Ig06C2Vu0t5qXC60W8sqIthScaEnFvojjj9dSljmHRA= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -124,13 +119,10 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= -github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= @@ -145,7 +137,6 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/onsi/ginkgo/v2 v2.12.0 h1:UIVDowFPwpg6yMUpPjGkYvf06K3RAiJXUhCxEwQVHRI= github.com/onsi/gomega v1.28.0 h1:i2rg/p9n/UqIDAMFUJ6qIUUMcsqOuUHgbpbu235Vr1c= github.com/onsi/gomega v1.28.0/go.mod h1:A1H2JE76sI14WIP57LMKj7FVfCHx3g3BcZVjJG8bjX8= @@ -168,8 +159,6 @@ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.30.0 h1:SymVODrcRsaRaSInD9yQtKbtWqwsfoPcRff/oRXLj4c= -github.com/rs/zerolog v1.30.0/go.mod h1:/tk+P47gFdPXq4QYjvCmT5/Gsug2nagsFWBWhAiSi1w= github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A= github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -198,8 +187,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -220,26 +209,25 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU= -golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= +golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= diff --git a/v2/go.mod b/v2/go.mod index 81f52be3724..69b6dfbb69c 100644 --- a/v2/go.mod +++ b/v2/go.mod @@ -3,7 +3,7 @@ module github.com/Azure/azure-service-operator/v2 go 1.20 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.2 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appconfiguration/armappconfiguration v1.1.1 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice v1.0.0 @@ -31,9 +31,9 @@ require ( github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.17.0 github.com/spf13/cobra v1.7.0 - golang.org/x/crypto v0.13.0 + golang.org/x/crypto v0.14.0 golang.org/x/exp v0.0.0-20230905200255-921286631fa9 - golang.org/x/sync v0.3.0 + golang.org/x/sync v0.4.0 golang.org/x/time v0.3.0 k8s.io/api v0.28.2 k8s.io/apiextensions-apiserver v0.28.2 @@ -83,8 +83,8 @@ require ( github.com/spf13/pflag v1.0.5 // indirect golang.org/x/net v0.15.0 // indirect golang.org/x/oauth2 v0.12.0 // indirect - golang.org/x/sys v0.12.0 // indirect - golang.org/x/term v0.12.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/term v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/appengine v1.6.8 // indirect diff --git a/v2/go.sum b/v2/go.sum index 5ea9562167c..3f7a64e681a 100644 --- a/v2/go.sum +++ b/v2/go.sum @@ -1,5 +1,5 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.2 h1:t5+QXLCK9SVi0PPdaY0PrFvYUo24KwA0QwxnaHRSVd4= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.2/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0 h1:9kDVnTz3vbfweTqAUmk/a/pH5pWFCHtvRpHYC0G/dcA= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0/go.mod h1:3Ug6Qzto9anB6mGlEdgYMDF5zHQ+wwhEaYR4s17PHMw= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1 h1:LNHhpdK7hzUcx/k1LIcuh5k7k1LGIWLQfCjaneSj7Fc= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1/go.mod h1:uE9zaUfEQT/nbQjVi2IblCG9iaLtZsuYZ8ne+PuQ02M= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= @@ -174,8 +174,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -196,8 +196,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -207,12 +207,12 @@ golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU= -golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= +golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= diff --git a/v2/internal/controllers/controller_resources_gen.go b/v2/internal/controllers/controller_resources_gen.go index ab5a0507f05..c8a3dc65434 100644 --- a/v2/internal/controllers/controller_resources_gen.go +++ b/v2/internal/controllers/controller_resources_gen.go @@ -322,18 +322,18 @@ func getKnownStorageTypes() []*registration.StorageType { Obj: new(apimanagement_v20220801s.Subscription), Indexes: []registration.Index{ { - Key: ".spec.primaryKeyFromConfig", - Func: indexApimanagementSubscriptionPrimaryKeyFromConfig, + Key: ".spec.primaryKey", + Func: indexApimanagementSubscriptionPrimaryKey, }, { - Key: ".spec.secondaryKeyFromConfig", - Func: indexApimanagementSubscriptionSecondaryKeyFromConfig, + Key: ".spec.secondaryKey", + Func: indexApimanagementSubscriptionSecondaryKey, }, }, Watches: []registration.Watch{ { - Type: &v1.ConfigMap{}, - MakeEventHandler: watchConfigMapsFactory([]string{".spec.primaryKeyFromConfig", ".spec.secondaryKeyFromConfig"}, &apimanagement_v20220801s.SubscriptionList{}), + Type: &v1.Secret{}, + MakeEventHandler: watchSecretsFactory([]string{".spec.primaryKey", ".spec.secondaryKey"}, &apimanagement_v20220801s.SubscriptionList{}), }, }, }) @@ -2287,28 +2287,28 @@ func indexApimanagementServiceHostnameConfigurationsThumbprintFromConfig(rawObj return result } -// indexApimanagementSubscriptionPrimaryKeyFromConfig an index function for apimanagement_v20220801s.Subscription .spec.primaryKeyFromConfig -func indexApimanagementSubscriptionPrimaryKeyFromConfig(rawObj client.Object) []string { +// indexApimanagementSubscriptionPrimaryKey an index function for apimanagement_v20220801s.Subscription .spec.primaryKey +func indexApimanagementSubscriptionPrimaryKey(rawObj client.Object) []string { obj, ok := rawObj.(*apimanagement_v20220801s.Subscription) if !ok { return nil } - if obj.Spec.PrimaryKeyFromConfig == nil { + if obj.Spec.PrimaryKey == nil { return nil } - return obj.Spec.PrimaryKeyFromConfig.Index() + return obj.Spec.PrimaryKey.Index() } -// indexApimanagementSubscriptionSecondaryKeyFromConfig an index function for apimanagement_v20220801s.Subscription .spec.secondaryKeyFromConfig -func indexApimanagementSubscriptionSecondaryKeyFromConfig(rawObj client.Object) []string { +// indexApimanagementSubscriptionSecondaryKey an index function for apimanagement_v20220801s.Subscription .spec.secondaryKey +func indexApimanagementSubscriptionSecondaryKey(rawObj client.Object) []string { obj, ok := rawObj.(*apimanagement_v20220801s.Subscription) if !ok { return nil } - if obj.Spec.SecondaryKeyFromConfig == nil { + if obj.Spec.SecondaryKey == nil { return nil } - return obj.Spec.SecondaryKeyFromConfig.Index() + return obj.Spec.SecondaryKey.Index() } // indexAuthorizationRoleAssignmentPrincipalIdFromConfig an index function for authorization_v20200801ps.RoleAssignment .spec.principalIdFromConfig diff --git a/v2/internal/controllers/suite_test.go b/v2/internal/controllers/suite_test.go index 66e55594e32..d186ae4af44 100644 --- a/v2/internal/controllers/suite_test.go +++ b/v2/internal/controllers/suite_test.go @@ -13,6 +13,7 @@ import ( "time" "github.com/onsi/gomega" + "github.com/onsi/gomega/format" "github.com/Azure/azure-service-operator/v2/internal/testcommon" ) @@ -35,6 +36,8 @@ func setup() error { gomega.SetDefaultEventuallyTimeout(DefaultResourceTimeout) gomega.SetDefaultEventuallyPollingInterval(5 * time.Second) + format.TruncateThreshold = 4000 // Force a longer truncate threshold + // If you need to debug envtest setup/teardown, // set a global logger for controller-runtime: // import (ctrl "sigs.k8s.io/controller-runtime") diff --git a/v2/internal/genericarmclient/generic_client.go b/v2/internal/genericarmclient/generic_client.go index ce073802460..13f8f70f744 100644 --- a/v2/internal/genericarmclient/generic_client.go +++ b/v2/internal/genericarmclient/generic_client.go @@ -84,13 +84,6 @@ func NewGenericClient( DisableRPRegistration: true, } - rpRegistrationPolicy, err := NewRPRegistrationPolicy( - creds, - &opts.ClientOptions) - if err != nil { - return nil, errors.Wrapf(err, "failed to create rp registration policy") - } - // We assign this HTTPClient like this because if we actually set it to nil, due to the way // go interfaces wrap values, the subsequent if httpClient == nil check returns false (even though // the value IN the interface IS nil). @@ -100,6 +93,13 @@ func NewGenericClient( opts.Transport = defaultHttpClient } + rpRegistrationPolicy, err := NewRPRegistrationPolicy( + creds, + &opts.ClientOptions) + if err != nil { + return nil, errors.Wrapf(err, "failed to create rp registration policy") + } + opts.PerCallPolicies = append([]policy.Policy{rpRegistrationPolicy}, opts.PerCallPolicies...) if options.Metrics != nil { opts.PerCallPolicies = append(opts.PerCallPolicies, metrics.NewMetricsPolicy(options.Metrics)) diff --git a/v2/internal/genericarmclient/generic_client_test.go b/v2/internal/genericarmclient/generic_client_test.go index 737bcca71a3..99cdf6f97a1 100644 --- a/v2/internal/genericarmclient/generic_client_test.go +++ b/v2/internal/genericarmclient/generic_client_test.go @@ -146,7 +146,7 @@ func Test_NewResourceGroup_SubscriptionNotRegisteredError(t *testing.T) { g := NewGomegaWithT(t) ctx := context.Background() - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + server := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if r.Method == http.MethodPut { if r.URL.Path == "/subscriptions/12345/resourceGroups/myrg/providers/Microsoft.Fake/fakeResource/fake" { w.WriteHeader(http.StatusConflict) @@ -184,7 +184,10 @@ func Test_NewResourceGroup_SubscriptionNotRegisteredError(t *testing.T) { subscriptionId := "12345" metrics := asometrics.NewARMClientMetrics() - options := &genericarmclient.GenericClientOptions{Metrics: metrics} + options := &genericarmclient.GenericClientOptions{ + HttpClient: server.Client(), + Metrics: metrics, + } client, err := genericarmclient.NewGenericClient(cfg, testcommon.MockTokenCredential{}, options) g.Expect(err).ToNot(HaveOccurred()) diff --git a/v2/internal/genericarmclient/suite_test.go b/v2/internal/genericarmclient/suite_test.go index 5c243bd02c6..fabc0be1b8b 100644 --- a/v2/internal/genericarmclient/suite_test.go +++ b/v2/internal/genericarmclient/suite_test.go @@ -12,6 +12,7 @@ import ( "time" "github.com/onsi/gomega" + "github.com/onsi/gomega/format" "k8s.io/klog/v2/klogr" ctrl "sigs.k8s.io/controller-runtime" @@ -29,6 +30,7 @@ func setup() error { gomega.SetDefaultEventuallyTimeout(DefaultEventuallyTimeout) gomega.SetDefaultEventuallyPollingInterval(5 * time.Second) + format.TruncateThreshold = 4000 // Force a longer truncate threshold // setup global logger for controller-runtime: ctrl.SetLogger(klogr.New()) diff --git a/v2/pkg/genruntime/test/suite_test.go b/v2/pkg/genruntime/test/suite_test.go index 87a2e8669a5..787684c0246 100644 --- a/v2/pkg/genruntime/test/suite_test.go +++ b/v2/pkg/genruntime/test/suite_test.go @@ -12,6 +12,7 @@ import ( "time" "github.com/onsi/gomega" + "github.com/onsi/gomega/format" "github.com/Azure/azure-service-operator/v2/internal/testcommon" ) @@ -36,6 +37,8 @@ func setup() error { gomega.SetDefaultEventuallyTimeout(DefaultResourceTimeout) gomega.SetDefaultEventuallyPollingInterval(5 * time.Second) + format.TruncateThreshold = 4000 // Force a longer truncate threshold + // If you need to debug envtest setup/teardown, // set a global logger for controller-runtime: // import (ctrl "sigs.k8s.io/controller-runtime") diff --git a/v2/test/multitenant/suite_test.go b/v2/test/multitenant/suite_test.go index 12dd3831d18..62a9a0fcbad 100644 --- a/v2/test/multitenant/suite_test.go +++ b/v2/test/multitenant/suite_test.go @@ -12,6 +12,7 @@ import ( "time" "github.com/onsi/gomega" + "github.com/onsi/gomega/format" "k8s.io/klog/v2/klogr" ctrl "sigs.k8s.io/controller-runtime" @@ -33,6 +34,8 @@ func setup() error { gomega.SetDefaultEventuallyTimeout(DefaultResourceTimeout) gomega.SetDefaultEventuallyPollingInterval(5 * time.Second) + format.TruncateThreshold = 4000 // Force a longer truncate threshold + // setup global logger for controller-runtime: ctrl.SetLogger(klogr.New()) diff --git a/v2/test/pre-release/suite_test.go b/v2/test/pre-release/suite_test.go index 12dd3831d18..62a9a0fcbad 100644 --- a/v2/test/pre-release/suite_test.go +++ b/v2/test/pre-release/suite_test.go @@ -12,6 +12,7 @@ import ( "time" "github.com/onsi/gomega" + "github.com/onsi/gomega/format" "k8s.io/klog/v2/klogr" ctrl "sigs.k8s.io/controller-runtime" @@ -33,6 +34,8 @@ func setup() error { gomega.SetDefaultEventuallyTimeout(DefaultResourceTimeout) gomega.SetDefaultEventuallyPollingInterval(5 * time.Second) + format.TruncateThreshold = 4000 // Force a longer truncate threshold + // setup global logger for controller-runtime: ctrl.SetLogger(klogr.New()) diff --git a/v2/test/suite_test.go b/v2/test/suite_test.go index 3ef58caccf4..feadd392d48 100644 --- a/v2/test/suite_test.go +++ b/v2/test/suite_test.go @@ -12,6 +12,7 @@ import ( "time" "github.com/onsi/gomega" + "github.com/onsi/gomega/format" "k8s.io/klog/v2/klogr" ctrl "sigs.k8s.io/controller-runtime" @@ -33,6 +34,8 @@ func setup() error { gomega.SetDefaultEventuallyTimeout(DefaultResourceTimeout) gomega.SetDefaultEventuallyPollingInterval(5 * time.Second) + format.TruncateThreshold = 4000 // Force a longer truncate threshold + // setup global logger for controller-runtime: ctrl.SetLogger(klogr.New()) diff --git a/v2/tools/generator/go.mod b/v2/tools/generator/go.mod index dc81994cde9..d05d0305a53 100644 --- a/v2/tools/generator/go.mod +++ b/v2/tools/generator/go.mod @@ -30,9 +30,9 @@ require ( github.com/spf13/pflag v1.0.5 github.com/xeipuuv/gojsonschema v1.2.0 golang.org/x/exp v0.0.0-20230905200255-921286631fa9 - golang.org/x/mod v0.12.0 - golang.org/x/net v0.15.0 - golang.org/x/sync v0.3.0 + golang.org/x/mod v0.13.0 + golang.org/x/net v0.16.0 + golang.org/x/sync v0.4.0 golang.org/x/text v0.13.0 gopkg.in/yaml.v3 v3.0.1 k8s.io/apimachinery v0.28.2 @@ -53,6 +53,6 @@ require ( github.com/sergi/go-diff v1.3.1 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect - golang.org/x/sys v0.12.0 // indirect + golang.org/x/sys v0.13.0 // indirect golang.org/x/tools v0.13.0 // indirect ) diff --git a/v2/tools/generator/go.sum b/v2/tools/generator/go.sum index 0d1b6df53c2..8da249bc65a 100644 --- a/v2/tools/generator/go.sum +++ b/v2/tools/generator/go.sum @@ -110,16 +110,17 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHo github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= +golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.16.0 h1:7eBu7KsSvFDtSXUIDbh3aqlK4DPsZ1rByC8PFfBThos= +golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ=