- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 11 for WithWarningRecorder (0.45 sec)
-
staging/src/k8s.io/apiserver/pkg/warning/context.go
// text must be valid UTF-8, and must not contain control characters. AddWarning(agent, text string) } // WithWarningRecorder returns a new context that wraps the provided context and contains the provided Recorder implementation. // The returned context can be passed to AddWarning(). func WithWarningRecorder(ctx context.Context, recorder Recorder) context.Context { return context.WithValue(ctx, warningRecorderKey, recorder) }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Oct 24 16:37:53 UTC 2022 - 2.1K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/endpoints/filters/warning.go
"k8s.io/apiserver/pkg/warning" ) // WithWarningRecorder attaches a deduplicating k8s.io/apiserver/pkg/warning#WarningRecorder to the request context. func WithWarningRecorder(handler http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { recorder := &recorder{writer: w} req = req.WithContext(warning.WithWarningRecorder(req.Context(), recorder)) handler.ServeHTTP(w, req) }) }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Jul 01 16:14:06 UTC 2020 - 3.6K bytes - Viewed (0) -
pkg/registry/batch/job/storage/storage_test.go
defer server.Terminate(t) defer storage.Job.Store.DestroyFunc() dc := dummyRecorder{agent: "", text: ""} ctx = genericapirequest.WithRequestInfo(ctx, test.requestInfo) ctxWithRecorder := warning.WithWarningRecorder(ctx, &dc) // Create the object if err := storage.Job.Storage.Create(ctxWithRecorder, key, job, nil, 0, false); err != nil { t.Fatalf("unexpected error: %v", err) }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Apr 15 14:34:53 UTC 2024 - 11.2K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/authentication/request/bearertoken/bearertoken_test.go
}, } for k, tc := range tests { dc := dummyRecorder{agent: "", text: ""} ctx := genericapirequest.NewDefaultContext() ctxWithRecorder := warning.WithWarningRecorder(ctx, &dc) req, _ := http.NewRequestWithContext(ctxWithRecorder, "GET", "/", nil) for _, h := range tc.AuthorizationHeaders { req.Header.Add("Authorization", h) } bearerAuth := New(tc.TokenAuth)
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Apr 25 13:22:28 UTC 2022 - 8.8K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator.go
defer cancel() if audsOk { ctx = authenticator.WithAudiences(ctx, auds) } recorder := &recorder{} ctx = warning.WithWarningRecorder(ctx, recorder) ctx = audit.WithAuditContext(ctx) ac := audit.AuditContextFrom(ctx) // since this is shared work between multiple requests, we have no way of knowing if any
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Jul 03 16:16:51 UTC 2023 - 9.8K bytes - Viewed (0) -
plugin/pkg/admission/security/podsecurity/admission_test.go
admission.Update, &metav1.UpdateOptions{}, false, &user.DefaultInfo{Name: "myuser"}, ) b.ResetTimer() for i := 0; i < b.N; i++ { dc := dummyRecorder{agent: "", text: ""} ctxWithRecorder := warning.WithWarningRecorder(ctx, &dc) if err := p.Validate(ctxWithRecorder, attrs, nil); err != nil { b.Fatal(err) } // should either be a single aggregated warning, or a unique warning per pod
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Jun 15 01:29:47 UTC 2022 - 10.7K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/validating/admission_test.go
}) testContext := setupFakeTest(t, compiler, matcher) require.NoError(t, testContext.UpdateAndWait(fakeParams, denyPolicy, denyBinding)) warningRecorder := newWarningRecorder() warnCtx := warning.WithWarningRecorder(testContext, warningRecorder) attr := attributeRecord(nil, fakeParams, admission.Create) err := testContext.Plugin.Dispatch( warnCtx, // Object is irrelevant/unchecked for this test. Just test that
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Mar 25 01:39:01 UTC 2024 - 63.8K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/server/config.go
handler = genericfilters.WithCORS(handler, c.CorsAllowedOriginList, nil, nil, nil, "true") // WithWarningRecorder must be wrapped by the timeout handler // to make the addition of warning headers threadsafe handler = genericapifilters.WithWarningRecorder(handler) // WithTimeoutForNonLongRunningRequests will call the rest of the request handling in a go-routine with the
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue May 28 08:48:22 UTC 2024 - 47.7K bytes - Viewed (0) -
pkg/registry/core/pod/strategy_test.go
assert.Nil(t, pod.Spec.Containers[0].SecurityContext) }, }} for _, test := range tests { t.Run(test.description, func(t *testing.T) { warnings := &warningRecorder{} ctx := warning.WithWarningRecorder(context.Background(), warnings) applyAppArmorVersionSkew(ctx, test.pod) test.validation(t, test.pod) if test.expectWarning { if assert.NotEmpty(t, warnings.warnings, "expect warnings") {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Apr 24 18:25:29 UTC 2024 - 76.2K bytes - Viewed (0) -
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation_test.go
t.Run(c.name, func(t *testing.T) { validator := NewValidator(c.schema, false, celconfig.PerCallLimit) require.NotNil(t, validator) recorder := &warningRecorder{} ctx := warning.WithWarningRecorder(context.TODO(), recorder) budget := c.runtimeCostBudget if budget == 0 { budget = celconfig.RuntimeCELCostBudget } errs, _ := validator.Validate( ctx, field.NewPath("root"),
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Jun 04 17:14:10 UTC 2024 - 159.9K bytes - Viewed (0)