Skip to content

Commit 7d7b4a1

Browse files
committed
cli/compose/types: ServiceVolumeConfig: use strong type for Consistency field
Using a strong type for this field, to make it clearer what's supported, and to allow assigning values without having to cast them. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 900971c commit 7d7b4a1

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎cli/compose/convert/volume.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func createMountFromVolume(volume composetypes.ServiceVolumeConfig) mount.Mount
3030
Target: volume.Target,
3131
ReadOnly: volume.ReadOnly,
3232
Source: volume.Source,
33-
Consistency: mount.Consistency(volume.Consistency),
33+
Consistency: volume.Consistency,
3434
}
3535
}
3636

‎cli/compose/types/types.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ type ServiceVolumeConfig struct {
390390
Source string `yaml:",omitempty" json:"source,omitempty"`
391391
Target string `yaml:",omitempty" json:"target,omitempty"`
392392
ReadOnly bool `mapstructure:"read_only" yaml:"read_only,omitempty" json:"read_only,omitempty"`
393-
Consistency string `yaml:",omitempty" json:"consistency,omitempty"`
393+
Consistency mount.Consistency `yaml:",omitempty" json:"consistency,omitempty"`
394394
Bind *ServiceVolumeBind `yaml:",omitempty" json:"bind,omitempty"`
395395
Volume *ServiceVolumeVolume `yaml:",omitempty" json:"volume,omitempty"`
396396
Tmpfs *ServiceVolumeTmpfs `yaml:",omitempty" json:"tmpfs,omitempty"`

0 commit comments

Comments
 (0)