Skip to content

Commit 3819c6d

Browse files
committed
fix: handles additional states in custom domain setup
1 parent af5e088 commit 3819c6d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/hostnames/common.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func GetCustomHostnameConfig(ctx context.Context, projectRef string) (*api.GetCu
1616
return nil, err
1717
}
1818
if resp.JSON200 == nil {
19-
return nil, errors.New("failed to activate custom hostname config: " + string(resp.Body))
19+
return nil, errors.New("failed to get custom hostname config; received: " + string(resp.Body))
2020
}
2121
return resp, nil
2222
}
@@ -47,6 +47,7 @@ type RawResponse struct {
4747
TxtName string `json:"txt_name"`
4848
TxtValue string `json:"txt_value"`
4949
} `json:"validation_records"`
50+
Status string `json:"status"`
5051
}
5152
} `json:"result"`
5253
}
@@ -101,6 +102,9 @@ Please ensure that your custom domain is set up as a CNAME record to your Supaba
101102
}
102103
owner := res.Result.OwnershipVerification
103104
ssl := res.Result.Ssl.ValidationRecords
105+
if res.Result.Ssl.Status == "initializing" {
106+
return appendRawOutputIfNeeded("Custom hostname setup is being initialized; please request re-verification in a few seconds.\n", response, includeRawOutput), nil
107+
}
104108
if len(ssl) != 1 {
105109
return "", fmt.Errorf("expected a single SSL verification record, received: %+v", ssl)
106110
}

0 commit comments

Comments
 (0)