mirror of
https://github.com/containers/podman.git
synced 2026-05-24 16:40:44 -04:00
bindings/artifacts: remove redundant nameOrID parameter from Remove for 6.0
Signed-off-by: Byounguk Lee <nimdrak@gmail.com>
This commit is contained in:
@@ -9,17 +9,12 @@ import (
|
||||
)
|
||||
|
||||
// Remove removes an artifact from local storage.
|
||||
// TODO (6.0): nameOrID parameter should be removed
|
||||
func Remove(ctx context.Context, nameOrID string, options *RemoveOptions) (*entities.ArtifactRemoveReport, error) {
|
||||
func Remove(ctx context.Context, options *RemoveOptions) (*entities.ArtifactRemoveReport, error) {
|
||||
conn, err := bindings.GetClient(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if nameOrID != "" {
|
||||
options.Artifacts = append(options.Artifacts, nameOrID)
|
||||
}
|
||||
|
||||
params, err := options.ToParams()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -65,7 +65,7 @@ func (ir *ImageEngine) ArtifactRm(_ context.Context, opts entities.ArtifactRemov
|
||||
Ignore: &opts.Ignore,
|
||||
}
|
||||
|
||||
return artifacts.Remove(ir.ClientCtx, "", &removeOptions)
|
||||
return artifacts.Remove(ir.ClientCtx, &removeOptions)
|
||||
}
|
||||
|
||||
func (ir *ImageEngine) ArtifactPush(_ context.Context, name string, opts entities.ArtifactPushOptions) (*entities.ArtifactPushReport, error) {
|
||||
@@ -146,7 +146,7 @@ func artifactAddErrorCleanup(ctx context.Context, index int, name string, err er
|
||||
removeOptions := artifacts.RemoveOptions{
|
||||
Artifacts: []string{name},
|
||||
}
|
||||
_, recoverErr := artifacts.Remove(ctx, "", &removeOptions)
|
||||
_, recoverErr := artifacts.Remove(ctx, &removeOptions)
|
||||
if recoverErr != nil {
|
||||
return fmt.Errorf("failed to cleanup unfinished artifact add: %w", errors.Join(err, recoverErr))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user