Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for ErrorContains (3.98 sec)

  1. staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/plugin_test.go

    		}
    		// ErrWebhookRejected is not an error for our purposes
    		if tt.ErrorContains != "" {
    			if err == nil || !strings.Contains(err.Error(), tt.ErrorContains) {
    				t.Errorf("%s: expected an error saying %q, but got %v", tt.Name, tt.ErrorContains, err)
    			}
    		}
    		if _, isStatusErr := err.(*errors.StatusError); err != nil && !isStatusErr {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 01 06:06:52 UTC 2024
    - 11.9K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/testing/testcase.go

    	IsCRD                  bool
    	IsDryRun               bool
    	AdditionalLabels       map[string]string
    	SkipBenchmark          bool
    	ExpectLabels           map[string]string
    	ExpectAllow            bool
    	ErrorContains          string
    	ExpectAnnotations      map[string]string
    	ExpectStatusCode       int32
    	ExpectReinvokeWebhooks map[string]bool
    }
    
    // MutatingTest is a mutating webhook test case.
    type MutatingTest struct {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 03 06:51:04 UTC 2023
    - 47.6K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/plugin_test.go

    				}
    			}
    			// ErrWebhookRejected is not an error for our purposes
    			if tt.ErrorContains != "" {
    				if err == nil || !strings.Contains(err.Error(), tt.ErrorContains) {
    					t.Errorf("expected an error saying %q, but got: %v", tt.ErrorContains, err)
    				}
    			}
    			if statusErr, isStatusErr := err.(*errors.StatusError); err != nil && !isStatusErr {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 01 06:06:52 UTC 2024
    - 11K bytes
    - Viewed (0)
  4. pkg/test/framework/components/echo/check/checkers.go

    	return func(_ echo.CallResult, err error) error {
    		if err == nil {
    			return errors.New("expected error, but none occurred")
    		}
    		return nil
    	}
    }
    
    // ErrorContains is similar to Error, but checks that the error message contains the given string.
    func ErrorContains(expected string) echo.Checker {
    	return func(_ echo.CallResult, err error) error {
    		if err == nil {
    			return errors.New("expected error, but none occurred")
    		}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Mar 03 16:19:07 UTC 2023
    - 17.5K bytes
    - Viewed (0)
  5. pkg/kubelet/userns/userns_manager_test.go

    	testUserNsPodsManager := &failingUserNsPodsManager{}
    	_, err := MakeUserNsManager(testUserNsPodsManager)
    	assert.Error(t, err)
    	assert.ErrorContains(t, err, "read pods from disk")
    }
    
    func TestRecordBounds(t *testing.T) {
    	featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, pkgfeatures.UserNamespacesSupport, true)
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 25 14:24:16 UTC 2024
    - 14.6K bytes
    - Viewed (0)
  6. pkg/proxy/util/nfacct/nfacct_linux_test.go

    	for _, tc := range testCases {
    		t.Run(tc.name, func(t *testing.T) {
    			rnr, err := newInternal(tc.handler)
    			assert.NoError(t, err)
    
    			err = rnr.Add(tc.counterName)
    			if tc.err != nil {
    				assert.ErrorContains(t, err, tc.err.Error())
    			} else {
    				assert.NoError(t, err)
    			}
    
    			// validate number of requests
    			assert.Equal(t, tc.netlinkCalls, len(tc.handler.requests))
    
    			if tc.netlinkCalls > 0 {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Apr 27 06:47:50 UTC 2024
    - 18.8K bytes
    - Viewed (0)
Back to top