Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dead RuntimeOption functions #12772

Merged
merged 1 commit into from
Jan 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 0 additions & 63 deletions libpod/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,6 @@ func WithStorageConfig(config storage.StoreOptions) RuntimeOption {
}
}

// WithDefaultTransport sets the default transport for retrieving images.
func WithDefaultTransport(defaultTransport string) RuntimeOption {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is actually honored anymore (@vrothberg can confirm). We might want to fix it, though, it does live in containers.conf and setting it there has no effect.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not honored anymore, correct. I am not sure if we should continue supporting it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't want it it should be pulled from c/common as well. Still got a few more weeks of 4.0 prep to make breaking changes.

return func(rt *Runtime) error {
if rt.valid {
return define.ErrRuntimeFinalized
}

rt.config.Engine.ImageDefaultTransport = defaultTransport

return nil
}
}

// WithSignaturePolicy specifies the path of a file which decides how trust is
// managed for images we've pulled.
// If this is not specified, the system default configuration will be used
Expand All @@ -144,26 +131,6 @@ func WithSignaturePolicy(path string) RuntimeOption {
}
}

// WithStateType sets the backing state implementation for libpod.
// Please note that information is not portable between backing states.
// As such, if this differs between two libpods running on the same system,
// they will not share containers, and unspecified behavior may occur.
func WithStateType(storeType config.RuntimeStateStore) RuntimeOption {
return func(rt *Runtime) error {
if rt.valid {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can get rid of this one.

return define.ErrRuntimeFinalized
}

if storeType == config.InvalidStateStore {
return errors.Wrapf(define.ErrInvalidArg, "must provide a valid state store type")
}

rt.config.Engine.StateType = storeType

return nil
}
}

// WithOCIRuntime specifies an OCI runtime to use for running containers.
func WithOCIRuntime(runtime string) RuntimeOption {
return func(rt *Runtime) error {
Expand Down Expand Up @@ -452,23 +419,6 @@ func WithVolumePath(volPath string) RuntimeOption {
}
}

// WithDefaultInfraImage sets the infra image for libpod.
// An infra image is used for inter-container kernel
// namespace sharing within a pod. Typically, an infra
// container is lightweight and is there to reap
// zombie processes within its pid namespace.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be gotten rid of

func WithDefaultInfraImage(img string) RuntimeOption {
return func(rt *Runtime) error {
if rt.valid {
return define.ErrRuntimeFinalized
}

rt.config.Engine.InfraImage = img

return nil
}
}

// WithDefaultInfraCommand sets the command to
// run on pause container start up.
func WithDefaultInfraCommand(cmd string) RuntimeOption {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one still makes sense, I think.

Expand All @@ -483,19 +433,6 @@ func WithDefaultInfraCommand(cmd string) RuntimeOption {
}
}

// WithDefaultInfraName sets the infra container name for a single pod.
func WithDefaultInfraName(name string) RuntimeOption {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one can be removed

return func(rt *Runtime) error {
if rt.valid {
return define.ErrRuntimeFinalized
}

rt.config.Engine.InfraImage = name

return nil
}
}

// WithRenumber instructs libpod to perform a lock renumbering while
// initializing. This will handle migrations from early versions of libpod with
// file locks to newer versions with SHM locking, as well as changes in the
Expand Down