(ctx context.Context, rep repo.RepositoryWriter)
| 22 | } |
| 23 | |
| 24 | func (c *commandPolicyDelete) run(ctx context.Context, rep repo.RepositoryWriter) error { |
| 25 | targets, err := c.policyTargets(ctx, rep) |
| 26 | if err != nil { |
| 27 | return err |
| 28 | } |
| 29 | |
| 30 | for _, target := range targets { |
| 31 | log(ctx).Infof("Removing policy on %q...", target) |
| 32 | |
| 33 | if c.dryRun { |
| 34 | continue |
| 35 | } |
| 36 | |
| 37 | if err := policy.RemovePolicy(ctx, rep, target); err != nil { |
| 38 | return errors.Wrapf(err, "error removing policy on %v", target) |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | return nil |
| 43 | } |
nothing calls this directly
no test coverage detected