1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-17 07:48:52 +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

@@ -17,6 +17,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/rest"
)
type Apply struct {
@@ -110,7 +111,8 @@ func (a *Apply) createApply(apiContext *types.APIRequest) (apply.Apply, error) {
}
apply := apply.New(client.Discovery(), func(gvr schema.GroupVersionResource) (dynamic.NamespaceableResourceInterface, error) {
dynamicClient, err := a.cg.DynamicClient(apiContext)
// don't record warnings from apply
dynamicClient, err := a.cg.DynamicClient(apiContext, rest.NoWarnings{})
if err != nil {
return nil, err
}