Skip to content

Commit

Permalink
wip: Snapshot Controller startup should not LIST all volumesnapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSirenko committed Dec 9, 2024
1 parent c0cb7b7 commit 965e259
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/snapshot-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ var version = "unknown"
func ensureCustomResourceDefinitionsExist(client *clientset.Clientset, enableVolumeGroupSnapshots bool) error {
condition := func(ctx context.Context) (bool, error) {
var err error
// List calls should return faster with a limit of 0.
// List calls should return faster with a limit of 1.
// We do not care about what is returned and just want to make sure the CRDs exist.
listOptions := metav1.ListOptions{Limit: 0}
listOptions := metav1.ListOptions{Limit: 1}

// scoping to an empty namespace makes `List` work across all namespaces
_, err = client.SnapshotV1().VolumeSnapshots("").List(ctx, listOptions)
Expand Down

0 comments on commit 965e259

Please sign in to comment.