└── lib/k.libsonnet imports vendor/k8s-alpha
└── vendor/k8s-util imports lib/k.libsonnet
└── library imports vendor/k8s-util
- Known pattern, same as ksonnet-util/kausal.libsonnet
- It is clear that the library depends on opinionated library k8s-util
- Single import for both, k.libsonnet might be imported twice for the newcomer
└── lib/k.libsonnet imports vendor/k8s-alpha
└── library imports lib/k.libsonnet + vendor/k8s-util
- Changes pattern, all libraries now have to import both
- It is clear that the library depends on opinionated library k8s-util
- Two imports to get both, maybe k8s-util should say k8s-mixin to make clear k8s-util doesn't do much on its own?
└── lib/k.libsonnet imports vendor/k8s-alpha + vendor/k8s-util
└── library import lib/k.libsonnet
- Changes pattern, all libraries with kausal.libsonnet need to grab k.libsonnet
- It is unclear if the library depends on opionated functions in k8s-util, might make library less portable
- Single import for both
└── k8s provides new entrypoint: vendor/k8s-alpha-k8s-util
└── lib/k.libsonnet imports vendor/k8s-alpha-k8s-util
└── library import lib/k.libsonnet
- Changes pattern, all libraries with kausal.libsonnet need to grab k.libsonnet
- It is unclear if the library depends on opionated functions in k8s-util, might make library less portable
- Single import for both
I can come up with more options here, but it would circumvent the use of
lib/k.libsonnet
, but I think we want to keep the ability to switch k8s versions through k.libsonnet, which is the whole reason it exists.