MCPcopy Create free account
hub / github.com/cloudfoundry/bosh-agent / partitionPath

Method partitionPath

platform/linux_platform.go:1882–1891  ·  view source on GitHub ↗
(devicePath string, partitionNumber int)

Source from the content-addressed store, hash-verified

1880}
1881
1882func (p linux) partitionPath(devicePath string, partitionNumber int) string {
1883 switch {
1884 case strings.HasPrefix(devicePath, "/dev/nvme"):
1885 return fmt.Sprintf("%sp%s", devicePath, strconv.Itoa(partitionNumber))
1886 case strings.HasPrefix(devicePath, "/dev/mapper/"):
1887 return fmt.Sprintf("%s-part%s", devicePath, strconv.Itoa(partitionNumber))
1888 default:
1889 return fmt.Sprintf("%s%s", devicePath, strconv.Itoa(partitionNumber))
1890 }
1891}
1892
1893func (p linux) generateDefaultEtcHosts(hostname string) (*bytes.Buffer, error) {
1894 buffer := bytes.NewBuffer([]byte{})

Callers 6

SetupRootDiskMethod · 0.95
MountPersistentDiskMethod · 0.95
UnmountPersistentDiskMethod · 0.95
partitionDiskMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected