Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for LoadPodFromFile (0.31 sec)

  1. 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)
  2. 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