Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for VolumeMapToSlice (0.2 sec)

  1. cmd/kubeadm/app/util/staticpod/utils.go

    func NewVolumeMount(name, path string, readOnly bool) v1.VolumeMount {
    	return v1.VolumeMount{
    		Name:      name,
    		MountPath: path,
    		ReadOnly:  readOnly,
    	}
    }
    
    // VolumeMapToSlice returns a slice of volumes from a map's values
    func VolumeMapToSlice(volumes map[string]v1.Volume) []v1.Volume {
    	v := make([]v1.Volume, 0, len(volumes))
    
    	for _, vol := range volumes {
    		v = append(v, vol)
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Jan 14 13:07:56 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  2. cmd/kubeadm/app/util/staticpod/utils_test.go

    		})
    	}
    }
    func TestVolumeMapToSlice(t *testing.T) {
    	testVolumes := map[string]v1.Volume{
    		"foo": {
    			Name: "foo",
    		},
    		"bar": {
    			Name: "bar",
    		},
    	}
    	volumeSlice := VolumeMapToSlice(testVolumes)
    	if len(volumeSlice) != 2 {
    		t.Errorf("Expected slice length of 1, got %d", len(volumeSlice))
    	}
    	if volumeSlice[0].Name != "bar" {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Sep 12 15:44:44 UTC 2023
    - 22.6K bytes
    - Viewed (0)
Back to top