1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-08 02:39:26 +00:00

Initial implmentation of warning headers

Attempts to pass through warning headers which k8s returns.
Requires an update to rancher/apiserver.
This commit is contained in:
Michael Bolot
2022-12-16 10:12:57 -06:00
committed by Chad Roberts
parent 7565dba268
commit 956b7351aa
9 changed files with 148 additions and 118 deletions

View File

@@ -5,6 +5,8 @@ import (
"encoding/base64"
"encoding/json"
"github.com/rancher/apiserver/pkg/types"
"golang.org/x/sync/errgroup"
"golang.org/x/sync/semaphore"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
@@ -33,7 +35,7 @@ type ParallelPartitionLister struct {
}
// PartitionLister lists objects for one partition.
type PartitionLister func(ctx context.Context, partition Partition, cont string, revision string, limit int) (*unstructured.UnstructuredList, error)
type PartitionLister func(ctx context.Context, partition Partition, cont string, revision string, limit int) (*unstructured.UnstructuredList, []types.Warning, error)
// Err returns the latest error encountered.
func (p *ParallelPartitionLister) Err() error {
@@ -174,7 +176,7 @@ func (p *ParallelPartitionLister) feeder(ctx context.Context, state listState, l
if partition.Name() == state.PartitionName {
cont = state.Continue
}
list, err := p.Lister(ctx, partition, cont, state.Revision, limit)
list, _, err := p.Lister(ctx, partition, cont, state.Revision, limit)
if err != nil {
return err
}