From 9bafe5fe4908c47a1d51b4cda0396c306267be33 Mon Sep 17 00:00:00 2001 From: Erhan Cagirici Date: Tue, 19 Mar 2024 14:45:53 +0300 Subject: [PATCH 1/7] cache AWS Config's CredentialsProvider to reduce STS calls Signed-off-by: Erhan Cagirici --- internal/clients/aws.go | 5 +- internal/clients/creds_cache.go | 202 ++++++++++++++++++++++++++++++++ 2 files changed, 206 insertions(+), 1 deletion(-) create mode 100644 internal/clients/creds_cache.go diff --git a/internal/clients/aws.go b/internal/clients/aws.go index c8ea8e73eb..af6b7ec099 100644 --- a/internal/clients/aws.go +++ b/internal/clients/aws.go @@ -52,7 +52,10 @@ func SelectTerraformSetup(config *SetupConfig) terraform.SetupFn { // nolint:goc } else if awsCfg == nil { return terraform.Setup{}, errors.Wrap(err, "obtained aws config cannot be nil") } - creds, err := awsCfg.Credentials.Retrieve(ctx) + + // only IRSA auth credentials are cached, other auth methods will skip + // cache and call downstream Credentials.Retrieve() of given awsCfg + creds, err := GlobalAWSCredentialsProviderCache.RetrieveCredentials(ctx, pc, awsCfg) if err != nil { return terraform.Setup{}, errors.Wrap(err, "failed to retrieve aws credentials from aws config") } diff --git a/internal/clients/creds_cache.go b/internal/clients/creds_cache.go new file mode 100644 index 0000000000..88d5d12c94 --- /dev/null +++ b/internal/clients/creds_cache.go @@ -0,0 +1,202 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +package clients + +import ( + "context" + "crypto/sha256" + "fmt" + "io" + "os" + "path/filepath" + "strings" + "sync" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/crossplane/crossplane-runtime/pkg/logging" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/log/zap" + + "github.com/upbound/provider-aws/apis/v1beta1" +) + +// GlobalAWSCredentialsProviderCache is a global AWS CredentialsProvider cache to be used by all controllers. +var GlobalAWSCredentialsProviderCache = NewAWSCredentialsProviderCache() + +// AWSCredentialsProviderCacheOption lets you configure *GlobalAWSCredentialsProviderCache. +type AWSCredentialsProviderCacheOption func(cache *AWSCredentialsProviderCache) + +// WithCacheMaxSize lets you override the default MaxSize for AWS CredentialsProvider cache. +func WithCacheMaxSize(n int) AWSCredentialsProviderCacheOption { + return func(c *AWSCredentialsProviderCache) { + c.maxSize = n + } +} + +// WithCacheStore lets you bootstrap AWS CredentialsProvider Cache with your own cache. +func WithCacheStore(cache map[string]*awsCredentialsProviderCacheEntry) AWSCredentialsProviderCacheOption { + return func(c *AWSCredentialsProviderCache) { + c.cache = cache + } +} + +// WithCacheLogger lets you configure the logger for the cache. +func WithCacheLogger(l logging.Logger) AWSCredentialsProviderCacheOption { + return func(c *AWSCredentialsProviderCache) { + c.logger = l + } +} + +// NewAWSCredentialsProviderCache returns a new empty *AWSCredentialsProviderCache with the default GetAWSConfig method. +func NewAWSCredentialsProviderCache(opts ...AWSCredentialsProviderCacheOption) *AWSCredentialsProviderCache { + // zl := zap.New(zap.UseDevMode(false)) + logr := logging.NewLogrLogger(zap.New(zap.UseDevMode(false)).WithName("provider-aws-credentials-cache")) + c := &AWSCredentialsProviderCache{ + cache: map[string]*awsCredentialsProviderCacheEntry{}, + maxSize: 100, + mu: &sync.RWMutex{}, + logger: logr, + } + for _, f := range opts { + f(c) + } + return c +} + +// AWSCredentialsProviderCache holds aws.CredentialsProvider objects in memory so that +// we don't need to make API calls to AWS in every reconciliation of every +// resource. It has a maximum size that when it's reached, the entry that has +// the oldest access time will be removed from the cache, i.e. FIFO on last access +// time. +// Note that there is no need to invalidate the values in the cache because they +// never change, so we don't need concurrency-safety to prevent access to an +// invalidated entry. +type AWSCredentialsProviderCache struct { + // cache holds the AWS Config with a unique cache key per provider configuration. + // key content includes the ProviderConfig's UUID and ResourceVersion and + // additional fields depending on the auth method + cache map[string]*awsCredentialsProviderCacheEntry + + // maxSize is the maximum number of elements this cache can ever have. + maxSize int + + // mu is used to make sure the cache map is concurrency-safe. + mu *sync.RWMutex + + // logger is the logger for cache operations + logger logging.Logger +} + +type awsCredentialsProviderCacheEntry struct { + *aws.Config + credProvider aws.CredentialsProvider + AccessedAt time.Time +} + +func (c *AWSCredentialsProviderCache) RetrieveCredentials(ctx context.Context, pc *v1beta1.ProviderConfig, awsCfg *aws.Config) (aws.Credentials, error) { + // cache key calculation tries to capture any parameter that could cause changes + // in the resulting AWS credentials, to ensure unique keys. + // + // Parameters that are directly available in the provider config, will generate + // unique cache keys through UUID and ResourceVersion of the ProviderConfig's + // k8s object, as they change when the provider config is modified. + // + // any other external parameter that have an effect on the resulting credentials + // and does not appear in the ProviderConfig directly (i.e. the same provider config + // content produces a different config), should be included in the cache key + cacheKeyParams := []string{ + string(pc.UID), + pc.ResourceVersion, + awsCfg.Region, + string(pc.Spec.Credentials.Source), + } + + // Only IRSA authentication method credentials are cached currently + switch s := pc.Spec.Credentials.Source; s { //nolint:exhaustive + case authKeyIRSA: + tokenHash, err := hashTokenFile(os.Getenv("AWS_WEB_IDENTITY_TOKEN_FILE")) + if err != nil { + return aws.Credentials{}, errors.Wrap(err, "cannot calculate cache key for credentials") + } + cacheKeyParams = append(cacheKeyParams, authKeyIRSA, tokenHash, os.Getenv("AWS_WEB_IDENTITY_TOKEN_FILE"), os.Getenv("AWS_ROLE_ARN")) + default: + c.logger.Debug("skipping cache", "pc", pc.GroupVersionKind().String(), "authSource", s) + // skip cache for other/unimplemented credential types + return awsCfg.Credentials.Retrieve(ctx) + } + + cacheKey := strings.Join(cacheKeyParams, ":") + c.logger.Debug("checking cache entry", "cacheKey", cacheKey, "pc", pc.GroupVersionKind().String()) + c.mu.RLock() + cacheEntry, ok := c.cache[cacheKey] + c.mu.RUnlock() + + // TODO: consider implementing a TTL even though the cached entry is valid + // cache hit + if ok { + c.logger.Debug("cache hit", "cacheKey", cacheKey, "pc", pc.GroupVersionKind().String()) + // since this is a hot-path in the execution, do not always update + // the last access times, it is fine to evict the LRU entry on a less + // granular precision. + if time.Since(cacheEntry.AccessedAt) > 10*time.Minute { + c.mu.Lock() + cacheEntry.AccessedAt = time.Now() + c.mu.Unlock() + } + return cacheEntry.credProvider.Retrieve(ctx) + } + + // cache miss + c.logger.Debug("cache miss", "cacheKey", cacheKey, "pc", pc.GroupVersionKind().String()) + c.mu.Lock() + defer c.mu.Unlock() + c.makeRoom() + c.cache[cacheKey] = &awsCredentialsProviderCacheEntry{ + credProvider: awsCfg.Credentials, + AccessedAt: time.Now(), + } + return awsCfg.Credentials.Retrieve(ctx) +} + +// makeRoom ensures that there is at most maxSize-1 elements in the cache map +// so that a new entry can be added. It deletes the object that was last accessed +// before all others. +func (c *AWSCredentialsProviderCache) makeRoom() { + if 1+len(c.cache) <= c.maxSize { + return + } + var dustiest string + for key, val := range c.cache { + if dustiest == "" { + dustiest = key + } + if val.AccessedAt.Before(c.cache[dustiest].AccessedAt) { + dustiest = key + } + } + delete(c.cache, dustiest) +} + +// hashTokenFile calculates the sha256 checksum of the token file content at +// the supplied file path +func hashTokenFile(filename string) (string, error) { + if filename == "" { + return "", errors.New("token file name cannot be empty") + } + file, err := os.Open(filepath.Clean(filename)) + if err != nil { + return "", err + } + defer file.Close() //nolint:errcheck + + hash := sha256.New() + if _, err = io.Copy(hash, file); err != nil { + return "", err + } + + checksum := hash.Sum(nil) + return fmt.Sprintf("%x", checksum), nil +} From fc6996f009d3b8b100a09124c3ab9a703e0b87d0 Mon Sep 17 00:00:00 2001 From: Alper Rifat Ulucinar Date: Tue, 26 Mar 2024 18:33:41 +0300 Subject: [PATCH 2/7] Synchronization fixes for the credential cache manager - Use an aws.CredentialCache in the cache manager, which is known to be thread-safe. - Break comments in creds_cache.go at line 80. Signed-off-by: Alper Rifat Ulucinar --- internal/clients/aws.go | 21 +++++- internal/clients/creds_cache.go | 123 +++++++++++++++++--------------- 2 files changed, 82 insertions(+), 62 deletions(-) diff --git a/internal/clients/aws.go b/internal/clients/aws.go index af6b7ec099..8e6e5f706c 100644 --- a/internal/clients/aws.go +++ b/internal/clients/aws.go @@ -12,6 +12,7 @@ import ( "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" awsrequest "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/smithy-go/middleware" + "github.com/crossplane/crossplane-runtime/pkg/logging" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/upjet/pkg/metrics" "github.com/crossplane/upjet/pkg/terraform" @@ -32,6 +33,7 @@ const ( type SetupConfig struct { TerraformProvider *schema.Provider + logger logging.Logger } func SelectTerraformSetup(config *SetupConfig) terraform.SetupFn { // nolint:gocyclo @@ -53,9 +55,7 @@ func SelectTerraformSetup(config *SetupConfig) terraform.SetupFn { // nolint:goc return terraform.Setup{}, errors.Wrap(err, "obtained aws config cannot be nil") } - // only IRSA auth credentials are cached, other auth methods will skip - // cache and call downstream Credentials.Retrieve() of given awsCfg - creds, err := GlobalAWSCredentialsProviderCache.RetrieveCredentials(ctx, pc, awsCfg) + creds, err := retrieveCredentials(ctx, pc, awsCfg, config.logger) if err != nil { return terraform.Setup{}, errors.Wrap(err, "failed to retrieve aws credentials from aws config") } @@ -81,6 +81,21 @@ func SelectTerraformSetup(config *SetupConfig) terraform.SetupFn { // nolint:goc } } +// retrieveCredentials asserts that the configured aws.CredentialsProvider +// is a *aws.CredentialCache and retrieves the credentials via the +// credential cache. If not, it retrieves the credentials via the +// aws.CredentialProvider directly. +func retrieveCredentials(ctx context.Context, pc *v1beta1.ProviderConfig, awsConfig *aws.Config, logr logging.Logger) (aws.Credentials, error) { + awsCredCache, ok := awsConfig.Credentials.(*aws.CredentialsCache) + if !ok { + logr.Debug("CredentialProvider is not an aws.CredentialCache, skipping the credential cache...") + return awsConfig.Credentials.Retrieve(ctx) + } + // only IRSA auth credentials are cached, other auth methods will skip + // the cache and call the downstream CredentialsCache.Retrieve() + return GlobalAWSCredentialsProviderCache.RetrieveCredentials(ctx, pc, awsConfig.Region, awsCredCache) +} + // getAccountId retrieves the account ID associated with the given credentials. // Results are cached. func getAccountId(ctx context.Context, cfg *aws.Config, creds aws.Credentials) (string, error) { diff --git a/internal/clients/creds_cache.go b/internal/clients/creds_cache.go index 88d5d12c94..88a1c8abeb 100644 --- a/internal/clients/creds_cache.go +++ b/internal/clients/creds_cache.go @@ -18,25 +18,28 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/crossplane/crossplane-runtime/pkg/logging" "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/log/zap" "github.com/upbound/provider-aws/apis/v1beta1" ) -// GlobalAWSCredentialsProviderCache is a global AWS CredentialsProvider cache to be used by all controllers. +// GlobalAWSCredentialsProviderCache is a global AWS CredentialsProvider cache +// to be used by all controllers. var GlobalAWSCredentialsProviderCache = NewAWSCredentialsProviderCache() -// AWSCredentialsProviderCacheOption lets you configure *GlobalAWSCredentialsProviderCache. +// AWSCredentialsProviderCacheOption lets you configure +// a *GlobalAWSCredentialsProviderCache. type AWSCredentialsProviderCacheOption func(cache *AWSCredentialsProviderCache) -// WithCacheMaxSize lets you override the default MaxSize for AWS CredentialsProvider cache. +// WithCacheMaxSize lets you override the default MaxSize for +// AWS CredentialsProvider cache. func WithCacheMaxSize(n int) AWSCredentialsProviderCacheOption { return func(c *AWSCredentialsProviderCache) { c.maxSize = n } } -// WithCacheStore lets you bootstrap AWS CredentialsProvider Cache with your own cache. +// WithCacheStore lets you bootstrap AWS CredentialsProvider Cache with +// your own cache. func WithCacheStore(cache map[string]*awsCredentialsProviderCacheEntry) AWSCredentialsProviderCacheOption { return func(c *AWSCredentialsProviderCache) { c.cache = cache @@ -50,15 +53,14 @@ func WithCacheLogger(l logging.Logger) AWSCredentialsProviderCacheOption { } } -// NewAWSCredentialsProviderCache returns a new empty *AWSCredentialsProviderCache with the default GetAWSConfig method. +// NewAWSCredentialsProviderCache returns a new empty +// *AWSCredentialsProviderCache with the default GetAWSConfig method. func NewAWSCredentialsProviderCache(opts ...AWSCredentialsProviderCacheOption) *AWSCredentialsProviderCache { - // zl := zap.New(zap.UseDevMode(false)) - logr := logging.NewLogrLogger(zap.New(zap.UseDevMode(false)).WithName("provider-aws-credentials-cache")) c := &AWSCredentialsProviderCache{ cache: map[string]*awsCredentialsProviderCacheEntry{}, maxSize: 100, mu: &sync.RWMutex{}, - logger: logr, + logger: logging.NewNopLogger(), } for _, f := range opts { f(c) @@ -66,18 +68,21 @@ func NewAWSCredentialsProviderCache(opts ...AWSCredentialsProviderCacheOption) * return c } -// AWSCredentialsProviderCache holds aws.CredentialsProvider objects in memory so that -// we don't need to make API calls to AWS in every reconciliation of every -// resource. It has a maximum size that when it's reached, the entry that has -// the oldest access time will be removed from the cache, i.e. FIFO on last access -// time. -// Note that there is no need to invalidate the values in the cache because they -// never change, so we don't need concurrency-safety to prevent access to an -// invalidated entry. +// AWSCredentialsProviderCache holds aws.CredentialsProvider objects in memory +// so that we don't need to make API calls to AWS in every reconciliation of +// +// every resource. It has a maximum size that when it's reached, the entry +// that has the oldest access time will be removed from the cache, +// i.e. FIFO on last access time. +// +// Note that there is no need to invalidate the values in the cache because +// they never change, so we don't need concurrency-safety to prevent access +// to an invalidated entry. type AWSCredentialsProviderCache struct { - // cache holds the AWS Config with a unique cache key per provider configuration. - // key content includes the ProviderConfig's UUID and ResourceVersion and - // additional fields depending on the auth method + // cache holds the AWS Config with a unique cache key per + // provider configuration. Key content includes the ProviderConfig's UUID + // and ResourceVersion and additional fields depending on the auth method + // (currently only IRSA temporary credential caching is supported). cache map[string]*awsCredentialsProviderCacheEntry // maxSize is the maximum number of elements this cache can ever have. @@ -86,84 +91,83 @@ type AWSCredentialsProviderCache struct { // mu is used to make sure the cache map is concurrency-safe. mu *sync.RWMutex - // logger is the logger for cache operations + // logger is the logger for cache operations. logger logging.Logger } type awsCredentialsProviderCacheEntry struct { - *aws.Config - credProvider aws.CredentialsProvider + awsCredCache *aws.CredentialsCache AccessedAt time.Time } -func (c *AWSCredentialsProviderCache) RetrieveCredentials(ctx context.Context, pc *v1beta1.ProviderConfig, awsCfg *aws.Config) (aws.Credentials, error) { - // cache key calculation tries to capture any parameter that could cause changes - // in the resulting AWS credentials, to ensure unique keys. +func (c *AWSCredentialsProviderCache) RetrieveCredentials(ctx context.Context, pc *v1beta1.ProviderConfig, region string, awsCredCache *aws.CredentialsCache) (aws.Credentials, error) { + // Only IRSA authentication method credentials are cached currently + if pc.Spec.Credentials.Source != authKeyIRSA { + // skip cache for other/unimplemented credential types + return awsCredCache.Retrieve(ctx) + } + // cache key calculation tries to capture any parameter that + // could cause changes in the resulting AWS credentials, + // to ensure unique keys. // - // Parameters that are directly available in the provider config, will generate - // unique cache keys through UUID and ResourceVersion of the ProviderConfig's - // k8s object, as they change when the provider config is modified. + // Parameters that are directly available in the provider config will + // generate unique cache keys through UUID and ResourceVersion of + // the ProviderConfig's k8s object, as they change when the provider + // config is modified. // - // any other external parameter that have an effect on the resulting credentials - // and does not appear in the ProviderConfig directly (i.e. the same provider config - // content produces a different config), should be included in the cache key + // Any other external parameter that have an effect on the resulting + // credentials and does not appear in the ProviderConfig directly + // (i.e. the same provider config content produces a different config), + // should be included in the cache key. cacheKeyParams := []string{ string(pc.UID), pc.ResourceVersion, - awsCfg.Region, + region, string(pc.Spec.Credentials.Source), } - - // Only IRSA authentication method credentials are cached currently - switch s := pc.Spec.Credentials.Source; s { //nolint:exhaustive - case authKeyIRSA: - tokenHash, err := hashTokenFile(os.Getenv("AWS_WEB_IDENTITY_TOKEN_FILE")) - if err != nil { - return aws.Credentials{}, errors.Wrap(err, "cannot calculate cache key for credentials") - } - cacheKeyParams = append(cacheKeyParams, authKeyIRSA, tokenHash, os.Getenv("AWS_WEB_IDENTITY_TOKEN_FILE"), os.Getenv("AWS_ROLE_ARN")) - default: - c.logger.Debug("skipping cache", "pc", pc.GroupVersionKind().String(), "authSource", s) - // skip cache for other/unimplemented credential types - return awsCfg.Credentials.Retrieve(ctx) + tokenHash, err := hashTokenFile(os.Getenv("AWS_WEB_IDENTITY_TOKEN_FILE")) + if err != nil { + return aws.Credentials{}, errors.Wrap(err, "cannot calculate the hash for the credentials file") } - + cacheKeyParams = append(cacheKeyParams, authKeyIRSA, tokenHash, os.Getenv("AWS_WEB_IDENTITY_TOKEN_FILE"), os.Getenv("AWS_ROLE_ARN")) cacheKey := strings.Join(cacheKeyParams, ":") - c.logger.Debug("checking cache entry", "cacheKey", cacheKey, "pc", pc.GroupVersionKind().String()) + c.logger.Debug("Checking cache entry", "cacheKey", cacheKey, "pc", pc.GroupVersionKind().String()) c.mu.RLock() - cacheEntry, ok := c.cache[cacheKey] + cacheEntry := c.cache[cacheKey] + lastAccess := cacheEntry.AccessedAt c.mu.RUnlock() // TODO: consider implementing a TTL even though the cached entry is valid // cache hit - if ok { - c.logger.Debug("cache hit", "cacheKey", cacheKey, "pc", pc.GroupVersionKind().String()) + if cacheEntry != nil { + c.logger.Debug("Cache hit", "cacheKey", cacheKey, "pc", pc.GroupVersionKind().String()) // since this is a hot-path in the execution, do not always update // the last access times, it is fine to evict the LRU entry on a less // granular precision. - if time.Since(cacheEntry.AccessedAt) > 10*time.Minute { + if time.Since(lastAccess) > 10*time.Minute { c.mu.Lock() cacheEntry.AccessedAt = time.Now() c.mu.Unlock() } - return cacheEntry.credProvider.Retrieve(ctx) + return cacheEntry.awsCredCache.Retrieve(ctx) } // cache miss - c.logger.Debug("cache miss", "cacheKey", cacheKey, "pc", pc.GroupVersionKind().String()) + c.logger.Debug("Cache miss", "cacheKey", cacheKey, "pc", pc.GroupVersionKind().String()) c.mu.Lock() - defer c.mu.Unlock() c.makeRoom() c.cache[cacheKey] = &awsCredentialsProviderCacheEntry{ - credProvider: awsCfg.Credentials, + awsCredCache: awsCredCache, AccessedAt: time.Now(), } - return awsCfg.Credentials.Retrieve(ctx) + c.mu.Unlock() + return awsCredCache.Retrieve(ctx) } // makeRoom ensures that there is at most maxSize-1 elements in the cache map -// so that a new entry can be added. It deletes the object that was last accessed -// before all others. +// so that a new entry can be added. It deletes the object that +// was last accessed before all others. +// This implementation is not thread safe. Callers must properly synchronize. func (c *AWSCredentialsProviderCache) makeRoom() { if 1+len(c.cache) <= c.maxSize { return @@ -172,6 +176,7 @@ func (c *AWSCredentialsProviderCache) makeRoom() { for key, val := range c.cache { if dustiest == "" { dustiest = key + continue } if val.AccessedAt.Before(c.cache[dustiest].AccessedAt) { dustiest = key From a49b39418f718a990f611debbd1d2ec32f27fc2d Mon Sep 17 00:00:00 2001 From: Alper Rifat Ulucinar Date: Tue, 26 Mar 2024 19:17:24 +0300 Subject: [PATCH 3/7] Pass down a configured logger to the credential cache manager - Remove the global variable for the cache manager Signed-off-by: Alper Rifat Ulucinar --- cmd/provider/accessanalyzer/zz_main.go | 6 ++-- cmd/provider/account/zz_main.go | 6 ++-- cmd/provider/acm/zz_main.go | 6 ++-- cmd/provider/acmpca/zz_main.go | 6 ++-- cmd/provider/amp/zz_main.go | 6 ++-- cmd/provider/amplify/zz_main.go | 6 ++-- cmd/provider/apigateway/zz_main.go | 6 ++-- cmd/provider/apigatewayv2/zz_main.go | 6 ++-- cmd/provider/appautoscaling/zz_main.go | 6 ++-- cmd/provider/appconfig/zz_main.go | 6 ++-- cmd/provider/appflow/zz_main.go | 6 ++-- cmd/provider/appintegrations/zz_main.go | 6 ++-- cmd/provider/applicationinsights/zz_main.go | 6 ++-- cmd/provider/appmesh/zz_main.go | 6 ++-- cmd/provider/apprunner/zz_main.go | 6 ++-- cmd/provider/appstream/zz_main.go | 6 ++-- cmd/provider/appsync/zz_main.go | 6 ++-- cmd/provider/athena/zz_main.go | 6 ++-- cmd/provider/autoscaling/zz_main.go | 6 ++-- cmd/provider/autoscalingplans/zz_main.go | 6 ++-- cmd/provider/backup/zz_main.go | 6 ++-- cmd/provider/batch/zz_main.go | 6 ++-- cmd/provider/budgets/zz_main.go | 6 ++-- cmd/provider/ce/zz_main.go | 6 ++-- cmd/provider/chime/zz_main.go | 6 ++-- cmd/provider/cloud9/zz_main.go | 6 ++-- cmd/provider/cloudcontrol/zz_main.go | 6 ++-- cmd/provider/cloudformation/zz_main.go | 6 ++-- cmd/provider/cloudfront/zz_main.go | 6 ++-- cmd/provider/cloudsearch/zz_main.go | 6 ++-- cmd/provider/cloudtrail/zz_main.go | 6 ++-- cmd/provider/cloudwatch/zz_main.go | 6 ++-- cmd/provider/cloudwatchevents/zz_main.go | 6 ++-- cmd/provider/cloudwatchlogs/zz_main.go | 6 ++-- cmd/provider/codecommit/zz_main.go | 6 ++-- cmd/provider/codepipeline/zz_main.go | 6 ++-- cmd/provider/codestarconnections/zz_main.go | 6 ++-- cmd/provider/codestarnotifications/zz_main.go | 6 ++-- cmd/provider/cognitoidentity/zz_main.go | 6 ++-- cmd/provider/cognitoidp/zz_main.go | 6 ++-- cmd/provider/config/zz_main.go | 6 ++-- cmd/provider/configservice/zz_main.go | 6 ++-- cmd/provider/connect/zz_main.go | 6 ++-- cmd/provider/cur/zz_main.go | 6 ++-- cmd/provider/dataexchange/zz_main.go | 6 ++-- cmd/provider/datapipeline/zz_main.go | 6 ++-- cmd/provider/datasync/zz_main.go | 6 ++-- cmd/provider/dax/zz_main.go | 6 ++-- cmd/provider/deploy/zz_main.go | 6 ++-- cmd/provider/detective/zz_main.go | 6 ++-- cmd/provider/devicefarm/zz_main.go | 6 ++-- cmd/provider/directconnect/zz_main.go | 6 ++-- cmd/provider/dlm/zz_main.go | 6 ++-- cmd/provider/dms/zz_main.go | 6 ++-- cmd/provider/docdb/zz_main.go | 6 ++-- cmd/provider/ds/zz_main.go | 6 ++-- cmd/provider/dynamodb/zz_main.go | 6 ++-- cmd/provider/ec2/zz_main.go | 6 ++-- cmd/provider/ecr/zz_main.go | 6 ++-- cmd/provider/ecrpublic/zz_main.go | 6 ++-- cmd/provider/ecs/zz_main.go | 6 ++-- cmd/provider/efs/zz_main.go | 6 ++-- cmd/provider/eks/zz_main.go | 6 ++-- cmd/provider/elasticache/zz_main.go | 6 ++-- cmd/provider/elasticbeanstalk/zz_main.go | 6 ++-- cmd/provider/elasticsearch/zz_main.go | 6 ++-- cmd/provider/elastictranscoder/zz_main.go | 6 ++-- cmd/provider/elb/zz_main.go | 6 ++-- cmd/provider/elbv2/zz_main.go | 6 ++-- cmd/provider/emr/zz_main.go | 6 ++-- cmd/provider/emrserverless/zz_main.go | 6 ++-- cmd/provider/evidently/zz_main.go | 6 ++-- cmd/provider/firehose/zz_main.go | 6 ++-- cmd/provider/fis/zz_main.go | 6 ++-- cmd/provider/fsx/zz_main.go | 6 ++-- cmd/provider/gamelift/zz_main.go | 6 ++-- cmd/provider/glacier/zz_main.go | 6 ++-- cmd/provider/globalaccelerator/zz_main.go | 6 ++-- cmd/provider/glue/zz_main.go | 6 ++-- cmd/provider/grafana/zz_main.go | 6 ++-- cmd/provider/guardduty/zz_main.go | 6 ++-- cmd/provider/iam/zz_main.go | 6 ++-- cmd/provider/identitystore/zz_main.go | 6 ++-- cmd/provider/imagebuilder/zz_main.go | 6 ++-- cmd/provider/inspector/zz_main.go | 6 ++-- cmd/provider/inspector2/zz_main.go | 6 ++-- cmd/provider/iot/zz_main.go | 6 ++-- cmd/provider/ivs/zz_main.go | 6 ++-- cmd/provider/kafka/zz_main.go | 6 ++-- cmd/provider/kendra/zz_main.go | 6 ++-- cmd/provider/keyspaces/zz_main.go | 6 ++-- cmd/provider/kinesis/zz_main.go | 6 ++-- cmd/provider/kinesisanalytics/zz_main.go | 6 ++-- cmd/provider/kinesisanalyticsv2/zz_main.go | 6 ++-- cmd/provider/kinesisvideo/zz_main.go | 6 ++-- cmd/provider/kms/zz_main.go | 6 ++-- cmd/provider/lakeformation/zz_main.go | 6 ++-- cmd/provider/lambda/zz_main.go | 6 ++-- cmd/provider/lexmodels/zz_main.go | 6 ++-- cmd/provider/licensemanager/zz_main.go | 6 ++-- cmd/provider/lightsail/zz_main.go | 6 ++-- cmd/provider/location/zz_main.go | 6 ++-- cmd/provider/macie2/zz_main.go | 6 ++-- cmd/provider/mediaconvert/zz_main.go | 6 ++-- cmd/provider/medialive/zz_main.go | 6 ++-- cmd/provider/mediapackage/zz_main.go | 6 ++-- cmd/provider/mediastore/zz_main.go | 6 ++-- cmd/provider/memorydb/zz_main.go | 6 ++-- cmd/provider/monolith/zz_main.go | 6 ++-- cmd/provider/mq/zz_main.go | 6 ++-- cmd/provider/neptune/zz_main.go | 6 ++-- cmd/provider/networkfirewall/zz_main.go | 6 ++-- cmd/provider/networkmanager/zz_main.go | 6 ++-- cmd/provider/opensearch/zz_main.go | 6 ++-- cmd/provider/opensearchserverless/zz_main.go | 6 ++-- cmd/provider/opsworks/zz_main.go | 6 ++-- cmd/provider/organizations/zz_main.go | 6 ++-- cmd/provider/pinpoint/zz_main.go | 6 ++-- cmd/provider/qldb/zz_main.go | 6 ++-- cmd/provider/quicksight/zz_main.go | 6 ++-- cmd/provider/ram/zz_main.go | 6 ++-- cmd/provider/rds/zz_main.go | 6 ++-- cmd/provider/redshift/zz_main.go | 6 ++-- cmd/provider/redshiftserverless/zz_main.go | 6 ++-- cmd/provider/resourcegroups/zz_main.go | 6 ++-- cmd/provider/rolesanywhere/zz_main.go | 6 ++-- cmd/provider/route53/zz_main.go | 6 ++-- .../route53recoverycontrolconfig/zz_main.go | 6 ++-- .../route53recoveryreadiness/zz_main.go | 6 ++-- cmd/provider/route53resolver/zz_main.go | 6 ++-- cmd/provider/rum/zz_main.go | 6 ++-- cmd/provider/s3/zz_main.go | 6 ++-- cmd/provider/s3control/zz_main.go | 6 ++-- cmd/provider/sagemaker/zz_main.go | 6 ++-- cmd/provider/scheduler/zz_main.go | 6 ++-- cmd/provider/schemas/zz_main.go | 6 ++-- cmd/provider/secretsmanager/zz_main.go | 6 ++-- cmd/provider/securityhub/zz_main.go | 6 ++-- cmd/provider/serverlessrepo/zz_main.go | 6 ++-- cmd/provider/servicecatalog/zz_main.go | 6 ++-- cmd/provider/servicediscovery/zz_main.go | 6 ++-- cmd/provider/servicequotas/zz_main.go | 6 ++-- cmd/provider/ses/zz_main.go | 6 ++-- cmd/provider/sesv2/zz_main.go | 6 ++-- cmd/provider/sfn/zz_main.go | 6 ++-- cmd/provider/signer/zz_main.go | 6 ++-- cmd/provider/simpledb/zz_main.go | 6 ++-- cmd/provider/sns/zz_main.go | 6 ++-- cmd/provider/sqs/zz_main.go | 6 ++-- cmd/provider/ssm/zz_main.go | 6 ++-- cmd/provider/ssoadmin/zz_main.go | 6 ++-- cmd/provider/swf/zz_main.go | 6 ++-- cmd/provider/timestreamwrite/zz_main.go | 6 ++-- cmd/provider/transcribe/zz_main.go | 6 ++-- cmd/provider/transfer/zz_main.go | 6 ++-- cmd/provider/vpc/zz_main.go | 6 ++-- cmd/provider/waf/zz_main.go | 6 ++-- cmd/provider/wafregional/zz_main.go | 6 ++-- cmd/provider/wafv2/zz_main.go | 6 ++-- cmd/provider/workspaces/zz_main.go | 6 ++-- cmd/provider/xray/zz_main.go | 6 ++-- hack/main.go.tmpl | 6 ++-- internal/clients/aws.go | 30 ++++++++----------- internal/clients/creds_cache.go | 4 --- 164 files changed, 660 insertions(+), 346 deletions(-) diff --git a/cmd/provider/accessanalyzer/zz_main.go b/cmd/provider/accessanalyzer/zz_main.go index 02deac5fde..84375f4091 100644 --- a/cmd/provider/accessanalyzer/zz_main.go +++ b/cmd/provider/accessanalyzer/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/account/zz_main.go b/cmd/provider/account/zz_main.go index 3af2dbdee4..bb9f1d39ba 100644 --- a/cmd/provider/account/zz_main.go +++ b/cmd/provider/account/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/acm/zz_main.go b/cmd/provider/acm/zz_main.go index 7a0fd10ce0..e49edf207d 100644 --- a/cmd/provider/acm/zz_main.go +++ b/cmd/provider/acm/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/acmpca/zz_main.go b/cmd/provider/acmpca/zz_main.go index 6962410e68..f80a44db79 100644 --- a/cmd/provider/acmpca/zz_main.go +++ b/cmd/provider/acmpca/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/amp/zz_main.go b/cmd/provider/amp/zz_main.go index ad846bc4c6..16854836c5 100644 --- a/cmd/provider/amp/zz_main.go +++ b/cmd/provider/amp/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/amplify/zz_main.go b/cmd/provider/amplify/zz_main.go index 7d6ce59137..85e4ffe0c5 100644 --- a/cmd/provider/amplify/zz_main.go +++ b/cmd/provider/amplify/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/apigateway/zz_main.go b/cmd/provider/apigateway/zz_main.go index f06a0daa1f..4fa5c69047 100644 --- a/cmd/provider/apigateway/zz_main.go +++ b/cmd/provider/apigateway/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/apigatewayv2/zz_main.go b/cmd/provider/apigatewayv2/zz_main.go index 5e53a78805..ebd11b7e23 100644 --- a/cmd/provider/apigatewayv2/zz_main.go +++ b/cmd/provider/apigatewayv2/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/appautoscaling/zz_main.go b/cmd/provider/appautoscaling/zz_main.go index 25813b218f..7d91f31c4c 100644 --- a/cmd/provider/appautoscaling/zz_main.go +++ b/cmd/provider/appautoscaling/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/appconfig/zz_main.go b/cmd/provider/appconfig/zz_main.go index b470cdfd78..ff0509c69b 100644 --- a/cmd/provider/appconfig/zz_main.go +++ b/cmd/provider/appconfig/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/appflow/zz_main.go b/cmd/provider/appflow/zz_main.go index b9adcde4ed..325f6e9c2c 100644 --- a/cmd/provider/appflow/zz_main.go +++ b/cmd/provider/appflow/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/appintegrations/zz_main.go b/cmd/provider/appintegrations/zz_main.go index 5cfa3b3f66..78365a0207 100644 --- a/cmd/provider/appintegrations/zz_main.go +++ b/cmd/provider/appintegrations/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/applicationinsights/zz_main.go b/cmd/provider/applicationinsights/zz_main.go index 57c24f98e0..ee73fb23b4 100644 --- a/cmd/provider/applicationinsights/zz_main.go +++ b/cmd/provider/applicationinsights/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/appmesh/zz_main.go b/cmd/provider/appmesh/zz_main.go index f3967c8895..fe2e92b628 100644 --- a/cmd/provider/appmesh/zz_main.go +++ b/cmd/provider/appmesh/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/apprunner/zz_main.go b/cmd/provider/apprunner/zz_main.go index 5ac3cb5f46..0192e1abb7 100644 --- a/cmd/provider/apprunner/zz_main.go +++ b/cmd/provider/apprunner/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/appstream/zz_main.go b/cmd/provider/appstream/zz_main.go index a4c76a49c0..0ee919bc0e 100644 --- a/cmd/provider/appstream/zz_main.go +++ b/cmd/provider/appstream/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/appsync/zz_main.go b/cmd/provider/appsync/zz_main.go index 2d2890c9ce..90fdb61ebf 100644 --- a/cmd/provider/appsync/zz_main.go +++ b/cmd/provider/appsync/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/athena/zz_main.go b/cmd/provider/athena/zz_main.go index 9f18be33a6..98fd37eab7 100644 --- a/cmd/provider/athena/zz_main.go +++ b/cmd/provider/athena/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/autoscaling/zz_main.go b/cmd/provider/autoscaling/zz_main.go index 9a5f6b1f93..91fa78d32a 100644 --- a/cmd/provider/autoscaling/zz_main.go +++ b/cmd/provider/autoscaling/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/autoscalingplans/zz_main.go b/cmd/provider/autoscalingplans/zz_main.go index dfa6430bb0..6431788546 100644 --- a/cmd/provider/autoscalingplans/zz_main.go +++ b/cmd/provider/autoscalingplans/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/backup/zz_main.go b/cmd/provider/backup/zz_main.go index 1545c3c891..fcb48afa5a 100644 --- a/cmd/provider/backup/zz_main.go +++ b/cmd/provider/backup/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/batch/zz_main.go b/cmd/provider/batch/zz_main.go index cc3c00f65b..1bbeb24c14 100644 --- a/cmd/provider/batch/zz_main.go +++ b/cmd/provider/batch/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/budgets/zz_main.go b/cmd/provider/budgets/zz_main.go index eb73eb1278..f829919310 100644 --- a/cmd/provider/budgets/zz_main.go +++ b/cmd/provider/budgets/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/ce/zz_main.go b/cmd/provider/ce/zz_main.go index 42bb29458f..f8bad2395e 100644 --- a/cmd/provider/ce/zz_main.go +++ b/cmd/provider/ce/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/chime/zz_main.go b/cmd/provider/chime/zz_main.go index 3f67d157d6..7b939024ef 100644 --- a/cmd/provider/chime/zz_main.go +++ b/cmd/provider/chime/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/cloud9/zz_main.go b/cmd/provider/cloud9/zz_main.go index d3260813f2..a4dbb883d3 100644 --- a/cmd/provider/cloud9/zz_main.go +++ b/cmd/provider/cloud9/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/cloudcontrol/zz_main.go b/cmd/provider/cloudcontrol/zz_main.go index 1bd3eae11c..e8ac15e34b 100644 --- a/cmd/provider/cloudcontrol/zz_main.go +++ b/cmd/provider/cloudcontrol/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/cloudformation/zz_main.go b/cmd/provider/cloudformation/zz_main.go index 86400d61fa..968540ba04 100644 --- a/cmd/provider/cloudformation/zz_main.go +++ b/cmd/provider/cloudformation/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/cloudfront/zz_main.go b/cmd/provider/cloudfront/zz_main.go index e349c9b92b..bc33771e49 100644 --- a/cmd/provider/cloudfront/zz_main.go +++ b/cmd/provider/cloudfront/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/cloudsearch/zz_main.go b/cmd/provider/cloudsearch/zz_main.go index b67b088509..4e1823ff43 100644 --- a/cmd/provider/cloudsearch/zz_main.go +++ b/cmd/provider/cloudsearch/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/cloudtrail/zz_main.go b/cmd/provider/cloudtrail/zz_main.go index 250de2bcc0..81f20ea777 100644 --- a/cmd/provider/cloudtrail/zz_main.go +++ b/cmd/provider/cloudtrail/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/cloudwatch/zz_main.go b/cmd/provider/cloudwatch/zz_main.go index 4321d773cf..5f659a0c68 100644 --- a/cmd/provider/cloudwatch/zz_main.go +++ b/cmd/provider/cloudwatch/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/cloudwatchevents/zz_main.go b/cmd/provider/cloudwatchevents/zz_main.go index 072ea73ff3..80e1064099 100644 --- a/cmd/provider/cloudwatchevents/zz_main.go +++ b/cmd/provider/cloudwatchevents/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/cloudwatchlogs/zz_main.go b/cmd/provider/cloudwatchlogs/zz_main.go index a832a8c727..f9245dfea8 100644 --- a/cmd/provider/cloudwatchlogs/zz_main.go +++ b/cmd/provider/cloudwatchlogs/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/codecommit/zz_main.go b/cmd/provider/codecommit/zz_main.go index ca44b81de2..06be89143b 100644 --- a/cmd/provider/codecommit/zz_main.go +++ b/cmd/provider/codecommit/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/codepipeline/zz_main.go b/cmd/provider/codepipeline/zz_main.go index 4a63db60d0..26dcf933b1 100644 --- a/cmd/provider/codepipeline/zz_main.go +++ b/cmd/provider/codepipeline/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/codestarconnections/zz_main.go b/cmd/provider/codestarconnections/zz_main.go index 8431b91de2..e27f99d7ea 100644 --- a/cmd/provider/codestarconnections/zz_main.go +++ b/cmd/provider/codestarconnections/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/codestarnotifications/zz_main.go b/cmd/provider/codestarnotifications/zz_main.go index 72ded7222f..736dc9ec46 100644 --- a/cmd/provider/codestarnotifications/zz_main.go +++ b/cmd/provider/codestarnotifications/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/cognitoidentity/zz_main.go b/cmd/provider/cognitoidentity/zz_main.go index b62cff1b30..44f49131c9 100644 --- a/cmd/provider/cognitoidentity/zz_main.go +++ b/cmd/provider/cognitoidentity/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/cognitoidp/zz_main.go b/cmd/provider/cognitoidp/zz_main.go index 939be52d7f..126528759f 100644 --- a/cmd/provider/cognitoidp/zz_main.go +++ b/cmd/provider/cognitoidp/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/config/zz_main.go b/cmd/provider/config/zz_main.go index c3f26492b3..1465549f30 100644 --- a/cmd/provider/config/zz_main.go +++ b/cmd/provider/config/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/configservice/zz_main.go b/cmd/provider/configservice/zz_main.go index 0fd7d13e08..9cf9502081 100644 --- a/cmd/provider/configservice/zz_main.go +++ b/cmd/provider/configservice/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/connect/zz_main.go b/cmd/provider/connect/zz_main.go index 47d46e2255..bb2aab1401 100644 --- a/cmd/provider/connect/zz_main.go +++ b/cmd/provider/connect/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/cur/zz_main.go b/cmd/provider/cur/zz_main.go index 79bef875be..b5615607fc 100644 --- a/cmd/provider/cur/zz_main.go +++ b/cmd/provider/cur/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/dataexchange/zz_main.go b/cmd/provider/dataexchange/zz_main.go index b26403a979..c8fab3d52b 100644 --- a/cmd/provider/dataexchange/zz_main.go +++ b/cmd/provider/dataexchange/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/datapipeline/zz_main.go b/cmd/provider/datapipeline/zz_main.go index eccc7f474a..3b35b5e393 100644 --- a/cmd/provider/datapipeline/zz_main.go +++ b/cmd/provider/datapipeline/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/datasync/zz_main.go b/cmd/provider/datasync/zz_main.go index 59b5ee283a..29f9cac04b 100644 --- a/cmd/provider/datasync/zz_main.go +++ b/cmd/provider/datasync/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/dax/zz_main.go b/cmd/provider/dax/zz_main.go index f00f7e999e..cc8fc336f5 100644 --- a/cmd/provider/dax/zz_main.go +++ b/cmd/provider/dax/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/deploy/zz_main.go b/cmd/provider/deploy/zz_main.go index 17a7e8468b..b2a00d3a5e 100644 --- a/cmd/provider/deploy/zz_main.go +++ b/cmd/provider/deploy/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/detective/zz_main.go b/cmd/provider/detective/zz_main.go index 1fbe6d60b5..d2c0ff03e4 100644 --- a/cmd/provider/detective/zz_main.go +++ b/cmd/provider/detective/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/devicefarm/zz_main.go b/cmd/provider/devicefarm/zz_main.go index dcdf998394..1792a10bf5 100644 --- a/cmd/provider/devicefarm/zz_main.go +++ b/cmd/provider/devicefarm/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/directconnect/zz_main.go b/cmd/provider/directconnect/zz_main.go index ceec2f7cb3..137ff67a2f 100644 --- a/cmd/provider/directconnect/zz_main.go +++ b/cmd/provider/directconnect/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/dlm/zz_main.go b/cmd/provider/dlm/zz_main.go index 6fd1ad19c5..d1a82a1b60 100644 --- a/cmd/provider/dlm/zz_main.go +++ b/cmd/provider/dlm/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/dms/zz_main.go b/cmd/provider/dms/zz_main.go index c475f61c53..f4ca041a3e 100644 --- a/cmd/provider/dms/zz_main.go +++ b/cmd/provider/dms/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/docdb/zz_main.go b/cmd/provider/docdb/zz_main.go index 9edc2c2823..641251d751 100644 --- a/cmd/provider/docdb/zz_main.go +++ b/cmd/provider/docdb/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/ds/zz_main.go b/cmd/provider/ds/zz_main.go index 6b5d0a7ec2..6a59beefdf 100644 --- a/cmd/provider/ds/zz_main.go +++ b/cmd/provider/ds/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/dynamodb/zz_main.go b/cmd/provider/dynamodb/zz_main.go index dbf7965d03..32fbed12e3 100644 --- a/cmd/provider/dynamodb/zz_main.go +++ b/cmd/provider/dynamodb/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/ec2/zz_main.go b/cmd/provider/ec2/zz_main.go index 03d80a253b..c69c532405 100644 --- a/cmd/provider/ec2/zz_main.go +++ b/cmd/provider/ec2/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/ecr/zz_main.go b/cmd/provider/ecr/zz_main.go index db29c347ae..2c3df889e7 100644 --- a/cmd/provider/ecr/zz_main.go +++ b/cmd/provider/ecr/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/ecrpublic/zz_main.go b/cmd/provider/ecrpublic/zz_main.go index 2d5e805523..e198b5800f 100644 --- a/cmd/provider/ecrpublic/zz_main.go +++ b/cmd/provider/ecrpublic/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/ecs/zz_main.go b/cmd/provider/ecs/zz_main.go index ead5e8cae8..946d82fef6 100644 --- a/cmd/provider/ecs/zz_main.go +++ b/cmd/provider/ecs/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/efs/zz_main.go b/cmd/provider/efs/zz_main.go index e056d8e7e8..a0e556f3d1 100644 --- a/cmd/provider/efs/zz_main.go +++ b/cmd/provider/efs/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/eks/zz_main.go b/cmd/provider/eks/zz_main.go index b81b6d45c4..1701da4b71 100644 --- a/cmd/provider/eks/zz_main.go +++ b/cmd/provider/eks/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/elasticache/zz_main.go b/cmd/provider/elasticache/zz_main.go index bf44138baa..be2b003174 100644 --- a/cmd/provider/elasticache/zz_main.go +++ b/cmd/provider/elasticache/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/elasticbeanstalk/zz_main.go b/cmd/provider/elasticbeanstalk/zz_main.go index 56aa8d9758..9db9fdc611 100644 --- a/cmd/provider/elasticbeanstalk/zz_main.go +++ b/cmd/provider/elasticbeanstalk/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/elasticsearch/zz_main.go b/cmd/provider/elasticsearch/zz_main.go index c058578b25..c0cb7e148d 100644 --- a/cmd/provider/elasticsearch/zz_main.go +++ b/cmd/provider/elasticsearch/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/elastictranscoder/zz_main.go b/cmd/provider/elastictranscoder/zz_main.go index 2f1293fd75..b87b5a50ee 100644 --- a/cmd/provider/elastictranscoder/zz_main.go +++ b/cmd/provider/elastictranscoder/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/elb/zz_main.go b/cmd/provider/elb/zz_main.go index 5086501669..d602b7aba9 100644 --- a/cmd/provider/elb/zz_main.go +++ b/cmd/provider/elb/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/elbv2/zz_main.go b/cmd/provider/elbv2/zz_main.go index 5fee77b67a..cc70e54f78 100644 --- a/cmd/provider/elbv2/zz_main.go +++ b/cmd/provider/elbv2/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/emr/zz_main.go b/cmd/provider/emr/zz_main.go index cc3a0650da..711168ca38 100644 --- a/cmd/provider/emr/zz_main.go +++ b/cmd/provider/emr/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/emrserverless/zz_main.go b/cmd/provider/emrserverless/zz_main.go index 0858b44931..1f6c809e65 100644 --- a/cmd/provider/emrserverless/zz_main.go +++ b/cmd/provider/emrserverless/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/evidently/zz_main.go b/cmd/provider/evidently/zz_main.go index 18369c98c5..84dafbbfd9 100644 --- a/cmd/provider/evidently/zz_main.go +++ b/cmd/provider/evidently/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/firehose/zz_main.go b/cmd/provider/firehose/zz_main.go index d4a9c10f12..8b9d7786a5 100644 --- a/cmd/provider/firehose/zz_main.go +++ b/cmd/provider/firehose/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/fis/zz_main.go b/cmd/provider/fis/zz_main.go index cc399074b2..38ce733303 100644 --- a/cmd/provider/fis/zz_main.go +++ b/cmd/provider/fis/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/fsx/zz_main.go b/cmd/provider/fsx/zz_main.go index 84e0f6741d..714ffdb18d 100644 --- a/cmd/provider/fsx/zz_main.go +++ b/cmd/provider/fsx/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/gamelift/zz_main.go b/cmd/provider/gamelift/zz_main.go index b72152beb7..89acc335d1 100644 --- a/cmd/provider/gamelift/zz_main.go +++ b/cmd/provider/gamelift/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/glacier/zz_main.go b/cmd/provider/glacier/zz_main.go index 3771d989b6..96673ce091 100644 --- a/cmd/provider/glacier/zz_main.go +++ b/cmd/provider/glacier/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/globalaccelerator/zz_main.go b/cmd/provider/globalaccelerator/zz_main.go index 21e6a4c689..faabd638a0 100644 --- a/cmd/provider/globalaccelerator/zz_main.go +++ b/cmd/provider/globalaccelerator/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/glue/zz_main.go b/cmd/provider/glue/zz_main.go index f7073b93a0..2acee022a8 100644 --- a/cmd/provider/glue/zz_main.go +++ b/cmd/provider/glue/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/grafana/zz_main.go b/cmd/provider/grafana/zz_main.go index ce3816eadf..b1ed97c498 100644 --- a/cmd/provider/grafana/zz_main.go +++ b/cmd/provider/grafana/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/guardduty/zz_main.go b/cmd/provider/guardduty/zz_main.go index 571cf8c45e..bd422d7551 100644 --- a/cmd/provider/guardduty/zz_main.go +++ b/cmd/provider/guardduty/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/iam/zz_main.go b/cmd/provider/iam/zz_main.go index fb5d98034c..2168fd490b 100644 --- a/cmd/provider/iam/zz_main.go +++ b/cmd/provider/iam/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/identitystore/zz_main.go b/cmd/provider/identitystore/zz_main.go index d0f2a6e377..6adc65dfd1 100644 --- a/cmd/provider/identitystore/zz_main.go +++ b/cmd/provider/identitystore/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/imagebuilder/zz_main.go b/cmd/provider/imagebuilder/zz_main.go index e49b7f5e08..603435bb14 100644 --- a/cmd/provider/imagebuilder/zz_main.go +++ b/cmd/provider/imagebuilder/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/inspector/zz_main.go b/cmd/provider/inspector/zz_main.go index e9e7844904..4a5660d91f 100644 --- a/cmd/provider/inspector/zz_main.go +++ b/cmd/provider/inspector/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/inspector2/zz_main.go b/cmd/provider/inspector2/zz_main.go index f90335e493..e15ef819cb 100644 --- a/cmd/provider/inspector2/zz_main.go +++ b/cmd/provider/inspector2/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/iot/zz_main.go b/cmd/provider/iot/zz_main.go index 5550d7d1f9..5f25ca42cb 100644 --- a/cmd/provider/iot/zz_main.go +++ b/cmd/provider/iot/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/ivs/zz_main.go b/cmd/provider/ivs/zz_main.go index be5fa49cec..8c56d55092 100644 --- a/cmd/provider/ivs/zz_main.go +++ b/cmd/provider/ivs/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/kafka/zz_main.go b/cmd/provider/kafka/zz_main.go index ef91477f81..daa741d36b 100644 --- a/cmd/provider/kafka/zz_main.go +++ b/cmd/provider/kafka/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/kendra/zz_main.go b/cmd/provider/kendra/zz_main.go index ff234ecfe6..9de6e6312f 100644 --- a/cmd/provider/kendra/zz_main.go +++ b/cmd/provider/kendra/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/keyspaces/zz_main.go b/cmd/provider/keyspaces/zz_main.go index 2d874ff915..17dc875026 100644 --- a/cmd/provider/keyspaces/zz_main.go +++ b/cmd/provider/keyspaces/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/kinesis/zz_main.go b/cmd/provider/kinesis/zz_main.go index 21e2239887..05a326fd24 100644 --- a/cmd/provider/kinesis/zz_main.go +++ b/cmd/provider/kinesis/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/kinesisanalytics/zz_main.go b/cmd/provider/kinesisanalytics/zz_main.go index ff3ea0285c..2634e6feb3 100644 --- a/cmd/provider/kinesisanalytics/zz_main.go +++ b/cmd/provider/kinesisanalytics/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/kinesisanalyticsv2/zz_main.go b/cmd/provider/kinesisanalyticsv2/zz_main.go index 9e1c747fa5..faa099bc96 100644 --- a/cmd/provider/kinesisanalyticsv2/zz_main.go +++ b/cmd/provider/kinesisanalyticsv2/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/kinesisvideo/zz_main.go b/cmd/provider/kinesisvideo/zz_main.go index dab3e51797..e56377891c 100644 --- a/cmd/provider/kinesisvideo/zz_main.go +++ b/cmd/provider/kinesisvideo/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/kms/zz_main.go b/cmd/provider/kms/zz_main.go index 195a79feae..c86061cb0e 100644 --- a/cmd/provider/kms/zz_main.go +++ b/cmd/provider/kms/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/lakeformation/zz_main.go b/cmd/provider/lakeformation/zz_main.go index ef2b01a1f4..607b615b64 100644 --- a/cmd/provider/lakeformation/zz_main.go +++ b/cmd/provider/lakeformation/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/lambda/zz_main.go b/cmd/provider/lambda/zz_main.go index 9ad0a67a2e..518136641e 100644 --- a/cmd/provider/lambda/zz_main.go +++ b/cmd/provider/lambda/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/lexmodels/zz_main.go b/cmd/provider/lexmodels/zz_main.go index 1f171b734e..08bb2345b9 100644 --- a/cmd/provider/lexmodels/zz_main.go +++ b/cmd/provider/lexmodels/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/licensemanager/zz_main.go b/cmd/provider/licensemanager/zz_main.go index da43d51afd..dcf032d483 100644 --- a/cmd/provider/licensemanager/zz_main.go +++ b/cmd/provider/licensemanager/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/lightsail/zz_main.go b/cmd/provider/lightsail/zz_main.go index 53392fc9b0..91b2bb5375 100644 --- a/cmd/provider/lightsail/zz_main.go +++ b/cmd/provider/lightsail/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/location/zz_main.go b/cmd/provider/location/zz_main.go index d046a2d2bf..afc570ebea 100644 --- a/cmd/provider/location/zz_main.go +++ b/cmd/provider/location/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/macie2/zz_main.go b/cmd/provider/macie2/zz_main.go index a87b028a75..92694b9fb6 100644 --- a/cmd/provider/macie2/zz_main.go +++ b/cmd/provider/macie2/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/mediaconvert/zz_main.go b/cmd/provider/mediaconvert/zz_main.go index 0e32fd2884..5f1fbafa02 100644 --- a/cmd/provider/mediaconvert/zz_main.go +++ b/cmd/provider/mediaconvert/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/medialive/zz_main.go b/cmd/provider/medialive/zz_main.go index 88e9683439..ff5a7628c1 100644 --- a/cmd/provider/medialive/zz_main.go +++ b/cmd/provider/medialive/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/mediapackage/zz_main.go b/cmd/provider/mediapackage/zz_main.go index 0925d64530..fae72387a4 100644 --- a/cmd/provider/mediapackage/zz_main.go +++ b/cmd/provider/mediapackage/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/mediastore/zz_main.go b/cmd/provider/mediastore/zz_main.go index 1062af0e0d..70817e0203 100644 --- a/cmd/provider/mediastore/zz_main.go +++ b/cmd/provider/mediastore/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/memorydb/zz_main.go b/cmd/provider/memorydb/zz_main.go index ce875f39a1..7189680f1d 100644 --- a/cmd/provider/memorydb/zz_main.go +++ b/cmd/provider/memorydb/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/monolith/zz_main.go b/cmd/provider/monolith/zz_main.go index 379b92e6f6..d582d1e3fc 100644 --- a/cmd/provider/monolith/zz_main.go +++ b/cmd/provider/monolith/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -154,7 +153,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/mq/zz_main.go b/cmd/provider/mq/zz_main.go index 1321ff71fc..0650f6053c 100644 --- a/cmd/provider/mq/zz_main.go +++ b/cmd/provider/mq/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/neptune/zz_main.go b/cmd/provider/neptune/zz_main.go index d319e34b84..fb8587956d 100644 --- a/cmd/provider/neptune/zz_main.go +++ b/cmd/provider/neptune/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/networkfirewall/zz_main.go b/cmd/provider/networkfirewall/zz_main.go index 771bd75b5c..0008981f89 100644 --- a/cmd/provider/networkfirewall/zz_main.go +++ b/cmd/provider/networkfirewall/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/networkmanager/zz_main.go b/cmd/provider/networkmanager/zz_main.go index febdfee893..00cc0ba768 100644 --- a/cmd/provider/networkmanager/zz_main.go +++ b/cmd/provider/networkmanager/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/opensearch/zz_main.go b/cmd/provider/opensearch/zz_main.go index f34b54b548..1fc17d82dc 100644 --- a/cmd/provider/opensearch/zz_main.go +++ b/cmd/provider/opensearch/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/opensearchserverless/zz_main.go b/cmd/provider/opensearchserverless/zz_main.go index e6ac3c2ad9..3b5ae62d57 100644 --- a/cmd/provider/opensearchserverless/zz_main.go +++ b/cmd/provider/opensearchserverless/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/opsworks/zz_main.go b/cmd/provider/opsworks/zz_main.go index 304e4d47a1..d0208df62b 100644 --- a/cmd/provider/opsworks/zz_main.go +++ b/cmd/provider/opsworks/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/organizations/zz_main.go b/cmd/provider/organizations/zz_main.go index 05218e1e1c..a2ad532faf 100644 --- a/cmd/provider/organizations/zz_main.go +++ b/cmd/provider/organizations/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/pinpoint/zz_main.go b/cmd/provider/pinpoint/zz_main.go index 5c312530cf..153fca87aa 100644 --- a/cmd/provider/pinpoint/zz_main.go +++ b/cmd/provider/pinpoint/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/qldb/zz_main.go b/cmd/provider/qldb/zz_main.go index a3b0be75d3..2cac58c411 100644 --- a/cmd/provider/qldb/zz_main.go +++ b/cmd/provider/qldb/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/quicksight/zz_main.go b/cmd/provider/quicksight/zz_main.go index 03cad45c73..1994c82fb1 100644 --- a/cmd/provider/quicksight/zz_main.go +++ b/cmd/provider/quicksight/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/ram/zz_main.go b/cmd/provider/ram/zz_main.go index 14c4357deb..85c03715d4 100644 --- a/cmd/provider/ram/zz_main.go +++ b/cmd/provider/ram/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/rds/zz_main.go b/cmd/provider/rds/zz_main.go index 3b65e9c83f..c97c88f3da 100644 --- a/cmd/provider/rds/zz_main.go +++ b/cmd/provider/rds/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/redshift/zz_main.go b/cmd/provider/redshift/zz_main.go index 2e8aec5e07..2917b70424 100644 --- a/cmd/provider/redshift/zz_main.go +++ b/cmd/provider/redshift/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/redshiftserverless/zz_main.go b/cmd/provider/redshiftserverless/zz_main.go index 0b6b0d981f..18835c3331 100644 --- a/cmd/provider/redshiftserverless/zz_main.go +++ b/cmd/provider/redshiftserverless/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/resourcegroups/zz_main.go b/cmd/provider/resourcegroups/zz_main.go index 24da18af95..88b37ed526 100644 --- a/cmd/provider/resourcegroups/zz_main.go +++ b/cmd/provider/resourcegroups/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/rolesanywhere/zz_main.go b/cmd/provider/rolesanywhere/zz_main.go index 392297ec39..fc62167f4b 100644 --- a/cmd/provider/rolesanywhere/zz_main.go +++ b/cmd/provider/rolesanywhere/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/route53/zz_main.go b/cmd/provider/route53/zz_main.go index b3a2d066a1..9a34291614 100644 --- a/cmd/provider/route53/zz_main.go +++ b/cmd/provider/route53/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/route53recoverycontrolconfig/zz_main.go b/cmd/provider/route53recoverycontrolconfig/zz_main.go index 838f35d7c4..383559305f 100644 --- a/cmd/provider/route53recoverycontrolconfig/zz_main.go +++ b/cmd/provider/route53recoverycontrolconfig/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/route53recoveryreadiness/zz_main.go b/cmd/provider/route53recoveryreadiness/zz_main.go index 9e9adcc5fb..1f3daea841 100644 --- a/cmd/provider/route53recoveryreadiness/zz_main.go +++ b/cmd/provider/route53recoveryreadiness/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/route53resolver/zz_main.go b/cmd/provider/route53resolver/zz_main.go index 34cabf7a75..a4cf41b6d4 100644 --- a/cmd/provider/route53resolver/zz_main.go +++ b/cmd/provider/route53resolver/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/rum/zz_main.go b/cmd/provider/rum/zz_main.go index 3575e89f88..310f8d6426 100644 --- a/cmd/provider/rum/zz_main.go +++ b/cmd/provider/rum/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/s3/zz_main.go b/cmd/provider/s3/zz_main.go index 17193eaac7..d5507d585a 100644 --- a/cmd/provider/s3/zz_main.go +++ b/cmd/provider/s3/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/s3control/zz_main.go b/cmd/provider/s3control/zz_main.go index 51ba97c2ae..0f4109fcfe 100644 --- a/cmd/provider/s3control/zz_main.go +++ b/cmd/provider/s3control/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/sagemaker/zz_main.go b/cmd/provider/sagemaker/zz_main.go index 7d69cf69ae..c7c6148a02 100644 --- a/cmd/provider/sagemaker/zz_main.go +++ b/cmd/provider/sagemaker/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/scheduler/zz_main.go b/cmd/provider/scheduler/zz_main.go index 2535dc9994..707d8dd056 100644 --- a/cmd/provider/scheduler/zz_main.go +++ b/cmd/provider/scheduler/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/schemas/zz_main.go b/cmd/provider/schemas/zz_main.go index 23eb3efa30..5768155556 100644 --- a/cmd/provider/schemas/zz_main.go +++ b/cmd/provider/schemas/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/secretsmanager/zz_main.go b/cmd/provider/secretsmanager/zz_main.go index 92a3aedac7..11c3ffe611 100644 --- a/cmd/provider/secretsmanager/zz_main.go +++ b/cmd/provider/secretsmanager/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/securityhub/zz_main.go b/cmd/provider/securityhub/zz_main.go index 83e3371803..7d855a19dc 100644 --- a/cmd/provider/securityhub/zz_main.go +++ b/cmd/provider/securityhub/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/serverlessrepo/zz_main.go b/cmd/provider/serverlessrepo/zz_main.go index 15e3bec2e6..ca8ad2f030 100644 --- a/cmd/provider/serverlessrepo/zz_main.go +++ b/cmd/provider/serverlessrepo/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/servicecatalog/zz_main.go b/cmd/provider/servicecatalog/zz_main.go index 1e80567d07..7acb4ab7f8 100644 --- a/cmd/provider/servicecatalog/zz_main.go +++ b/cmd/provider/servicecatalog/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/servicediscovery/zz_main.go b/cmd/provider/servicediscovery/zz_main.go index 51bc4a2255..fc90a39eda 100644 --- a/cmd/provider/servicediscovery/zz_main.go +++ b/cmd/provider/servicediscovery/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/servicequotas/zz_main.go b/cmd/provider/servicequotas/zz_main.go index 3184b6610f..21b9f2ed74 100644 --- a/cmd/provider/servicequotas/zz_main.go +++ b/cmd/provider/servicequotas/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/ses/zz_main.go b/cmd/provider/ses/zz_main.go index f1a0a67e0d..c57aecbe49 100644 --- a/cmd/provider/ses/zz_main.go +++ b/cmd/provider/ses/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/sesv2/zz_main.go b/cmd/provider/sesv2/zz_main.go index 2e71d7206b..7bb7612ed0 100644 --- a/cmd/provider/sesv2/zz_main.go +++ b/cmd/provider/sesv2/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/sfn/zz_main.go b/cmd/provider/sfn/zz_main.go index c42f6885cb..1295eedd55 100644 --- a/cmd/provider/sfn/zz_main.go +++ b/cmd/provider/sfn/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/signer/zz_main.go b/cmd/provider/signer/zz_main.go index ea52aef9a2..1453109bb7 100644 --- a/cmd/provider/signer/zz_main.go +++ b/cmd/provider/signer/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/simpledb/zz_main.go b/cmd/provider/simpledb/zz_main.go index b9ba9b6d5e..2db70a1e63 100644 --- a/cmd/provider/simpledb/zz_main.go +++ b/cmd/provider/simpledb/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/sns/zz_main.go b/cmd/provider/sns/zz_main.go index 557da8718a..199c2f5095 100644 --- a/cmd/provider/sns/zz_main.go +++ b/cmd/provider/sns/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/sqs/zz_main.go b/cmd/provider/sqs/zz_main.go index 60e53635f4..eb7d60e35a 100644 --- a/cmd/provider/sqs/zz_main.go +++ b/cmd/provider/sqs/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/ssm/zz_main.go b/cmd/provider/ssm/zz_main.go index 7484ca37a1..ee7c6c7d87 100644 --- a/cmd/provider/ssm/zz_main.go +++ b/cmd/provider/ssm/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/ssoadmin/zz_main.go b/cmd/provider/ssoadmin/zz_main.go index d5f79c943b..2c81594ad6 100644 --- a/cmd/provider/ssoadmin/zz_main.go +++ b/cmd/provider/ssoadmin/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/swf/zz_main.go b/cmd/provider/swf/zz_main.go index d58b923d95..6b168f21e6 100644 --- a/cmd/provider/swf/zz_main.go +++ b/cmd/provider/swf/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/timestreamwrite/zz_main.go b/cmd/provider/timestreamwrite/zz_main.go index 6616cf269e..06f378fab0 100644 --- a/cmd/provider/timestreamwrite/zz_main.go +++ b/cmd/provider/timestreamwrite/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/transcribe/zz_main.go b/cmd/provider/transcribe/zz_main.go index 9a9fa86e87..64319a0088 100644 --- a/cmd/provider/transcribe/zz_main.go +++ b/cmd/provider/transcribe/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/transfer/zz_main.go b/cmd/provider/transfer/zz_main.go index 4cce0b18a6..4502a9c093 100644 --- a/cmd/provider/transfer/zz_main.go +++ b/cmd/provider/transfer/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/vpc/zz_main.go b/cmd/provider/vpc/zz_main.go index 6451f726ff..2021f71c57 100644 --- a/cmd/provider/vpc/zz_main.go +++ b/cmd/provider/vpc/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/waf/zz_main.go b/cmd/provider/waf/zz_main.go index fcc6fdb305..29b0aebf11 100644 --- a/cmd/provider/waf/zz_main.go +++ b/cmd/provider/waf/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/wafregional/zz_main.go b/cmd/provider/wafregional/zz_main.go index 3d79385601..934af6b3c6 100644 --- a/cmd/provider/wafregional/zz_main.go +++ b/cmd/provider/wafregional/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/wafv2/zz_main.go b/cmd/provider/wafv2/zz_main.go index 064da51c04..2e51790e41 100644 --- a/cmd/provider/wafv2/zz_main.go +++ b/cmd/provider/wafv2/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/workspaces/zz_main.go b/cmd/provider/workspaces/zz_main.go index d36dc50b9d..fd41f66911 100644 --- a/cmd/provider/workspaces/zz_main.go +++ b/cmd/provider/workspaces/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/cmd/provider/xray/zz_main.go b/cmd/provider/xray/zz_main.go index e0bc9773ea..e14194a390 100644 --- a/cmd/provider/xray/zz_main.go +++ b/cmd/provider/xray/zz_main.go @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -149,7 +148,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/hack/main.go.tmpl b/hack/main.go.tmpl index 29dc60db6f..1ba49697d9 100644 --- a/hack/main.go.tmpl +++ b/hack/main.go.tmpl @@ -84,7 +84,6 @@ func main() { _ = app.Flag("terraform-native-provider-path", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform native provider path for shared execution.").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").Hidden().Action(deprecationAction("terraform-native-provider-path")).String() _ = app.Flag("terraform-provider-source", "[DEPRECATED: This option is no longer used and it will be removed in a future release.] Terraform provider source.").Envar("TERRAFORM_PROVIDER_SOURCE").Hidden().Action(deprecationAction("terraform-provider-source")).String() ) - setupConfig := &clients.SetupConfig{} kingpin.MustParse(app.Parse(os.Args[1:])) log.Default().SetOutput(io.Discard) ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) @@ -154,7 +153,10 @@ func main() { ctx := context.Background() provider, err := config.GetProvider(ctx, false) kingpin.FatalIfError(err, "Cannot initialize the provider configuration") - setupConfig.TerraformProvider = provider.TerraformProvider + setupConfig := &clients.SetupConfig{ + Logger: logr, + TerraformProvider: provider.TerraformProvider, + } o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: logr, diff --git a/internal/clients/aws.go b/internal/clients/aws.go index 8e6e5f706c..727b83264a 100644 --- a/internal/clients/aws.go +++ b/internal/clients/aws.go @@ -33,10 +33,11 @@ const ( type SetupConfig struct { TerraformProvider *schema.Provider - logger logging.Logger + Logger logging.Logger } func SelectTerraformSetup(config *SetupConfig) terraform.SetupFn { // nolint:gocyclo + credsCache := NewAWSCredentialsProviderCache(WithCacheLogger(config.Logger)) return func(ctx context.Context, c client.Client, mg resource.Managed) (terraform.Setup, error) { pc := &v1beta1.ProviderConfig{} if err := c.Get(ctx, types.NamespacedName{Name: mg.GetProviderConfigReference().Name}, pc); err != nil { @@ -55,9 +56,17 @@ func SelectTerraformSetup(config *SetupConfig) terraform.SetupFn { // nolint:goc return terraform.Setup{}, errors.Wrap(err, "obtained aws config cannot be nil") } - creds, err := retrieveCredentials(ctx, pc, awsCfg, config.logger) + var creds aws.Credentials + if awsCredCache, ok := awsCfg.Credentials.(*aws.CredentialsCache); ok { + // only IRSA auth credentials are cached, other auth methods will skip + // the cache and call the downstream CredentialsCache.Retrieve() + creds, err = credsCache.RetrieveCredentials(ctx, pc, awsCfg.Region, awsCredCache) + } else { + config.Logger.Debug("Configured aws.CredentialProvider is not an aws.CredentialCache, skipping the provider credential cache...") + creds, err = awsCfg.Credentials.Retrieve(ctx) + } if err != nil { - return terraform.Setup{}, errors.Wrap(err, "failed to retrieve aws credentials from aws config") + return terraform.Setup{}, errors.Wrap(err, "failed to retrieve aws credentials") } account := "000000000" @@ -81,21 +90,6 @@ func SelectTerraformSetup(config *SetupConfig) terraform.SetupFn { // nolint:goc } } -// retrieveCredentials asserts that the configured aws.CredentialsProvider -// is a *aws.CredentialCache and retrieves the credentials via the -// credential cache. If not, it retrieves the credentials via the -// aws.CredentialProvider directly. -func retrieveCredentials(ctx context.Context, pc *v1beta1.ProviderConfig, awsConfig *aws.Config, logr logging.Logger) (aws.Credentials, error) { - awsCredCache, ok := awsConfig.Credentials.(*aws.CredentialsCache) - if !ok { - logr.Debug("CredentialProvider is not an aws.CredentialCache, skipping the credential cache...") - return awsConfig.Credentials.Retrieve(ctx) - } - // only IRSA auth credentials are cached, other auth methods will skip - // the cache and call the downstream CredentialsCache.Retrieve() - return GlobalAWSCredentialsProviderCache.RetrieveCredentials(ctx, pc, awsConfig.Region, awsCredCache) -} - // getAccountId retrieves the account ID associated with the given credentials. // Results are cached. func getAccountId(ctx context.Context, cfg *aws.Config, creds aws.Credentials) (string, error) { diff --git a/internal/clients/creds_cache.go b/internal/clients/creds_cache.go index 88a1c8abeb..1bfd916f8e 100644 --- a/internal/clients/creds_cache.go +++ b/internal/clients/creds_cache.go @@ -22,10 +22,6 @@ import ( "github.com/upbound/provider-aws/apis/v1beta1" ) -// GlobalAWSCredentialsProviderCache is a global AWS CredentialsProvider cache -// to be used by all controllers. -var GlobalAWSCredentialsProviderCache = NewAWSCredentialsProviderCache() - // AWSCredentialsProviderCacheOption lets you configure // a *GlobalAWSCredentialsProviderCache. type AWSCredentialsProviderCacheOption func(cache *AWSCredentialsProviderCache) From aa64044f170d546d0403ecaea3f8fc981ef16658 Mon Sep 17 00:00:00 2001 From: Alper Rifat Ulucinar Date: Tue, 26 Mar 2024 20:12:22 +0300 Subject: [PATCH 4/7] Do not use a pointer type for the provider cache entries Signed-off-by: Alper Rifat Ulucinar --- internal/clients/creds_cache.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/clients/creds_cache.go b/internal/clients/creds_cache.go index 1bfd916f8e..6c8bdfff58 100644 --- a/internal/clients/creds_cache.go +++ b/internal/clients/creds_cache.go @@ -36,7 +36,7 @@ func WithCacheMaxSize(n int) AWSCredentialsProviderCacheOption { // WithCacheStore lets you bootstrap AWS CredentialsProvider Cache with // your own cache. -func WithCacheStore(cache map[string]*awsCredentialsProviderCacheEntry) AWSCredentialsProviderCacheOption { +func WithCacheStore(cache map[string]awsCredentialsProviderCacheEntry) AWSCredentialsProviderCacheOption { return func(c *AWSCredentialsProviderCache) { c.cache = cache } @@ -53,7 +53,7 @@ func WithCacheLogger(l logging.Logger) AWSCredentialsProviderCacheOption { // *AWSCredentialsProviderCache with the default GetAWSConfig method. func NewAWSCredentialsProviderCache(opts ...AWSCredentialsProviderCacheOption) *AWSCredentialsProviderCache { c := &AWSCredentialsProviderCache{ - cache: map[string]*awsCredentialsProviderCacheEntry{}, + cache: map[string]awsCredentialsProviderCacheEntry{}, maxSize: 100, mu: &sync.RWMutex{}, logger: logging.NewNopLogger(), @@ -79,7 +79,7 @@ type AWSCredentialsProviderCache struct { // provider configuration. Key content includes the ProviderConfig's UUID // and ResourceVersion and additional fields depending on the auth method // (currently only IRSA temporary credential caching is supported). - cache map[string]*awsCredentialsProviderCacheEntry + cache map[string]awsCredentialsProviderCacheEntry // maxSize is the maximum number of elements this cache can ever have. maxSize int @@ -129,20 +129,20 @@ func (c *AWSCredentialsProviderCache) RetrieveCredentials(ctx context.Context, p cacheKey := strings.Join(cacheKeyParams, ":") c.logger.Debug("Checking cache entry", "cacheKey", cacheKey, "pc", pc.GroupVersionKind().String()) c.mu.RLock() - cacheEntry := c.cache[cacheKey] - lastAccess := cacheEntry.AccessedAt + cacheEntry, ok := c.cache[cacheKey] c.mu.RUnlock() // TODO: consider implementing a TTL even though the cached entry is valid // cache hit - if cacheEntry != nil { + if ok { c.logger.Debug("Cache hit", "cacheKey", cacheKey, "pc", pc.GroupVersionKind().String()) // since this is a hot-path in the execution, do not always update // the last access times, it is fine to evict the LRU entry on a less // granular precision. - if time.Since(lastAccess) > 10*time.Minute { + if time.Since(cacheEntry.AccessedAt) > 10*time.Minute { c.mu.Lock() cacheEntry.AccessedAt = time.Now() + c.cache[cacheKey] = cacheEntry c.mu.Unlock() } return cacheEntry.awsCredCache.Retrieve(ctx) @@ -152,7 +152,7 @@ func (c *AWSCredentialsProviderCache) RetrieveCredentials(ctx context.Context, p c.logger.Debug("Cache miss", "cacheKey", cacheKey, "pc", pc.GroupVersionKind().String()) c.mu.Lock() c.makeRoom() - c.cache[cacheKey] = &awsCredentialsProviderCacheEntry{ + c.cache[cacheKey] = awsCredentialsProviderCacheEntry{ awsCredCache: awsCredCache, AccessedAt: time.Now(), } From 3eeff4ac1d92f87d55e073b3a7655522f4b339e2 Mon Sep 17 00:00:00 2001 From: Alper Rifat Ulucinar Date: Wed, 27 Mar 2024 03:52:54 +0300 Subject: [PATCH 5/7] Remove the duplicate authentication scheme name (IRSA) from the credential cache key. Signed-off-by: Alper Rifat Ulucinar --- internal/clients/creds_cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/clients/creds_cache.go b/internal/clients/creds_cache.go index 6c8bdfff58..ea001f76fc 100644 --- a/internal/clients/creds_cache.go +++ b/internal/clients/creds_cache.go @@ -125,7 +125,7 @@ func (c *AWSCredentialsProviderCache) RetrieveCredentials(ctx context.Context, p if err != nil { return aws.Credentials{}, errors.Wrap(err, "cannot calculate the hash for the credentials file") } - cacheKeyParams = append(cacheKeyParams, authKeyIRSA, tokenHash, os.Getenv("AWS_WEB_IDENTITY_TOKEN_FILE"), os.Getenv("AWS_ROLE_ARN")) + cacheKeyParams = append(cacheKeyParams, tokenHash, os.Getenv("AWS_WEB_IDENTITY_TOKEN_FILE"), os.Getenv("AWS_ROLE_ARN")) cacheKey := strings.Join(cacheKeyParams, ":") c.logger.Debug("Checking cache entry", "cacheKey", cacheKey, "pc", pc.GroupVersionKind().String()) c.mu.RLock() From 54ea2cec3101961d60d2a778fe7f19739932ab94 Mon Sep 17 00:00:00 2001 From: Alper Rifat Ulucinar Date: Wed, 27 Mar 2024 13:15:06 +0300 Subject: [PATCH 6/7] Prevent multiple temp credential retrievals on concurrent credential cache misses Signed-off-by: Alper Rifat Ulucinar --- internal/clients/creds_cache.go | 38 ++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/internal/clients/creds_cache.go b/internal/clients/creds_cache.go index ea001f76fc..d46f96655f 100644 --- a/internal/clients/creds_cache.go +++ b/internal/clients/creds_cache.go @@ -13,6 +13,7 @@ import ( "path/filepath" "strings" "sync" + "sync/atomic" "time" "github.com/aws/aws-sdk-go-v2/aws" @@ -36,7 +37,7 @@ func WithCacheMaxSize(n int) AWSCredentialsProviderCacheOption { // WithCacheStore lets you bootstrap AWS CredentialsProvider Cache with // your own cache. -func WithCacheStore(cache map[string]awsCredentialsProviderCacheEntry) AWSCredentialsProviderCacheOption { +func WithCacheStore(cache map[string]*awsCredentialsProviderCacheEntry) AWSCredentialsProviderCacheOption { return func(c *AWSCredentialsProviderCache) { c.cache = cache } @@ -53,7 +54,7 @@ func WithCacheLogger(l logging.Logger) AWSCredentialsProviderCacheOption { // *AWSCredentialsProviderCache with the default GetAWSConfig method. func NewAWSCredentialsProviderCache(opts ...AWSCredentialsProviderCacheOption) *AWSCredentialsProviderCache { c := &AWSCredentialsProviderCache{ - cache: map[string]awsCredentialsProviderCacheEntry{}, + cache: map[string]*awsCredentialsProviderCacheEntry{}, maxSize: 100, mu: &sync.RWMutex{}, logger: logging.NewNopLogger(), @@ -79,7 +80,7 @@ type AWSCredentialsProviderCache struct { // provider configuration. Key content includes the ProviderConfig's UUID // and ResourceVersion and additional fields depending on the auth method // (currently only IRSA temporary credential caching is supported). - cache map[string]awsCredentialsProviderCacheEntry + cache map[string]*awsCredentialsProviderCacheEntry // maxSize is the maximum number of elements this cache can ever have. maxSize int @@ -93,7 +94,7 @@ type AWSCredentialsProviderCache struct { type awsCredentialsProviderCacheEntry struct { awsCredCache *aws.CredentialsCache - AccessedAt time.Time + AccessedAt atomic.Value } func (c *AWSCredentialsProviderCache) RetrieveCredentials(ctx context.Context, pc *v1beta1.ProviderConfig, region string, awsCredCache *aws.CredentialsCache) (aws.Credentials, error) { @@ -139,25 +140,28 @@ func (c *AWSCredentialsProviderCache) RetrieveCredentials(ctx context.Context, p // since this is a hot-path in the execution, do not always update // the last access times, it is fine to evict the LRU entry on a less // granular precision. - if time.Since(cacheEntry.AccessedAt) > 10*time.Minute { - c.mu.Lock() - cacheEntry.AccessedAt = time.Now() - c.cache[cacheKey] = cacheEntry - c.mu.Unlock() + if time.Since(cacheEntry.AccessedAt.Load().(time.Time)) > 10*time.Minute { + cacheEntry.AccessedAt.Store(time.Now()) } return cacheEntry.awsCredCache.Retrieve(ctx) } - // cache miss - c.logger.Debug("Cache miss", "cacheKey", cacheKey, "pc", pc.GroupVersionKind().String()) c.mu.Lock() - c.makeRoom() - c.cache[cacheKey] = awsCredentialsProviderCacheEntry{ - awsCredCache: awsCredCache, - AccessedAt: time.Now(), + // we need to recheck the cache because it might have already been + // populated. + cacheEntry, ok = c.cache[cacheKey] + if !ok { + // cache miss + c.logger.Debug("Cache miss", "cacheKey", cacheKey, "pc", pc.GroupVersionKind().String(), "cacheSize", len(c.cache)) + c.makeRoom() + cacheEntry = &awsCredentialsProviderCacheEntry{ + awsCredCache: awsCredCache, + } + cacheEntry.AccessedAt.Store(time.Now()) + c.cache[cacheKey] = cacheEntry } c.mu.Unlock() - return awsCredCache.Retrieve(ctx) + return cacheEntry.awsCredCache.Retrieve(ctx) } // makeRoom ensures that there is at most maxSize-1 elements in the cache map @@ -174,7 +178,7 @@ func (c *AWSCredentialsProviderCache) makeRoom() { dustiest = key continue } - if val.AccessedAt.Before(c.cache[dustiest].AccessedAt) { + if val.AccessedAt.Load().(time.Time).Before(c.cache[dustiest].AccessedAt.Load().(time.Time)) { dustiest = key } } From 0fbbf02b3656352c729396851646d12ef80a1496 Mon Sep 17 00:00:00 2001 From: Alper Rifat Ulucinar Date: Thu, 28 Mar 2024 04:14:47 +0300 Subject: [PATCH 7/7] Cache the AWS account ID in the provider credential cache for IRSA authentication Signed-off-by: Alper Rifat Ulucinar --- internal/clients/aws.go | 49 ++++++++++------ internal/clients/creds_cache.go | 101 +++++++++++++++++++++++++++----- 2 files changed, 117 insertions(+), 33 deletions(-) diff --git a/internal/clients/aws.go b/internal/clients/aws.go index 727b83264a..26825b443b 100644 --- a/internal/clients/aws.go +++ b/internal/clients/aws.go @@ -10,6 +10,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" + "github.com/aws/aws-sdk-go-v2/service/sts" awsrequest "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/smithy-go/middleware" "github.com/crossplane/crossplane-runtime/pkg/logging" @@ -27,8 +28,9 @@ import ( ) const ( - keyAccountID = "account_id" - keyRegion = "region" + keyAccountID = "account_id" + keyRegion = "region" + localstackAccountID = "000000000" ) type SetupConfig struct { @@ -56,28 +58,41 @@ func SelectTerraformSetup(config *SetupConfig) terraform.SetupFn { // nolint:goc return terraform.Setup{}, errors.Wrap(err, "obtained aws config cannot be nil") } - var creds aws.Credentials - if awsCredCache, ok := awsCfg.Credentials.(*aws.CredentialsCache); ok { - // only IRSA auth credentials are cached, other auth methods will skip - // the cache and call the downstream CredentialsCache.Retrieve() - creds, err = credsCache.RetrieveCredentials(ctx, pc, awsCfg.Region, awsCredCache) - } else { - config.Logger.Debug("Configured aws.CredentialProvider is not an aws.CredentialCache, skipping the provider credential cache...") - creds, err = awsCfg.Credentials.Retrieve(ctx) - } + // only IRSA auth credentials are currently cached, other auth methods + // will skip the cache and call the downstream + // CredentialsProvider.Retrieve(). + credCache, err := credsCache.RetrieveCredentials(ctx, pc, awsCfg.Region, awsCfg.Credentials, func(ctx context.Context) (string, error) { + if pc.Spec.SkipCredsValidation { + // then we do not try to resolve the account ID and instead, + // return a constant value as before. + return localstackAccountID, nil + } + o, err := sts.NewFromConfig(*awsCfg).GetCallerIdentity(ctx, &sts.GetCallerIdentityInput{}) + if err != nil { + return "", errors.Wrap(err, errGetCallerIdentityFailed) + } + return *o.Account, nil + }) if err != nil { - return terraform.Setup{}, errors.Wrap(err, "failed to retrieve aws credentials") + return terraform.Setup{}, errors.Wrap(err, "cache manager failure") } - account := "000000000" - if !pc.Spec.SkipCredsValidation { - account, err = getAccountId(ctx, awsCfg, creds) + // if we are to retrieve the AWS account ID and if we have not already + // retrieved it via the credential cache, then we will utilize the + // identity cache. + // TODO: Replace the identity cache with the credential cache. + if !pc.Spec.SkipCredsValidation && credCache.accountID == "" { + credCache.accountID, err = getAccountId(ctx, awsCfg, credCache.creds) if err != nil { return terraform.Setup{}, errors.Wrap(err, "cannot get account id") } } + // just in case the localstack implementation relies on this... + if credCache.accountID == "" { + credCache.accountID = localstackAccountID + } ps.ClientMetadata = map[string]string{ - keyAccountID: account, + keyAccountID: credCache.accountID, } // several external name configs depend on the setup.Configuration for templating region ps.Configuration = map[string]any{ @@ -86,7 +101,7 @@ func SelectTerraformSetup(config *SetupConfig) terraform.SetupFn { // nolint:goc if config.TerraformProvider == nil { return terraform.Setup{}, errors.New("terraform provider cannot be nil") } - return ps, errors.Wrap(configureNoForkAWSClient(ctx, &ps, config, awsCfg.Region, creds, pc), "could not configure the no-fork AWS client") + return ps, errors.Wrap(configureNoForkAWSClient(ctx, &ps, config, awsCfg.Region, credCache.creds, pc), "could not configure the no-fork AWS client") } } diff --git a/internal/clients/creds_cache.go b/internal/clients/creds_cache.go index d46f96655f..c38a3fa42a 100644 --- a/internal/clients/creds_cache.go +++ b/internal/clients/creds_cache.go @@ -23,6 +23,10 @@ import ( "github.com/upbound/provider-aws/apis/v1beta1" ) +const ( + errGetAccountID = "cannot retrieve the AWS account ID" +) + // AWSCredentialsProviderCacheOption lets you configure // a *GlobalAWSCredentialsProviderCache. type AWSCredentialsProviderCacheOption func(cache *AWSCredentialsProviderCache) @@ -94,14 +98,72 @@ type AWSCredentialsProviderCache struct { type awsCredentialsProviderCacheEntry struct { awsCredCache *aws.CredentialsCache - AccessedAt atomic.Value + accessedAt atomic.Value + accountID atomic.Value } -func (c *AWSCredentialsProviderCache) RetrieveCredentials(ctx context.Context, pc *v1beta1.ProviderConfig, region string, awsCredCache *aws.CredentialsCache) (aws.Credentials, error) { - // Only IRSA authentication method credentials are cached currently - if pc.Spec.Credentials.Source != authKeyIRSA { - // skip cache for other/unimplemented credential types - return awsCredCache.Retrieve(ctx) +// AccountIDFn is a function for retrieving the account ID. +type AccountIDFn func(ctx context.Context) (string, error) + +func accountIDFromCacheEntry(e *awsCredentialsProviderCacheEntry) AccountIDFn { + return func(context.Context) (string, error) { + // return the cached account ID + return e.accountID.Load().(string), nil + } +} + +// Credentials holds the aws.Credentials and the associated AWS account ID for +// these credentials. It's possible that the account ID is not resolved and +// only the aws.Credentials are available in a successful result. +type Credentials struct { + creds aws.Credentials + accountID string +} + +// newCredentials returns the Credentials whose credentials are retrieved +// using the given aws.CredentialsProvider and whose account ID is set using +// the given AccountIDFn. +func newCredentials(ctx context.Context, credsProvider aws.CredentialsProvider, accountIDFn AccountIDFn) (Credentials, error) { + var result Credentials + // try to retrieve the credentials if a retriever has been supplied + if credsProvider != nil { + var err error + if result.creds, err = credsProvider.Retrieve(ctx); err != nil { + return Credentials{}, errors.Wrap(err, "cannot retrieve the AWS credentials") + } + } + // try to get the account ID + if accountIDFn != nil { + var err error + if result.accountID, err = accountIDFn(ctx); err != nil { + return Credentials{}, errors.Wrap(err, errGetAccountID) + } + } + return result, nil +} + +// RetrieveCredentials returns a Credentials either from the credential cache. +// If the authentication scheme is IRSA and the supplied +// aws.CredentialsProvider implementation is an aws.CredentialsCache, then the +// retrieved credentials and the account ID are cached for future requests. +// Otherwise, this function returns the AWS credentials by calling +// the downstream aws.CredentialsProvider.Retrieve, and for now, does *not* +// call the given AccountIDFn because in that case, a separate identity cache +// should be used to retrieve the caller identity. +func (c *AWSCredentialsProviderCache) RetrieveCredentials(ctx context.Context, pc *v1beta1.ProviderConfig, region string, credsProvider aws.CredentialsProvider, accountIDFn AccountIDFn) (Credentials, error) { + // Only IRSA credentials are cached currently and + // only aws.CredentialsCache is supported as the underlying + // credential provider. + awsCredsCache, ok := credsProvider.(*aws.CredentialsCache) + if !ok { + c.logger.Debug("Configured aws.CredentialsProvider is not an aws.CredentialsCache, cannot utilize the provider credential cache...") + } + if pc.Spec.Credentials.Source != authKeyIRSA || !ok { + // if this cache manager is not going to be employed, do not call + // the given accountIDFn because there's a separate identity cache + // implementation. + // TODO: Replace the identity cache with this cache. + return newCredentials(ctx, credsProvider, nil) } // cache key calculation tries to capture any parameter that // could cause changes in the resulting AWS credentials, @@ -124,7 +186,7 @@ func (c *AWSCredentialsProviderCache) RetrieveCredentials(ctx context.Context, p } tokenHash, err := hashTokenFile(os.Getenv("AWS_WEB_IDENTITY_TOKEN_FILE")) if err != nil { - return aws.Credentials{}, errors.Wrap(err, "cannot calculate the hash for the credentials file") + return Credentials{}, errors.Wrap(err, "cannot calculate the hash for the credentials file") } cacheKeyParams = append(cacheKeyParams, tokenHash, os.Getenv("AWS_WEB_IDENTITY_TOKEN_FILE"), os.Getenv("AWS_ROLE_ARN")) cacheKey := strings.Join(cacheKeyParams, ":") @@ -140,13 +202,14 @@ func (c *AWSCredentialsProviderCache) RetrieveCredentials(ctx context.Context, p // since this is a hot-path in the execution, do not always update // the last access times, it is fine to evict the LRU entry on a less // granular precision. - if time.Since(cacheEntry.AccessedAt.Load().(time.Time)) > 10*time.Minute { - cacheEntry.AccessedAt.Store(time.Now()) + if time.Since(cacheEntry.accessedAt.Load().(time.Time)) > 10*time.Minute { + cacheEntry.accessedAt.Store(time.Now()) } - return cacheEntry.awsCredCache.Retrieve(ctx) + return newCredentials(ctx, cacheEntry.awsCredCache, accountIDFromCacheEntry(cacheEntry)) } c.mu.Lock() + defer c.mu.Unlock() // we need to recheck the cache because it might have already been // populated. cacheEntry, ok = c.cache[cacheKey] @@ -155,13 +218,17 @@ func (c *AWSCredentialsProviderCache) RetrieveCredentials(ctx context.Context, p c.logger.Debug("Cache miss", "cacheKey", cacheKey, "pc", pc.GroupVersionKind().String(), "cacheSize", len(c.cache)) c.makeRoom() cacheEntry = &awsCredentialsProviderCacheEntry{ - awsCredCache: awsCredCache, + awsCredCache: awsCredsCache, + } + id, err := accountIDFn(ctx) + if err != nil { + return Credentials{}, errors.Wrap(err, errGetAccountID) } - cacheEntry.AccessedAt.Store(time.Now()) + cacheEntry.accountID.Store(id) + cacheEntry.accessedAt.Store(time.Now()) c.cache[cacheKey] = cacheEntry } - c.mu.Unlock() - return cacheEntry.awsCredCache.Retrieve(ctx) + return newCredentials(ctx, cacheEntry.awsCredCache, accountIDFromCacheEntry(cacheEntry)) } // makeRoom ensures that there is at most maxSize-1 elements in the cache map @@ -178,7 +245,7 @@ func (c *AWSCredentialsProviderCache) makeRoom() { dustiest = key continue } - if val.AccessedAt.Load().(time.Time).Before(c.cache[dustiest].AccessedAt.Load().(time.Time)) { + if val.accessedAt.Load().(time.Time).Before(c.cache[dustiest].accessedAt.Load().(time.Time)) { dustiest = key } } @@ -195,7 +262,9 @@ func hashTokenFile(filename string) (string, error) { if err != nil { return "", err } - defer file.Close() //nolint:errcheck + defer func() { + _ = file.Close() + }() hash := sha256.New() if _, err = io.Copy(hash, file); err != nil {