Skip to content

Commit

Permalink
using uuid string in files artifact expander destination dirpath
Browse files Browse the repository at this point in the history
  • Loading branch information
leoporoli committed Jan 4, 2024
1 parent f83caad commit 53929c1
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/port_spec"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/service"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/service_directory"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/uuid_generator"
"github.com/kurtosis-tech/kurtosis/core/files_artifacts_expander/args"
"github.com/kurtosis-tech/kurtosis/core/server/api_container/server/service_network"
"github.com/kurtosis-tech/kurtosis/core/server/api_container/server/startosis_engine/kurtosis_starlark_framework"
Expand Down Expand Up @@ -463,15 +464,19 @@ func ConvertFilesArtifactsMounts(filesArtifactsMountDirpathsMap map[string][]str
serviceDirpathsToArtifactIdentifiers := map[string][]string{}
expanderDirpathToUserServiceDirpathMap := map[string]string{}
for mountpointOnUserService, filesArtifactIdentifiers := range filesArtifactsMountDirpathsMap {
filesArtifactFolderUUIDStr, err := uuid_generator.GenerateUUIDString()
if err != nil {
return nil, startosis_errors.NewInterpretationError("An error occurred generating an UUID string for the file artifacts destination folder")
}
dirpathToExpandTo := path.Join(filesArtifactExpansionDirsParentDirpath, filesArtifactFolderUUIDStr)
for _, filesArtifactIdentifier := range filesArtifactIdentifiers {
dirpathToExpandTo := path.Join(filesArtifactExpansionDirsParentDirpath, filesArtifactIdentifier)
expansion := args.FilesArtifactExpansion{
FilesIdentifier: filesArtifactIdentifier,
DirPathToExpandTo: dirpathToExpandTo,
}
filesArtifactsExpansions = append(filesArtifactsExpansions, expansion)
expanderDirpathToUserServiceDirpathMap[dirpathToExpandTo] = mountpointOnUserService
}
expanderDirpathToUserServiceDirpathMap[dirpathToExpandTo] = mountpointOnUserService
serviceDirpathsToArtifactIdentifiers[mountpointOnUserService] = filesArtifactIdentifiers
}

Expand Down

0 comments on commit 53929c1

Please sign in to comment.