(ctx context.Context, id string)
| 205 | } |
| 206 | |
| 207 | func (m *imlCertificate) Delete(ctx context.Context, id string) error { |
| 208 | cert, _, err := m.service.Get(ctx, id) |
| 209 | if err != nil { |
| 210 | if errors.Is(err, gorm.ErrRecordNotFound) { |
| 211 | return nil |
| 212 | } |
| 213 | return err |
| 214 | } |
| 215 | clusters, err := m.clusterService.ListByClusters(ctx, cert.Cluster) |
| 216 | if err != nil { |
| 217 | return err |
| 218 | } |
| 219 | return m.transaction.Transaction(ctx, func(ctx context.Context) error { |
| 220 | for _, c := range clusters { |
| 221 | err = m.syncGateway(ctx, c.Uuid, &gateway.DynamicRelease{ |
| 222 | BasicItem: &gateway.BasicItem{ |
| 223 | ID: id, |
| 224 | Description: "", |
| 225 | }, |
| 226 | }, false) |
| 227 | if err != nil { |
| 228 | return err |
| 229 | } |
| 230 | } |
| 231 | return m.service.Delete(ctx, id) |
| 232 | }) |
| 233 | } |
nothing calls this directly
no test coverage detected