Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exporter: Emit directories during the listing only if they are explicitly configured in -listing #3673

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Exporter: Emit directories during the listing only if they are explic…
…itly configured in `-listing`

Exporter emitted directories even if they were specified only in `-services`, leading to
exporting of not necessary objects...
  • Loading branch information
alexott committed Jun 13, 2024
commit 09ad85c9fa2d1414d0eb6fe921f04c341d6ced1b
8 changes: 5 additions & 3 deletions exporter/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func (ic *importContext) emitInitScripts(initScripts []compute.InitScriptInfo) {
ic.emitWorkspaceFileOrRepo(is.Workspace.Destination)
}
if is.Volumes != nil {
// TODO: we should emit allow list for init scripts as well
ic.emitIfVolumeFile(is.Volumes.Destination)
}
}
Expand Down Expand Up @@ -412,6 +413,7 @@ func (ic *importContext) emitLibraries(libs []compute.Library) {
ic.emitIfWsfsFile(lib.Egg)
// Files on UC Volumes
ic.emitIfVolumeFile(lib.Whl)
// TODO: we should emit UC allow list as well
ic.emitIfVolumeFile(lib.Jar)
}

Expand Down Expand Up @@ -1159,7 +1161,7 @@ func listNotebooksAndWorkspaceFiles(ic *importContext) error {
allObjects := ic.getAllWorkspaceObjects(func(objects []workspace.ObjectStatus) {
for _, object := range objects {
if object.ObjectType == workspace.Directory {
if !ic.incremental && object.Path != "/" && ic.isServiceEnabled("directories") {
if !ic.incremental && object.Path != "/" && ic.isServiceInListing("directories") {
objectsChannel <- object
}
} else {
Expand All @@ -1184,9 +1186,9 @@ func listNotebooksAndWorkspaceFiles(ic *importContext) error {
if ic.shouldSkipWorkspaceObject(object, updatedSinceMs) {
continue
}
if object.ObjectType == workspace.Directory && !ic.incremental && ic.isServiceEnabled("directories") && object.Path != "/" {
if object.ObjectType == workspace.Directory && !ic.incremental && ic.isServiceInListing("directories") && object.Path != "/" {
emitWorkpaceObject(ic, object)
} else if (object.ObjectType == workspace.Notebook || object.ObjectType == workspace.File) && ic.isServiceEnabled("notebooks") {
} else if (object.ObjectType == workspace.Notebook || object.ObjectType == workspace.File) && ic.isServiceInListing("notebooks") {
emitWorkpaceObject(ic, object)
}
}
Expand Down
Loading