Skip to content

Commit

Permalink
Merge pull request #1238 from AndrewSirenko/fix-snapshot-controller
Browse files Browse the repository at this point in the history
Fix Snapshot Controller's unbounded VolumeSnapshot list call on startup
  • Loading branch information
k8s-ci-robot authored Dec 10, 2024
2 parents 78efd29 + 965e259 commit 46e8028
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 46e8028

Please sign in to comment.