drained reports whether no HelmRelease carries the given shard key anymore.
(ctx context.Context, shardKey string)
| 225 | |
| 226 | // drained reports whether no HelmRelease carries the given shard key anymore. |
| 227 | func (r *ShardSetReconciler) drained(ctx context.Context, shardKey string) (bool, error) { |
| 228 | hrs := HelmReleaseMetaList() |
| 229 | if err := r.List(ctx, hrs, client.MatchingLabels{ShardKeyLabel: shardKey}); err != nil { |
| 230 | return false, fmt.Errorf("listing HelmReleases with %s=%s: %w", ShardKeyLabel, shardKey, err) |
| 231 | } |
| 232 | return len(hrs.Items) == 0, nil |
| 233 | } |
| 234 | |
| 235 | // mergeResourceList overlays the configured quantities onto the cloned ones, |
| 236 | // keeping cloned entries the overrides do not name. |
no test coverage detected