File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 "context"
55 "fmt"
66 "os"
7+ "strings"
78
89 "github.com/AlecAivazis/survey/v2"
910 "github.com/pluralsh/plural-cli/pkg/api"
@@ -223,12 +224,15 @@ func processAppDomain(domain string) error {
223224 // we also need to determine the managed DNS zone to use.
224225 // If there is one it will be automatically selected, if there are multiple,
225226 // the user will be prompted to select one.
226- managedZones , err := provider .GetGcpManagedZones (project .Project , domain )
227+
228+ d := strings .TrimSuffix (domain , "." ) + "." // GCP stores zone names with a trailing dot.
229+
230+ managedZones , err := provider .GetGcpManagedZones (project .Project , d )
227231 if err != nil {
228232 return err
229233 }
230234 if len (managedZones ) == 0 {
231- return fmt .Errorf ("no managed DNS zones found for domain %s in project %s" , domain , project .Project )
235+ return fmt .Errorf ("no managed DNS zones found for domain %s in project %s" , d , project .Project )
232236 }
233237
234238 var managedZone string
Original file line number Diff line number Diff line change @@ -134,8 +134,7 @@ func getGcpProjects() ([]string, error) {
134134}
135135
136136func GetGcpManagedZones (project , dnsName string ) ([]string , error ) {
137- client , err := google .DefaultClient (context .Background (),
138- gcompute .ComputeScope )
137+ client , err := google .DefaultClient (context .Background ())
139138 if err != nil {
140139 return nil , err
141140 }
You can’t perform that action at this time.
0 commit comments