Skip to content

Commit 971bae9

Browse files
committed
Add * to info log and add a debug log for dns check failure
1 parent 019cdb5 commit 971bae9

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/pkg/cli/cert.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,28 @@ func GenerateLetsEncryptCert(ctx context.Context, client cliClient.Client) error
3838
}
3939
}
4040
if cnt == 0 {
41-
term.Infof("No services found need to generate Let's Encrypt cert")
41+
term.Infof(" * No services found need to generate Let's Encrypt cert")
4242
}
4343

4444
return nil
4545
}
4646

4747
func generateCert(ctx context.Context, domain, albDns string) {
48-
term.Infof("Triggering Let's Encrypt cert generation for %v", domain)
48+
term.Infof(" * Triggering Let's Encrypt cert generation for %v", domain)
4949
if err := waitForCNAME(ctx, domain, albDns); err != nil {
5050
term.Errorf("Error waiting for CNAME: %v", err)
5151
return
5252
}
5353

54-
term.Infof("%v DNS is properly configured!", domain)
54+
term.Infof(" * %v DNS is properly configured!", domain)
5555
if err := checkTLSCert(ctx, domain); err == nil {
56-
term.Infof("TLS cert for %v is already ready", domain)
56+
term.Infof(" * TLS cert for %v is already ready", domain)
5757
return
5858
}
59-
term.Infof("Triggering cert generation for %v", domain)
59+
term.Infof(" * Triggering cert generation for %v", domain)
6060
triggerCertGeneration(ctx, domain)
6161

62-
term.Infof("Waiting for TLS cert to be online for %v", domain)
62+
term.Infof(" * Waiting for TLS cert to be online for %v", domain)
6363
if err := waitForTLS(ctx, domain); err != nil {
6464
term.Errorf("Error waiting for TLS to be online: %v", err)
6565
// FIXME: Add more info on how to debug, possibly provided by the server side to avoid client type detection here
@@ -144,9 +144,9 @@ func waitForCNAME(ctx context.Context, domain, albDns string) error {
144144
cname = strings.TrimSuffix(cname, ".")
145145
if err != nil || strings.ToLower(cname) != strings.ToLower(albDns) {
146146
if !msgShown {
147-
term.Infof("Please setup CNAME record for %v", domain)
147+
term.Infof(" * Please setup CNAME record for %v", domain)
148148
fmt.Printf(" %v CNAME %v\n", domain, strings.ToLower(albDns))
149-
term.Infof("Waiting for CNAME record setup and DNS propagation...")
149+
term.Infof(" * Waiting for CNAME record setup and DNS propagation...")
150150
msgShown = true
151151
}
152152
if doSpinner {
@@ -203,7 +203,7 @@ func waitForCNAMEInSync(ctx context.Context, domain string) (string, error) {
203203
for _, n := range ns {
204204
cname, err = resolverAt(n).LookupCNAME(context.Background(), domain)
205205
if err != nil {
206-
cnames[""] = true
206+
term.Debugf(" - Error looking up CNAME for %v at %v: %v", domain, n, err)
207207
}
208208
cnames[cname] = true
209209
}

0 commit comments

Comments
 (0)