Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2309 from amshinde/my-stable-1.9
Browse files Browse the repository at this point in the history
virtcontainers/store: make VCStoreUUIDPath rootless
  • Loading branch information
Eric Ernst authored Dec 4, 2019
2 parents 6827cc3 + 9204973 commit 2414edd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion virtcontainers/store/filesystem_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,14 @@ var RunVMStoragePath = func() string {

// VMUUIDStoragePath is the uuid directory.
// It will contain all uuid info used by guest vm.
var VMUUIDStoragePath = filepath.Join("/var/lib", StoragePathSuffix, UUIDPathSuffix)
var VMUUIDStoragePath = func() string {
path := filepath.Join("/var/lib", StoragePathSuffix, UUIDPathSuffix)
if rootless.IsRootless() {
return filepath.Join(rootless.GetRootlessDir(), path)
}
return path

}

func itemToFile(item Item) (string, error) {
switch item {
Expand Down
2 changes: 1 addition & 1 deletion virtcontainers/store/vc.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func SandboxConfigurationItemPath(id string, item Item) (string, error) {

// VCStoreUUIDPath returns a virtcontainers runtime uuid URL.
func VCStoreUUIDPath() string {
return filesystemScheme + "://" + filepath.Join(VCStorePrefix, VMUUIDStoragePath)
return filesystemScheme + "://" + filepath.Join(VCStorePrefix, VMUUIDStoragePath())
}

// SandboxRuntimeRoot returns a virtcontainers sandbox runtime root URL.
Expand Down

0 comments on commit 2414edd

Please sign in to comment.