-
Notifications
You must be signed in to change notification settings - Fork 457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify volume attachment #81
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement 馃憤
Elem: &schema.Resource{ | ||
Schema: diskCommonSchema(), | ||
Elem: &schema.Schema{ | ||
Type: schema.TypeString, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you forgot to use gofmt
on the file :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I thought I did! Thanks for pointing out, fixed.
e78f223
to
30f43be
Compare
The original idea of using volume_id inside disk is because not all disks are volumes, and not all volumes are disks. So if you want to add a cdrom explicitly, you will need a This PR assumes that all disks are volumes, that is the case right now, but closes the door to support other types to solve a completely unrelated problem of variable expansion. |
After discussing on irc for a while I am:
In any case, while volume_attachment is also wrong in the sense that you don't attach volumes to domains, but disks to domains, and disks can be volumes:
May satisfy the conceptual libvirt model and solve @moio 's problem ? So you would create a volume resource, a disk resource referencing it, and attachment resource. disk resource @moio ? |
@dmacvicar understand and agree. Closing this PR now, adding your comment to #79 as to the preferred ways to solve this issue. |
This changes the syntax to attach a volume to a domain from:
to:
Besides simplification, this has the advantage of allowing to use interpolation to create variable-volume resources. Example:
Original motivation for this was to DRY-up the package-mirror and minion-swarm modules in sumaform.
Please see the discussion in issue #79, I needed to get this fixed so after some days I attempted myself. I am a total newbie in Go and in this project so please bear with me 馃槈!
Also note this is on top of PR #80.