Skip to content

Commit

Permalink
Use a copy of the conns.AWSClient with schema.Provider.Configure
Browse files Browse the repository at this point in the history
Signed-off-by: Alper Rifat Ulucinar <[email protected]>
  • Loading branch information
ulucinar committed Dec 15, 2023
1 parent 5d27a87 commit 33fa2b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions config/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ func GetProvider(ctx context.Context, generationProvider bool) (*config.Provider
if err != nil {
return nil, errors.Wrapf(err, "cannot get the Terraform provider schema with generation mode set to %t", generationProvider)
}
// we set schema.Provider's meta to nil because p.Configure modifies
// a singleton pointer.
p.SetMeta(nil)
modulePath := "github.com/upbound/provider-aws"
pc := config.NewProvider([]byte(providerSchema), "aws",
modulePath, providerMetadata,
Expand Down
7 changes: 3 additions & 4 deletions internal/clients/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ import (
"os"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
tfsdk "github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
"k8s.io/apimachinery/pkg/types"

"github.com/crossplane/crossplane-runtime/pkg/logging"
"github.com/crossplane/crossplane-runtime/pkg/resource"
"github.com/crossplane/upjet/pkg/terraform"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
tfsdk "github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/upbound/provider-aws/apis/v1beta1"
Expand Down

0 comments on commit 33fa2b1

Please sign in to comment.