diff --git a/bundle/deploy/files/sync.go b/bundle/deploy/files/sync.go index 90f44a98d8b..1f950398b88 100644 --- a/bundle/deploy/files/sync.go +++ b/bundle/deploy/files/sync.go @@ -8,11 +8,15 @@ import ( "github.com/databricks/cli/libs/sync" ) +// GetSync returns a new sync instance for the given bundle. +// The sync instance will be in no validate remote path mode because it's only used to validate files to sync. +// It does not check or create the remote path. func GetSync(ctx context.Context, b *bundle.Bundle) (*sync.Sync, error) { opts, err := GetSyncOptions(ctx, b) if err != nil { return nil, fmt.Errorf("cannot get sync options: %w", err) } + opts.NoValidateRemotePath = true return sync.New(ctx, *opts) } diff --git a/libs/sync/sync.go b/libs/sync/sync.go index 71c106d4875..d2039c9460c 100644 --- a/libs/sync/sync.go +++ b/libs/sync/sync.go @@ -49,6 +49,8 @@ type SyncOptions struct { OutputHandler OutputHandler DryRun bool + + NoValidateRemotePath bool } type Sync struct {