(ctx context.Context, sourceRepo repo.Repository, destRepo repo.RepositoryWriter)
| 169 | } |
| 170 | |
| 171 | func (c *commandSnapshotMigrate) migrateAllPolicies(ctx context.Context, sourceRepo repo.Repository, destRepo repo.RepositoryWriter) error { |
| 172 | policies, err := policy.ListPolicies(ctx, sourceRepo) |
| 173 | if err != nil { |
| 174 | return errors.Wrap(err, "unable to list source policies") |
| 175 | } |
| 176 | |
| 177 | for _, pol := range policies { |
| 178 | if err := c.migrateSinglePolicy(ctx, sourceRepo, destRepo, pol.Target()); err != nil { |
| 179 | log(ctx).Errorf("unable to migrate policy for %v: %v", pol.Target(), err) |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | return nil |
| 184 | } |
| 185 | |
| 186 | func (c *commandSnapshotMigrate) migrateSinglePolicy(ctx context.Context, sourceRepo repo.Repository, destRepo repo.RepositoryWriter, si snapshot.SourceInfo) error { |
| 187 | pol, err := policy.GetDefinedPolicy(ctx, sourceRepo, si) |
no test coverage detected