(ctx context.Context, info pkg.PackageArtifactInfo)
| 610 | } |
| 611 | |
| 612 | func (l *localBase) DeleteVersion(ctx context.Context, info pkg.PackageArtifactInfo) error { |
| 613 | err := l.tx.WithTx( |
| 614 | ctx, func(ctx context.Context) error { |
| 615 | path := "/" + info.BaseArtifactInfo().Image + "/" + info.GetVersion() |
| 616 | err := l.nodesDao.DeleteByNodePathAndRegistryID(ctx, |
| 617 | path, info.BaseArtifactInfo().RegistryID) |
| 618 | |
| 619 | if err != nil { |
| 620 | return err |
| 621 | } |
| 622 | |
| 623 | err = l.artifactDao.DeleteByVersionAndImageName(ctx, |
| 624 | info.BaseArtifactInfo().Image, info.GetVersion(), info.BaseArtifactInfo().RegistryID) |
| 625 | if err != nil { |
| 626 | return err |
| 627 | } |
| 628 | return nil |
| 629 | }) |
| 630 | if err != nil { |
| 631 | log.Ctx(ctx).Warn().Msgf("Failed to delete the version for artifact %v:%v", info.BaseArtifactInfo().Image, |
| 632 | info.GetVersion()) |
| 633 | return err |
| 634 | } |
| 635 | return nil |
| 636 | } |
nothing calls this directly
no test coverage detected