(ctx context.Context, clusterId string, serviceIds ...string)
| 51 | } |
| 52 | |
| 53 | func (i *imlUpstreamService) ListLatestCommit(ctx context.Context, clusterId string, serviceIds ...string) ([]*commit.Commit[Config], error) { |
| 54 | w := make(map[string]interface{}) |
| 55 | if len(serviceIds) > 0 { |
| 56 | w["service"] = serviceIds |
| 57 | } |
| 58 | |
| 59 | upstreams, err := i.store.List(ctx, w) |
| 60 | if err != nil { |
| 61 | return nil, err |
| 62 | } |
| 63 | if len(upstreams) == 0 { |
| 64 | return nil, nil |
| 65 | //return nil, errors.New("upstream not found") |
| 66 | } |
| 67 | targetId := utils.SliceToSlice(upstreams, func(u *upstream.Upstream) string { |
| 68 | return u.UUID |
| 69 | }) |
| 70 | return i.commitService.ListLatest(ctx, clusterId, targetId...) |
| 71 | |
| 72 | } |
| 73 | |
| 74 | func (i *imlUpstreamService) GetCommit(ctx context.Context, uuid string) (*commit.Commit[Config], error) { |
| 75 | return i.commitService.Get(ctx, uuid) |
nothing calls this directly
no test coverage detected