I am using k3s module and I am able to spawn a k3s service from the CLI with:
dagger -m github.com/marcosnils/daggerverse/k3s@833ec36632b2457862f6e3bf1f7107ad65e3e515 call --name my-cluster server up
However, in my dagger module I also run something like:
await dag.k3_s(name="my-cluster").server().start
I must start the service, otherwise when I don't start the service from CLI I cannot deploy anything to the cluster. On the other hand, this line of code re-starts the server that I previously launched from the CLI as shown above. Notice that k3s is able to connect to the same service instance from multiple locations in the same session, since each service is uniquely identified only be the name, therefore I was expecting that the call to service.sytart() would have been ignored considering that there was already the same service with the same name running from the CLI. Am I missing something?
Is there a way in Python SDK to check if a service is already running and attach to it?