mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-05 00:15:44 +00: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:
parent
e0b2e70e4f
commit
e36e2c97d2
2 changed files with 3 additions and 8 deletions
|
|
@ -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))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue