Closed sboett-dev closed 1 month ago
Hi,
we indent to only allow workload names matching [a-zA-Z0-9][a-zA-Z0-9_.-]*
. Unfortunately this is currently not documented and not enforced on the startup state.
We cannot allow "." in workload names, as we use it as separator in the filter-, field- and update-mask and also in the workload instance name.
What we should do now is to introduce a new data structure WorkloadName
, which enforces the correct naming (also when deserialzing from yaml). This new data structure can then be used in the intern data structures common::objects::State
and common::objects::WorkloadSpec
. In this way it will also fail for the startup state and the error message for the ank command can be improved.
Thanks for the clarification! Enforcing it would make sense as Ankaios and the ank CLI should treat YAML files exactly the same.
@windsource proposed to also restrict the length of the names.
We could also make a suggestion in the documentation for a separator, i.e.: "_", "-"
I am currently working on this.
As we are already adding some constraints on the workload names here, we can also limit the length of the names to avoid problems later. The name length is currently limited by the max length of a container name so a max_workload_name_length = max_podman_container_name - 2 (for the two dots) - max_agent_name - max_id_legth. The calculation above shows that we shall limit the agent name too.
To get an initial impression, we can start here by finding out what the limits of other possible runtimes are, e.g., docker, crun, containerd, system processes (native workloads), northstar, or how other orchestrators handle this.
All done here. The changes will be released with v0.5.0.
Workload names containing a dot work in the Ankaios init state file. But when calling
ank apply file.yml
, the ank CLI crashes.Current Behavior
ank --insecure apply test.yml
With backtrace:
RUST_BACKTRACE=full ank --insecure apply test.yml
Expected Behavior
The workload is applied.
Steps to Reproduce
Create the test.yml file:
Then call
ank --insecure apply test.yml
Context (Environment)
EWAOL, arm64, AWS EC2 t4g.large systemd 250 (250.5+) podman version 4.3.1-dev Ankaios 0.3.1 and 0.4.0 (earlier versions not tested)
Logs
see above.
Additional Information
In the init state file read by the Ankaios server on startup, dots in workload names do work.
Final result
To be filled by the one closing the issue.