Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for ValidatePodLogOptions (0.24 sec)

  1. pkg/apis/core/v1/validation/validation.go

    		}
    	}
    
    	return allErrs
    }
    
    // ValidatePodLogOptions checks if options that are set are at the correct
    // value. Any incorrect value will be returned to the ErrorList.
    func ValidatePodLogOptions(opts *v1.PodLogOptions) field.ErrorList {
    	allErrs := field.ErrorList{}
    	if opts.TailLines != nil && *opts.TailLines < 0 {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Oct 28 07:31:28 UTC 2023
    - 6.7K bytes
    - Viewed (0)
  2. pkg/apis/core/v1/validation/validation_test.go

    			TailLines:    &positiveLine,
    			SinceSeconds: &sinceSecondsGreaterThan1,
    		},
    	}}
    	for _, tc := range successCase {
    		t.Run(tc.name, func(t *testing.T) {
    			if errs := ValidatePodLogOptions(&tc.podLogOptions); len(errs) != 0 {
    				t.Errorf("unexpected error: %v", errs)
    			}
    		})
    	}
    
    	errorCase := []struct {
    		name          string
    		podLogOptions v1.PodLogOptions
    	}{{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Oct 28 07:31:28 UTC 2023
    - 11.2K bytes
    - Viewed (0)
  3. pkg/registry/core/pod/rest/log.go

    	logOpts, ok := opts.(*api.PodLogOptions)
    	if !ok {
    		return nil, fmt.Errorf("invalid options object: %#v", opts)
    	}
    
    	countSkipTLSMetric(logOpts.InsecureSkipTLSVerifyBackend)
    
    	if errs := validation.ValidatePodLogOptions(logOpts); len(errs) > 0 {
    		return nil, errors.NewInvalid(api.Kind("PodLogOptions"), name, errs)
    	}
    	location, transport, err := pod.LogLocation(ctx, r.Store, r.KubeletConn, name, logOpts)
    	if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 24 10:50:43 UTC 2023
    - 4.4K bytes
    - Viewed (0)
  4. pkg/kubelet/server/server.go

    		response.WriteError(http.StatusBadRequest, fmt.Errorf(`{"message": "Unable to decode query."}`))
    		return
    	}
    	logOptions.TypeMeta = metav1.TypeMeta{}
    	if errs := validation.ValidatePodLogOptions(logOptions); len(errs) > 0 {
    		response.WriteError(http.StatusUnprocessableEntity, fmt.Errorf(`{"message": "Invalid request."}`))
    		return
    	}
    
    	pod, ok := s.host.GetPodByName(podNamespace, podID)
    	if !ok {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 04 06:25:43 UTC 2024
    - 40.1K bytes
    - Viewed (0)
  5. pkg/apis/core/validation/validation.go

    	}
    	if !validOS.Has(os.Name) {
    		allErrs = append(allErrs, field.NotSupported(fldPath, os.Name, sets.List(validOS)))
    	}
    	return allErrs
    }
    
    func ValidatePodLogOptions(opts *core.PodLogOptions) field.ErrorList {
    	allErrs := field.ErrorList{}
    	if opts.TailLines != nil && *opts.TailLines < 0 {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 22:40:29 UTC 2024
    - 349.5K bytes
    - Viewed (0)
  6. pkg/apis/core/validation/validation_test.go

    		{core.PodLogOptions{SinceSeconds: &positive}, 0},
    		{core.PodLogOptions{SinceSeconds: &zero}, 1},
    		{core.PodLogOptions{SinceTime: &now}, 0},
    	}
    	for i, test := range tests {
    		errs := ValidatePodLogOptions(&test.opt)
    		if test.errs != len(errs) {
    			t.Errorf("%d: Unexpected errors: %v", i, errs)
    		}
    	}
    }
    
    func TestValidateConfigMap(t *testing.T) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 22:40:29 UTC 2024
    - 857.7K bytes
    - Viewed (0)
Back to top