feat(coderd): add provisioner build version and api_version on serve (#11369)

* assert provisioner daemon version and api_version in unit tests
* add build info in HTTP header, extract codersdk.BuildVersionHeader
* add api_version to codersdk.ProvisionerDaemon
* testutil.MustString -> testutil.MustRandString
This commit is contained in:
Cian Johnston
2024-01-03 09:01:57 +00:00
committed by GitHub
parent 9031b498ea
commit 1ef96022b0
22 changed files with 97 additions and 34 deletions

View File

@ -203,7 +203,7 @@ func (c *Client) HasFirstUser(ctx context.Context) (bool, error) {
if res.StatusCode == http.StatusNotFound {
// ensure we are talking to coder and not
// some other service that returns 404
v := res.Header.Get("X-Coder-Build-Version")
v := res.Header.Get(BuildVersionHeader)
if v == "" {
return false, xerrors.Errorf("missing build version header, not a coder instance")
}