@@ -30,6 +30,7 @@ type BootstrapGcpCleanupOpts struct {
3030 SkipDNSCleanup bool
3131 BaseDomain string
3232 DNSZoneName string
33+ DNSProjectID string
3334}
3435
3536type CleanupDeps struct {
@@ -141,7 +142,10 @@ func (c *BootstrapGcpCleanupCmd) ExecuteCleanup(deps *CleanupDeps) error {
141142
142143 // Clean up DNS records
143144 if ! c .Opts .SkipDNSCleanup && baseDomain != "" && dnsZoneName != "" {
144- dnsProjectID := infraEnv .DNSProjectID
145+ dnsProjectID := c .Opts .DNSProjectID
146+ if dnsProjectID == "" {
147+ dnsProjectID = infraEnv .DNSProjectID
148+ }
145149 if dnsProjectID == "" {
146150 dnsProjectID = projectID
147151 }
@@ -197,7 +201,7 @@ func AddBootstrapGcpCleanupCmd(bootstrapGcp *cobra.Command, opts *GlobalOptions)
197201 oms-cli beta bootstrap-gcp cleanup --skip-dns-cleanup
198202
199203 # Clean up with manual DNS settings (when infra file is not available)
200- oms-cli beta bootstrap-gcp cleanup --project-id my-project --base-domain example.com --dns-zone-name my-zone` ,
204+ oms-cli beta bootstrap-gcp cleanup --project-id my-project --base-domain example.com --dns-zone-name my-zone --dns-project-id dns-project ` ,
201205 },
202206 Opts : & BootstrapGcpCleanupOpts {
203207 GlobalOptions : opts ,
@@ -210,6 +214,7 @@ func AddBootstrapGcpCleanupCmd(bootstrapGcp *cobra.Command, opts *GlobalOptions)
210214 flags .BoolVar (& cleanup .Opts .SkipDNSCleanup , "skip-dns-cleanup" , false , "Skip cleaning up DNS records" )
211215 flags .StringVar (& cleanup .Opts .BaseDomain , "base-domain" , "" , "Base domain for DNS cleanup (optional, will use infra file if not provided)" )
212216 flags .StringVar (& cleanup .Opts .DNSZoneName , "dns-zone-name" , "" , "DNS zone name for DNS cleanup (optional, will use infra file if not provided)" )
217+ flags .StringVar (& cleanup .Opts .DNSProjectID , "dns-project-id" , "" , "GCP Project ID for DNS zone (optional, will use infra file if not provided)" )
213218
214219 cleanup .cmd .RunE = cleanup .RunE
215220 bootstrapGcp .AddCommand (cleanup .cmd )
0 commit comments