feat: Default volumes and images when versions set#3
Conversation
5fd1e88 to
2a18e5c
Compare
|
@richardcase what do you think of this idea? Connected PRs |
2a18e5c to
3937a5c
Compare
yitsushi
left a comment
There was a problem hiding this comment.
I love all the little pieces of this PR. The tests, the github action, the simplifications or newVM... all of it. ![]()
|
😊 very sweet review, BUT i have just seen one thing that is wrong, and one thing which I could probably name better 😅 |
|
Actually... I think I have changed my mind about having this feature. The kernel and os paths get harder to predict the more variation we add. For example, there is a Also the validation to make sure various fields are set correctly exists somewhere else, which just seems brittle to me and something we are likely to forget or be confused about later. Honestly this feature was just a 'nice to have', and now feels more like a 'pain in the ass to have'. Most users likely will not be harmed by having to specify things in yaml and it is probably better to have less magic going on anyway. I think I want to keep all the refactoring I did and remove the new bits, wdyt @yitsushi ? |
When users only set the `KernelVersion` and `OsVersion` fields, we
fill in the other fields required by flintlock based on those values.
For example, if given
```yaml
spec:
template:
spec:
kernelVersion: 5.10.77
osVersion: 1.23.5
```
We fill in the rest with:
```yaml
spec:
template:
spec:
rootVolume:
id: root
image: ghcr.io/weaveworks-liquidmetal/capmvm-kubernetes:1.23.5
kernel:
filename: "boot/vmlinux"
image: ghcr.io/weaveworks-liquidmetal/kernel-bin:5.10.77
additionalVolumes:
- id: modules
image: ghcr.io/weaveworks-liquidmetal/kernel-modules:5.10.77
mountPoint: /lib/modules/5.10.77
```
`convertToFlintlockAPI` has also been refactored to make it easier to
read, and tests have been added.
3937a5c to
847fb4a
Compare
That's what I wanted to suggest too after I read the title of the notification: "Actually... I think I have changed my mind about having this feature."
That's an interesting topic, this issue exists without this patch, someone tries to use firecracker images for cloudhypervisor. I know that's user error, but it's getting more and more complicated. I don't know a solution to that, but would be nice if we can add some constraints, for example Flintlock services report back what provider they are configured to use, and accept specs for that platform only and reject everything else (just a quick example/idea without thinking too much). |
|
Closing. Revert needed here: #6 |
When users only set the
KernelVersionandOsVersionfields, we fill in the other fields required by flintlock based on those values.For example, if given
We fill in the rest with:
convertToFlintlockAPIhas also been refactored to make it easier to read, and tests have been added.Part of https://github.com/weaveworks-liquidmetal/cluster-api-provider-microvm/issues/226
Follows #2