From 809a443fff92a4bb2a515af14d0b6395da3d07e7 Mon Sep 17 00:00:00 2001 From: Manan Bhatia Date: Fri, 28 Jul 2023 14:12:14 -0700 Subject: [PATCH] fix: only ask for existing topic/sub when pub/sub audit log enabled --- cli/cmd/generate_gcp.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/cmd/generate_gcp.go b/cli/cmd/generate_gcp.go index 9ac12efe4..0ea465189 100644 --- a/cli/cmd/generate_gcp.go +++ b/cli/cmd/generate_gcp.go @@ -540,27 +540,27 @@ func promptGcpAuditLogQuestions( { Prompt: &survey.Confirm{Message: QuestionGcpUseExistingPubSubTopic, Default: extraState.UseExistingPubSubTopic}, - Checks: []*bool{&config.AuditLog}, + Checks: []*bool{&config.AuditLog, &config.UsePubSubAudit}, Required: true, Response: &extraState.UseExistingPubSubTopic, }, { Prompt: &survey.Input{Message: QuestionGcpExistingPubSubTopicId, Default: config.ExistingPubSubTopicId}, - Checks: []*bool{&config.AuditLog, &extraState.UseExistingPubSubTopic}, + Checks: []*bool{&config.AuditLog, &config.UsePubSubAudit, &extraState.UseExistingPubSubTopic}, Required: true, Response: &config.ExistingPubSubTopicId, }, { Prompt: &survey.Confirm{Message: QuestionGcpUseExistingPubSubSubscription, Default: extraState.UseExistingPubSubSubscription}, - Checks: []*bool{&config.AuditLog}, + Checks: []*bool{&config.AuditLog, &config.UsePubSubAudit}, Required: true, Response: &extraState.UseExistingPubSubSubscription, }, { Prompt: &survey.Input{Message: QuestionGcpExistingPubSubSubscriptionName, Default: config.ExistingPubSubSubscriptionName}, - Checks: []*bool{&config.AuditLog, &extraState.UseExistingPubSubSubscription}, + Checks: []*bool{&config.AuditLog, &config.UsePubSubAudit, &extraState.UseExistingPubSubSubscription}, Required: true, Response: &config.ExistingPubSubSubscriptionName, },