This definition provides a shortcut to assign containers to networks. The network name is the first level, the container name the second level.
There is nothing special about this, you can also assign containers to networks directly in the container definition, but when there are many containers and complex definitions its harder to get an overview of what container is in what network.
{
for network, containerList in X1
for name in containerList {
"\(name)": spec: unit: Container: Network: [
for net, members in X1
if list.Contains(members, name) {"\(net).network"},
]
}
}Accepts a struct from @embed(glob=creds-*.enc.yaml,type=text,allowEmptyGlob) and returns a struct with matching secret specs. The name is taken from the file name, stripping the creds- prefix and the enc.yaml suffix.
The files must be in the same directory as the CUE file: for a glob into a subdirectory, @embed keeps the directory in the key, so the prefix isn't stripped and the spec name contains the path.
Renders the provided sysdef struct in syslet json format, to be consumed by syslet via file or stdin.
This definition provides a shortcut to lock the given network/container/volumes.
Locking means that we disallow removal, and for volumes, we also set reclaim policy to retain so data wont be accidentally deleted.