add const for internal

This commit is contained in:
Shreyas Goenka 2024-11-29 19:49:07 +01:00
parent 9493795d88
commit e51b3a17bd
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
2 changed files with 6 additions and 2 deletions

View File

@ -79,7 +79,7 @@ func filerForVolume(ctx context.Context, b *bundle.Bundle) (filer.Filer, string,
// If the volume exists already, directly return the filer for the path to
// upload the artifacts to.
if err == nil {
uploadPath := path.Join(artifactPath, ".internal")
uploadPath := path.Join(artifactPath, InternalDirName)
f, err := filer.NewFilesClient(w, uploadPath)
return f, uploadPath, diag.FromErr(err)
}

View File

@ -8,8 +8,12 @@ import (
"github.com/databricks/cli/libs/filer"
)
// We upload artifacts to the workspace in a directory named ".internal" to have
// a well defined location for artifacts that have been uploaded by the DABs.
const InternalDirName = ".internal"
func filerForWorkspace(b *bundle.Bundle) (filer.Filer, string, diag.Diagnostics) {
uploadPath := path.Join(b.Config.Workspace.ArtifactPath, ".internal")
uploadPath := path.Join(b.Config.Workspace.ArtifactPath, InternalDirName)
f, err := filer.NewWorkspaceFilesClient(b.WorkspaceClient(), uploadPath)
return f, uploadPath, diag.FromErr(err)
}