mirror of
https://github.com/containers/podman.git
synced 2025-05-21 00:56:36 +08:00
libpod: drop dead code
these functions are not used anymore in the codebase, so drop them. [NO NEW TESTS NEEDED] no new functionalities are added Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -365,15 +365,6 @@ func WithTmpDir(dir string) RuntimeOption {
|
||||
}
|
||||
}
|
||||
|
||||
// WithNoStore sets a bool on the runtime that we do not need
|
||||
// any containers storage.
|
||||
func WithNoStore() RuntimeOption {
|
||||
return func(rt *Runtime) error {
|
||||
rt.noStore = true
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithNoPivotRoot sets the runtime to use MS_MOVE instead of PIVOT_ROOT when
|
||||
// starting containers.
|
||||
func WithNoPivotRoot() RuntimeOption {
|
||||
|
@ -115,8 +115,6 @@ type Runtime struct {
|
||||
// mechanism to read and write even logs
|
||||
eventer events.Eventer
|
||||
|
||||
// noStore indicates whether we need to interact with a store or not
|
||||
noStore bool
|
||||
// secretsManager manages secrets
|
||||
secretsManager *secrets.SecretsManager
|
||||
}
|
||||
@ -350,9 +348,6 @@ func makeRuntime(runtime *Runtime) (retErr error) {
|
||||
}
|
||||
runtime.conmonPath = cPath
|
||||
|
||||
if runtime.noStore && runtime.doReset {
|
||||
return fmt.Errorf("cannot perform system reset if runtime is not creating a store: %w", define.ErrInvalidArg)
|
||||
}
|
||||
if runtime.doReset && runtime.doRenumber {
|
||||
return fmt.Errorf("cannot perform system reset while renumbering locks: %w", define.ErrInvalidArg)
|
||||
}
|
||||
@ -462,8 +457,6 @@ func makeRuntime(runtime *Runtime) (retErr error) {
|
||||
var store storage.Store
|
||||
if needsUserns {
|
||||
logrus.Debug("Not configuring container store")
|
||||
} else if runtime.noStore {
|
||||
logrus.Debug("No store required. Not opening container store.")
|
||||
} else if err := runtime.configureStore(); err != nil {
|
||||
// Make a best-effort attempt to clean up if performing a
|
||||
// storage reset.
|
||||
|
@ -37,7 +37,6 @@ type engineOpts struct {
|
||||
name string
|
||||
renumber bool
|
||||
migrate bool
|
||||
noStore bool
|
||||
withFDS bool
|
||||
reset bool
|
||||
config *entities.PodmanConfig
|
||||
@ -49,7 +48,6 @@ func GetRuntimeMigrate(ctx context.Context, fs *flag.FlagSet, cfg *entities.Podm
|
||||
name: newRuntime,
|
||||
renumber: false,
|
||||
migrate: true,
|
||||
noStore: false,
|
||||
withFDS: true,
|
||||
reset: false,
|
||||
config: cfg,
|
||||
@ -61,7 +59,6 @@ func GetRuntimeDisableFDs(ctx context.Context, fs *flag.FlagSet, cfg *entities.P
|
||||
return getRuntime(ctx, fs, &engineOpts{
|
||||
renumber: false,
|
||||
migrate: false,
|
||||
noStore: false,
|
||||
withFDS: false,
|
||||
reset: false,
|
||||
config: cfg,
|
||||
@ -73,7 +70,6 @@ func GetRuntimeRenumber(ctx context.Context, fs *flag.FlagSet, cfg *entities.Pod
|
||||
return getRuntime(ctx, fs, &engineOpts{
|
||||
renumber: true,
|
||||
migrate: false,
|
||||
noStore: false,
|
||||
withFDS: true,
|
||||
reset: false,
|
||||
config: cfg,
|
||||
@ -86,7 +82,6 @@ func GetRuntime(ctx context.Context, flags *flag.FlagSet, cfg *entities.PodmanCo
|
||||
runtimeLib, runtimeErr = getRuntime(ctx, flags, &engineOpts{
|
||||
renumber: false,
|
||||
migrate: false,
|
||||
noStore: false,
|
||||
withFDS: true,
|
||||
reset: false,
|
||||
config: cfg,
|
||||
@ -95,23 +90,10 @@ func GetRuntime(ctx context.Context, flags *flag.FlagSet, cfg *entities.PodmanCo
|
||||
return runtimeLib, runtimeErr
|
||||
}
|
||||
|
||||
// GetRuntimeNoStore generates a new libpod runtime configured by command line options
|
||||
func GetRuntimeNoStore(ctx context.Context, fs *flag.FlagSet, cfg *entities.PodmanConfig) (*libpod.Runtime, error) {
|
||||
return getRuntime(ctx, fs, &engineOpts{
|
||||
renumber: false,
|
||||
migrate: false,
|
||||
noStore: true,
|
||||
withFDS: true,
|
||||
reset: false,
|
||||
config: cfg,
|
||||
})
|
||||
}
|
||||
|
||||
func GetRuntimeReset(ctx context.Context, fs *flag.FlagSet, cfg *entities.PodmanConfig) (*libpod.Runtime, error) {
|
||||
return getRuntime(ctx, fs, &engineOpts{
|
||||
renumber: false,
|
||||
migrate: false,
|
||||
noStore: false,
|
||||
withFDS: true,
|
||||
reset: true,
|
||||
config: cfg,
|
||||
@ -208,9 +190,6 @@ func getRuntime(ctx context.Context, fs *flag.FlagSet, opts *engineOpts) (*libpo
|
||||
options = append(options, libpod.WithStorageConfig(storageOpts))
|
||||
}
|
||||
|
||||
if !storageSet && opts.noStore {
|
||||
options = append(options, libpod.WithNoStore())
|
||||
}
|
||||
// TODO CLI flags for image config?
|
||||
// TODO CLI flag for signature policy?
|
||||
|
||||
|
Reference in New Issue
Block a user