Skip to content

Commit

Permalink
Merge pull request #1240 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…1238-to-release-8.0

[release-8.0] Fix Snapshot Controller's unbounded VolumeSnapshot list call on startup
  • Loading branch information
k8s-ci-robot authored Dec 10, 2024
2 parents 84b3b39 + 8531b4e commit 6907e94
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 @@ -83,9 +83,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 6907e94

Please sign in to comment.