Skip to content

Commit c579a1c

Browse files
committed
Extend header flip to bundle deployment state filer
bundle/deploy/filer.go has its own stateFiler that fetches the bundle deployment state from /api/2.0/workspace-files/ using client.Do() directly (bypassing generated SDK service methods). Apply the same X-Databricks-Org-Id → X-Databricks-Workspace-Id swap here so bundle deploy/summary against unified hosts uses the new routing header consistently with the rest of the CLI. Method renamed orgIDHeaders → workspaceIDHeaders for consistency with the other filer helpers updated in this PR.
1 parent a54149d commit c579a1c

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

bundle/deploy/filer.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ type stateFiler struct {
2525
root filer.WorkspaceRootPath
2626
}
2727

28-
// orgIDHeaders returns headers with X-Databricks-Org-Id set if a workspace ID
29-
// is configured. SPOG hosts require this header to route requests to the
30-
// correct workspace.
31-
func (s stateFiler) orgIDHeaders() map[string]string {
28+
// workspaceIDHeaders returns headers with X-Databricks-Workspace-Id set if a
29+
// workspace ID is configured. SPOG hosts require this header to route requests
30+
// to the correct workspace.
31+
func (s stateFiler) workspaceIDHeaders() map[string]string {
3232
wsID := s.apiClient.Config.WorkspaceID
3333
if wsID == "" {
3434
return nil
3535
}
3636
return map[string]string{
37-
"X-Databricks-Org-Id": wsID,
37+
"X-Databricks-Workspace-Id": wsID,
3838
}
3939
}
4040

@@ -63,7 +63,7 @@ func (s stateFiler) Read(ctx context.Context, path string) (io.ReadCloser, error
6363

6464
var buf bytes.Buffer
6565
urlPath := "/api/2.0/workspace-files/" + url.PathEscape(strings.TrimLeft(absPath, "/"))
66-
err = s.apiClient.Do(ctx, http.MethodGet, urlPath, s.orgIDHeaders(), nil, nil, &buf)
66+
err = s.apiClient.Do(ctx, http.MethodGet, urlPath, s.workspaceIDHeaders(), nil, nil, &buf)
6767
if err != nil {
6868
return nil, err
6969
}

0 commit comments

Comments
 (0)