MCPcopy Create free account
hub / github.com/cozystack/cozystack / drained

Method drained

internal/fluxshardoperator/provisioner.go:227–233  ·  view source on GitHub ↗

drained reports whether no HelmRelease carries the given shard key anymore.

(ctx context.Context, shardKey string)

Source from the content-addressed store, hash-verified

225
226// drained reports whether no HelmRelease carries the given shard key anymore.
227func (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.

Callers 2

pruneExtraShardsMethod · 0.95
retireLegacyMethod · 0.95

Calls 2

HelmReleaseMetaListFunction · 0.85
ListMethod · 0.65

Tested by

no test coverage detected