(ctx context.Context, info pkg.PackageArtifactInfo)
| 577 | } |
| 578 | |
| 579 | func (l *localBase) DeletePackage(ctx context.Context, info pkg.PackageArtifactInfo) error { |
| 580 | err := l.tx.WithTx( |
| 581 | ctx, func(ctx context.Context) error { |
| 582 | path := "/" + info.BaseArtifactInfo().Image |
| 583 | err := l.nodesDao.DeleteByNodePathAndRegistryID(ctx, path, info.BaseArtifactInfo().RegistryID) |
| 584 | |
| 585 | if err != nil { |
| 586 | return err |
| 587 | } |
| 588 | |
| 589 | err = l.artifactDao.DeleteByImageNameAndRegistryID(ctx, |
| 590 | info.BaseArtifactInfo().RegistryID, info.BaseArtifactInfo().Image) |
| 591 | |
| 592 | if err != nil { |
| 593 | return err |
| 594 | } |
| 595 | |
| 596 | err = l.imageDao.DeleteByImageNameAndRegID(ctx, info.BaseArtifactInfo().RegistryID, |
| 597 | info.BaseArtifactInfo().Image) |
| 598 | |
| 599 | if err != nil { |
| 600 | return err |
| 601 | } |
| 602 | return nil |
| 603 | }) |
| 604 | if err != nil { |
| 605 | log.Ctx(ctx).Warn().Msgf("Failed to delete the package %v", info.BaseArtifactInfo().Image) |
| 606 | return err |
| 607 | } |
| 608 | |
| 609 | return nil |
| 610 | } |
| 611 | |
| 612 | func (l *localBase) DeleteVersion(ctx context.Context, info pkg.PackageArtifactInfo) error { |
| 613 | err := l.tx.WithTx( |
nothing calls this directly
no test coverage detected