Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 53 for NewBadRequest (0.21 sec)

  1. pkg/registry/core/pod/strategy_test.go

    				ObjectMeta: metav1.ObjectMeta{Name: fakePodName},
    				Spec:       api.PodSpec{},
    				Status:     api.PodStatus{},
    			},
    			opts:              &api.PodLogOptions{},
    			expectedErr:       errors.NewBadRequest("a container name must be specified for pod test"),
    			expectedTransport: nil,
    		},
    		{
    			name: "choice of two containers",
    			in: &api.Pod{
    				ObjectMeta: metav1.ObjectMeta{Name: fakePodName},
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 76.2K bytes
    - Viewed (0)
  2. plugin/pkg/admission/runtimeclass/admission.go

    	pod, ok := attributes.GetObject().(*api.Pod)
    	if !ok {
    		return nil, nil, apierrors.NewBadRequest("Resource was marked with kind Pod but was unable to be converted")
    	}
    
    	if pod.Spec.RuntimeClassName == nil {
    		return pod, nil, nil
    	}
    
    	// get RuntimeClass object
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Feb 05 05:53:38 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  3. plugin/pkg/admission/imagepolicy/admission.go

    		return nil
    	}
    
    	pod, ok := attributes.GetObject().(*api.Pod)
    	if !ok {
    		return apierrors.NewBadRequest("Resource was marked with kind Pod but was unable to be converted")
    	}
    
    	// Build list of ImageReviewContainerSpec
    	var imageReviewContainerSpecs []v1alpha1.ImageReviewContainerSpec
    	if subresource == "" {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jun 02 06:05:06 UTC 2023
    - 9.8K bytes
    - Viewed (0)
  4. staging/src/k8s.io/cli-runtime/pkg/resource/helper_test.go

    			err:             apierrors.NewBadRequest("request is invalid"),
    			opts:            metav1.ListOptions{},
    			subj:            podSubject,
    			expectedErr:     "Unable to list \"/v1, Resource=pods\": request is invalid",
    			expectStatusErr: true,
    		}, {
    			name: "bad request StatusError with selectors",
    			err:  apierrors.NewBadRequest("request is invalid"),
    			opts: metav1.ListOptions{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jun 02 09:47:52 UTC 2023
    - 25.2K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/watch.go

    	if framer == nil {
    		// programmer error
    		err := fmt.Errorf("no stream framing support is available for media type %q", s.MediaType)
    		utilruntime.HandleError(err)
    		s.Scope.err(errors.NewBadRequest(err.Error()), w, req)
    		return
    	}
    
    	// ensure the connection times out
    	timeoutCh, cleanup := s.TimeoutFactory.TimeoutCh()
    	defer cleanup()
    
    	// begin the stream
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Dec 14 16:37:25 UTC 2023
    - 11.4K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store.go

    	ns, ok := genericapirequest.NamespaceFrom(ctx)
    	if !ok || len(ns) == 0 {
    		return "", apierrors.NewBadRequest("Namespace parameter required.")
    	}
    	if len(name) == 0 {
    		return "", apierrors.NewBadRequest("Name parameter required.")
    	}
    	if msgs := path.IsValidPathSegmentName(name); len(msgs) != 0 {
    		return "", apierrors.NewBadRequest(fmt.Sprintf("Name parameter invalid: %q: %s", name, strings.Join(msgs, ";")))
    	}
    	key = key + "/" + name
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jan 19 23:22:44 UTC 2024
    - 60.8K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/endpoints/filters/request_deadline_test.go

    		auditExpected                 bool
    	}{
    		{
    			name:                          "bad request, the error handler is invoked and the request is audited",
    			statusErr:                     apierrors.NewBadRequest("error serving request"),
    			errorHandlerCallCountExpected: 1,
    			statusCodeExpected:            http.StatusBadRequest,
    			auditExpected:                 true,
    		},
    	}
    
    	for _, test := range tests {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 14 23:04:34 UTC 2022
    - 16.7K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apimachinery/pkg/api/errors/errors.go

    	} else {
    		err.ErrStatus.Message = fmt.Sprintf("%s %q is invalid: %v", qualifiedKind.String(), name, aggregatedErrs)
    	}
    	return err
    }
    
    // NewBadRequest creates an error that indicates that the request is invalid and can not be processed.
    func NewBadRequest(reason string) *StatusError {
    	return &StatusError{metav1.Status{
    		Status:  metav1.StatusFailure,
    		Code:    http.StatusBadRequest,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 21 03:41:32 UTC 2022
    - 30.5K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apimachinery/pkg/api/errors/errors_test.go

    		t.Errorf("expected to be %s", metav1.StatusReasonNotFound)
    	}
    	if !IsInvalid(NewInvalid(kind("Test"), "2", nil)) {
    		t.Errorf("expected to be %s", metav1.StatusReasonInvalid)
    	}
    	if !IsBadRequest(NewBadRequest("reason")) {
    		t.Errorf("expected to be %s", metav1.StatusReasonBadRequest)
    	}
    	if !IsForbidden(NewForbidden(resource("tests"), "2", errors.New("reason"))) {
    		t.Errorf("expected to be %s", metav1.StatusReasonForbidden)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Oct 28 07:31:28 UTC 2023
    - 19.5K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apimachinery/pkg/util/proxy/upgradeaware.go

    func (h *UpgradeAwareHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
    	if h.tryUpgrade(w, req) {
    		return
    	}
    	if h.UpgradeRequired {
    		h.Responder.Error(w, req, errors.NewBadRequest("Upgrade request required"))
    		return
    	}
    
    	loc := *h.Location
    	loc.RawQuery = req.URL.RawQuery
    
    	// If original request URL ended in '/', append a '/' at the end of the
    	// of the proxy URL
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Mar 04 19:10:30 UTC 2024
    - 19.6K bytes
    - Viewed (0)
Back to top