From 627f9b1a00df20025fcea9ccbed7e380e9a1a2a4 Mon Sep 17 00:00:00 2001 From: John Gardiner Myers Date: Wed, 27 Sep 2023 23:21:33 -0700 Subject: [PATCH] Remove the --run-aws-provider-as-webhook flag --- main.go | 22 +--------------------- pkg/apis/externaldns/types.go | 2 -- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/main.go b/main.go index 3a801dce66..5c3bac76e7 100644 --- a/main.go +++ b/main.go @@ -193,7 +193,7 @@ func main() { zoneTagFilter := provider.NewZoneTagFilter(cfg.AWSZoneTagFilter) var awsSession *session.Session - if cfg.Provider == "aws" || cfg.Provider == "aws-sd" || cfg.Registry == "dynamodb" || cfg.RunAWSProviderAsWebhook { + if cfg.Provider == "aws" || cfg.Provider == "aws-sd" || cfg.Registry == "dynamodb" { awsSession, err = aws.NewSession( aws.AWSSessionConfig{ AssumeRole: cfg.AWSAssumeRole, @@ -404,26 +404,6 @@ func main() { case "tencentcloud": p, err = tencentcloud.NewTencentCloudProvider(domainFilter, zoneIDFilter, cfg.TencentCloudConfigFile, cfg.TencentCloudZoneType, cfg.DryRun) case "webhook": - startedChan := make(chan struct{}) - if cfg.RunAWSProviderAsWebhook { - awsProvider, awsErr := aws.NewAWSProvider(aws.AWSConfig{ - DomainFilter: domainFilter, - ZoneIDFilter: zoneIDFilter, - ZoneTypeFilter: zoneTypeFilter, - ZoneTagFilter: zoneTagFilter, - BatchChangeSize: cfg.AWSBatchChangeSize, - BatchChangeInterval: cfg.AWSBatchChangeInterval, - EvaluateTargetHealth: cfg.AWSEvaluateTargetHealth, - PreferCNAME: cfg.AWSPreferCNAME, - DryRun: cfg.DryRun, - ZoneCacheDuration: cfg.AWSZoneCacheDuration, - }, route53.New(awsSession)) - if awsErr != nil { - log.Fatal(awsErr) - } - go webhook.StartHTTPApi(awsProvider, startedChan, cfg.WebhookProviderReadTimeout, cfg.WebhookProviderWriteTimeout, "127.0.0.1:8888") - <-startedChan - } p, err = webhook.NewWebhookProvider(cfg.WebhookProviderURL) default: log.Fatalf("unknown dns provider: %s", cfg.Provider) diff --git a/pkg/apis/externaldns/types.go b/pkg/apis/externaldns/types.go index 87ae51a911..d8c9a31193 100644 --- a/pkg/apis/externaldns/types.go +++ b/pkg/apis/externaldns/types.go @@ -210,7 +210,6 @@ type Config struct { PluralCluster string PluralProvider string WebhookProviderURL string - RunAWSProviderAsWebhook bool WebhookProviderReadTimeout time.Duration WebhookProviderWriteTimeout time.Duration WebhookServer bool @@ -613,7 +612,6 @@ func (cfg *Config) ParseFlags(args []string) error { // Webhook provider app.Flag("webhook-provider-url", "[EXPERIMENTAL] The URL of the remote endpoint to call for the webhook provider (default: http://localhost:8888)").Default(defaultConfig.WebhookProviderURL).StringVar(&cfg.WebhookProviderURL) - app.Flag("run-aws-provider-as-webhook", "[EXPERIMENTAL] When enabled, the AWS provider will be run as a webhook (default: false). To be used together with 'webhook' as provider.").BoolVar(&cfg.RunAWSProviderAsWebhook) app.Flag("webhook-provider-read-timeout", "[EXPERIMENTAL] The read timeout for the webhook provider in duration format (default: 5s)").Default(defaultConfig.WebhookProviderReadTimeout.String()).DurationVar(&cfg.WebhookProviderReadTimeout) app.Flag("webhook-provider-write-timeout", "[EXPERIMENTAL] The write timeout for the webhook provider in duration format (default: 10s)").Default(defaultConfig.WebhookProviderWriteTimeout.String()).DurationVar(&cfg.WebhookProviderWriteTimeout)