MCPcopy
hub / github.com/harness/harness / DeleteVersion

Method DeleteVersion

registry/app/pkg/base/base.go:612–636  ·  view source on GitHub ↗
(ctx context.Context, info pkg.PackageArtifactInfo)

Source from the content-addressed store, hash-verified

610}
611
612func (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}

Callers

nothing calls this directly

Calls 7

MsgfMethod · 0.80
WithTxMethod · 0.65
BaseArtifactInfoMethod · 0.65
GetVersionMethod · 0.65
WarnMethod · 0.65

Tested by

no test coverage detected