diff --git a/provider/pkg/gen/merging.go b/provider/pkg/gen/merging.go index 4a903cf3132b..dc6b780991ee 100644 --- a/provider/pkg/gen/merging.go +++ b/provider/pkg/gen/merging.go @@ -7,7 +7,6 @@ import ( "github.com/pkg/errors" "github.com/pulumi/pulumi/pkg/v3/codegen" "github.com/pulumi/pulumi/pkg/v3/codegen/schema" - pschema "github.com/pulumi/pulumi/pkg/v3/codegen/schema" "github.com/pulumi/pulumi/sdk/v3/go/common/util/contract" ) @@ -21,7 +20,7 @@ func mergeTypes(t1 schema.ComplexTypeSpec, t2 schema.ComplexTypeSpec, isOutput b } if !isOutput { - // Check that every required property of T1 and T2 exists in T1 and has the same type (for intputs only). + // Check that every required property of T1 and T2 exists in T1 and has the same type (for inputs only). t1Required := codegen.NewStringSet(t1.Required...) t2Required := codegen.NewStringSet(t2.Required...) t1Only := t1Required.Subtract(t2Required) @@ -43,7 +42,7 @@ func mergeTypes(t1 schema.ComplexTypeSpec, t2 schema.ComplexTypeSpec, isOutput b if t1.Properties == nil && t2.Properties == nil { return &t1, nil } - mergedProperties := map[string]pschema.PropertySpec{} + mergedProperties := map[string]schema.PropertySpec{} for name, p := range t1.Properties { mergedProperties[name] = p } @@ -65,7 +64,7 @@ func mergeTypes(t1 schema.ComplexTypeSpec, t2 schema.ComplexTypeSpec, isOutput b return &merged, nil } -func mergePropertySpec(p1, p2 pschema.PropertySpec) (*pschema.PropertySpec, error) { +func mergePropertySpec(p1, p2 schema.PropertySpec) (*schema.PropertySpec, error) { mergedTypeSpec, err := mergeTypeSpec(p1.TypeSpec, p2.TypeSpec) if err != nil { return nil, err diff --git a/provider/pkg/resources/customresources/customresources.go b/provider/pkg/resources/customresources/customresources.go index 4a407e922e8c..8a2cc53d52fc 100644 --- a/provider/pkg/resources/customresources/customresources.go +++ b/provider/pkg/resources/customresources/customresources.go @@ -15,11 +15,10 @@ import ( azureEnv "github.com/Azure/go-autorest/autorest/azure" "github.com/pulumi/pulumi-azure-native/v2/provider/pkg/azure" "github.com/pulumi/pulumi-azure-native/v2/provider/pkg/provider/crud" - "github.com/pulumi/pulumi-azure-native/v2/provider/pkg/resources" + . "github.com/pulumi/pulumi-azure-native/v2/provider/pkg/resources" "github.com/pulumi/pulumi/pkg/v3/codegen" "github.com/pulumi/pulumi/pkg/v3/codegen/schema" - pschema "github.com/pulumi/pulumi/pkg/v3/codegen/schema" "github.com/pulumi/pulumi/sdk/v3/go/common/resource" ) @@ -82,7 +81,7 @@ type ResourceDefinition struct { // ApplySchemas applies custom schema modifications to the given package. // These modifications should never overlap with each other, but we apply in a deterministic order to ensure // that the end result of the modifications is consistent. -func ApplySchemas(pkg *pschema.PackageSpec, meta *resources.AzureAPIMetadata) error { +func ApplySchemas(pkg *schema.PackageSpec, meta *AzureAPIMetadata) error { for _, path := range codegen.SortedKeys(featureLookup) { r := featureLookup[path] if err := r.ApplySchema(pkg, meta); err != nil { @@ -92,20 +91,20 @@ func ApplySchemas(pkg *pschema.PackageSpec, meta *resources.AzureAPIMetadata) er return nil } -func (r *CustomResource) ApplySchema(pkg *pschema.PackageSpec, meta *resources.AzureAPIMetadata) error { +func (r *CustomResource) ApplySchema(pkg *schema.PackageSpec, meta *AzureAPIMetadata) error { if r.tok == "" || r.Schema == nil { return nil } existingResource, resourceAlreadyExists := pkg.Resources[r.tok] var originalResource *ResourceDefinition - types := map[string]pschema.ComplexTypeSpec{} // Hoist scope for easy lookup when checking if the type is new. + types := map[string]schema.ComplexTypeSpec{} // Hoist scope for easy lookup when checking if the type is new. if resourceAlreadyExists { resourceMeta, resourceMetadataFound := meta.Resources[r.tok] if !resourceMetadataFound { return fmt.Errorf("metadata for resource %s not found", r.tok) } - resources.VisitResourceTypes(pkg, r.tok, func(tok string, t pschema.ComplexTypeSpec) { + VisitResourceTypes(pkg, r.tok, func(tok string, t schema.ComplexTypeSpec) { // Capture referenced schema types types[tok] = t }) @@ -286,7 +285,7 @@ func MetaTypeOverrides() map[string]AzureAPIType { // createCrudClient creates a CRUD client for the given resource type, looking up the fully // qualified `resourceToken` like "azure-native:web:WebApp" via `lookupResource`. func createCrudClient( - crudClientFactory crud.ResourceCrudClientFactory, lookupResource resources.ResourceLookupFunc, resourceToken string, + crudClientFactory crud.ResourceCrudClientFactory, lookupResource ResourceLookupFunc, resourceToken string, ) (crud.ResourceCrudClient, error) { res, ok, err := lookupResource(webAppResourceType) if err != nil {