Skip to content

Commit c0940af

Browse files
phm07jooola
andauthored
feat: add volume format property (#397)
This property was previously missing, although it was already used in VolumeCreateOpts. It's now a string pointer with common values (ext4 and xfs) available as string constants. --------- Co-authored-by: pauhull <[email protected]> Co-authored-by: Jonas L. <[email protected]>
1 parent 49be506 commit c0940af

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

hcloud/schema/volume.go

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ type Volume struct {
1010
Status string `json:"status"`
1111
Location Location `json:"location"`
1212
Size int `json:"size"`
13+
Format *string `json:"format"`
1314
Protection VolumeProtection `json:"protection"`
1415
Labels map[string]string `json:"labels"`
1516
LinuxDevice string `json:"linux_device"`

hcloud/schema_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,7 @@ func TestVolumeSchema(t *testing.T) {
662662
"name": "db-storage",
663663
"status": "creating",
664664
"server": 2,
665+
"format": "xfs",
665666
"location": {
666667
"id": 1,
667668
"name": "fsn1",

hcloud/volume.go

+6
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,18 @@ type Volume struct {
2121
Server *Server
2222
Location *Location
2323
Size int
24+
Format *string
2425
Protection VolumeProtection
2526
Labels map[string]string
2627
LinuxDevice string
2728
Created time.Time
2829
}
2930

31+
const (
32+
VolumeFormatExt4 = "ext4"
33+
VolumeFormatXFS = "xfs"
34+
)
35+
3036
// VolumeProtection represents the protection level of a volume.
3137
type VolumeProtection struct {
3238
Delete bool

hcloud/zz_schema.go

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)