mirror of
https://github.com/containers/podman.git
synced 2025-06-04 21:55:24 +08:00
We no longer use stores
This code is from when we were using libkpod and kept track of stores. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #183 Approved by: TomSweeneyRedHat
This commit is contained in:

committed by
Atomic Bot

parent
04593b1591
commit
137e5c8ffd
@ -14,10 +14,6 @@ import (
|
|||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
stores = make(map[storage.Store]struct{})
|
|
||||||
)
|
|
||||||
|
|
||||||
const crioConfigPath = "/etc/crio/crio.conf"
|
const crioConfigPath = "/etc/crio/crio.conf"
|
||||||
|
|
||||||
func getRuntime(c *cli.Context) (*libpod.Runtime, error) {
|
func getRuntime(c *cli.Context) (*libpod.Runtime, error) {
|
||||||
@ -36,14 +32,6 @@ func getRuntime(c *cli.Context) (*libpod.Runtime, error) {
|
|||||||
return libpod.NewRuntime(libpod.WithStorageConfig(options), libpod.WithConmonPath(config.Conmon), libpod.WithOCIRuntime(config.Runtime), libpod.WithCNIConfigDir(config.NetworkDir))
|
return libpod.NewRuntime(libpod.WithStorageConfig(options), libpod.WithConmonPath(config.Conmon), libpod.WithOCIRuntime(config.Runtime), libpod.WithCNIConfigDir(config.NetworkDir))
|
||||||
}
|
}
|
||||||
|
|
||||||
func shutdownStores() {
|
|
||||||
for store := range stores {
|
|
||||||
if _, err := store.Shutdown(false); err != nil {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func getConfig(c *cli.Context) (*libkpod.Config, error) {
|
func getConfig(c *cli.Context) (*libkpod.Config, error) {
|
||||||
config := libkpod.DefaultConfig()
|
config := libkpod.DefaultConfig()
|
||||||
var configFile string
|
var configFile string
|
||||||
|
@ -98,17 +98,11 @@ func main() {
|
|||||||
}
|
}
|
||||||
app.After = func(*cli.Context) error {
|
app.After = func(*cli.Context) error {
|
||||||
// called by Run() when the command handler succeeds
|
// called by Run() when the command handler succeeds
|
||||||
shutdownStores()
|
|
||||||
if cpuProfile {
|
if cpuProfile {
|
||||||
pprof.StopCPUProfile()
|
pprof.StopCPUProfile()
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
cli.OsExiter = func(code int) {
|
|
||||||
// called by Run() when the command fails, bypassing After()
|
|
||||||
shutdownStores()
|
|
||||||
os.Exit(code)
|
|
||||||
}
|
|
||||||
app.Flags = []cli.Flag{
|
app.Flags = []cli.Flag{
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "cni-config-dir",
|
Name: "cni-config-dir",
|
||||||
@ -158,6 +152,5 @@ func main() {
|
|||||||
} else {
|
} else {
|
||||||
fmt.Fprintln(os.Stderr, err.Error())
|
fmt.Fprintln(os.Stderr, err.Error())
|
||||||
}
|
}
|
||||||
cli.OsExiter(1)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user