VolumeHash computes the configuration hash for a volume.
(o types.VolumeConfig)
| 53 | |
| 54 | // VolumeHash computes the configuration hash for a volume. |
| 55 | func VolumeHash(o types.VolumeConfig) (string, error) { |
| 56 | if o.Driver == "" { // (TODO: jhrotko) This probably should be fixed in compose-go |
| 57 | o.Driver = "local" |
| 58 | } |
| 59 | bytes, err := json.Marshal(o) |
| 60 | if err != nil { |
| 61 | return "", err |
| 62 | } |
| 63 | return digest.SHA256.FromBytes(bytes).Encoded(), nil |
| 64 | } |
no outgoing calls