Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for LoadPodFromFile (0.14 sec)

  1. cmd/kube-controller-manager/app/plugins.go

    // If unsuccessful, an error is returned. Function is exported for reuse downstream.
    func AttemptToLoadRecycler(path string, config *volume.VolumeConfig) error {
    	if path != "" {
    		recyclerPod, err := volumeutil.LoadPodFromFile(path)
    		if err != nil {
    			return err
    		}
    		if err = volume.ValidateRecyclerPodTemplate(recyclerPod); err != nil {
    			return fmt.Errorf("pod specification (%v): %v", path, err)
    		}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 30 15:17:15 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  2. pkg/volume/util/util.go

    	class, err := kubeClient.StorageV1().StorageClasses().Get(context.TODO(), className, metav1.GetOptions{})
    	if err != nil {
    		return nil, err
    	}
    	return class, nil
    }
    
    // LoadPodFromFile will read, decode, and return a Pod from a file.
    func LoadPodFromFile(filePath string) (*v1.Pod, error) {
    	if filePath == "" {
    		return nil, fmt.Errorf("file path not specified")
    	}
    	podDef, err := os.ReadFile(filePath)
    	if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 31 12:32:15 UTC 2024
    - 28.8K bytes
    - Viewed (0)
  3. pkg/volume/util/util_test.go

    			t.Fatalf("cannot save temporary file: %v", err)
    		}
    		if err = tempFile.Close(); err != nil {
    			t.Fatalf("cannot close temporary file: %v", err)
    		}
    
    		pod, err := LoadPodFromFile(tempFile.Name())
    		if test.expectError {
    			if err == nil {
    				t.Errorf("test %q expected error, got nil", test.name)
    			}
    		} else {
    			// no error expected
    			if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 31 12:32:15 UTC 2024
    - 28.7K bytes
    - Viewed (0)
Back to top