Skip to content

Commit

Permalink
libpod: drop dead code
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
giuseppe committed Nov 24, 2023
1 parent 6c29a87 commit fe65f05
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 37 deletions.
9 changes: 0 additions & 9 deletions libpod/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 0 additions & 7 deletions libpod/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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.
Expand Down
21 changes: 0 additions & 21 deletions pkg/domain/infra/runtime_libpod.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ type engineOpts struct {
name string
renumber bool
migrate bool
noStore bool
withFDS bool
reset bool
config *entities.PodmanConfig
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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?

Expand Down

0 comments on commit fe65f05

Please sign in to comment.