Skip to content

Commit

Permalink
Merge pull request containers#10881 from mheon/remove_getstore
Browse files Browse the repository at this point in the history
Remove GetStore function from Libpod
  • Loading branch information
openshift-merge-robot authored Jul 9, 2021
2 parents dd2ca4b + e5fcffc commit 24a5eea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
9 changes: 6 additions & 3 deletions libpod/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -946,9 +946,12 @@ func (r *Runtime) StorageConfig() storage.StoreOptions {
return r.storageConfig
}

// GetStore returns the runtime stores
func (r *Runtime) GetStore() storage.Store {
return r.store
// RunRoot retrieves the current c/storage temporary directory in use by Libpod.
func (r *Runtime) RunRoot() string {
if r.store == nil {
return ""
}
return r.store.RunRoot()
}

// GetName retrieves the name associated with a given full ID.
Expand Down
7 changes: 1 addition & 6 deletions pkg/systemd/generate/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,11 @@ func generateContainerInfo(ctr *libpod.Container, options entities.GenerateSyste

nameOrID, serviceName := containerServiceName(ctr, options)

store := ctr.Runtime().GetStore()
if store == nil {
return nil, errors.Errorf("could not determine storage store for container")
}

var runRoot string
if options.New {
runRoot = "%t/containers"
} else {
runRoot = store.RunRoot()
runRoot = ctr.Runtime().RunRoot()
if runRoot == "" {
return nil, errors.Errorf("could not lookup container's runroot: got empty string")
}
Expand Down

0 comments on commit 24a5eea

Please sign in to comment.