Closed awnns closed 1 year ago
Huh. Not sure I follow you.
caas
-> kubernetes
iaas
-> anything that's not kubernetes
This is all I think we need for now. Whether the non-k8s substrate is lxd, maas, or other things, it wouldn't make a difference for our use case. Although I do agree that making such a partial casting caas->k8s, iaas->'machine' doesn't sound like good practice or future-proof. I'd be fine with making get_substrate return the 'raw' type
(instead of model-type
) or, better, an Enum, and refactor the code using get_substrate to filter on that: if get_substrate() == Substrates.kubernetes...
Also see juju-thread on the topic: https://chat.charmhub.io/charmhub/pl/pfq6ky61fjnqzmxjgsta7pejxc
In that case I got myself a little confused. There's a little typo where they got switched around.
Oh! You're very much right. Thanks a lot :)
In
./helpers.py
,get_substrate()
is defined as:This does not work in practice, because our machine charms also report
model-type
as"iaas"
. A field that should set them apart istype
which says"lxd"
for us but I'm not sure I have all bases covered in terms of which values are possible here so I will wait a little with contributing a fix.