#Dagger Service and it's references

1 messages · Page 1 of 1 (latest)

feral linden
#

< Not sure what to title it as>
Problem:
I am writing a module "A" that is then calling a function in another module "B". I am creating a dagger service (my-registry) in module A's function and then immediately call module B's function. However it cannot resolve the service "my-registry" in Module B's function.

Test: I add terminal() in A's function right before call B's function, i can resolve the host my-registry, but when i add terminal() in B's function, i cannot resolve the host my-registry.

Can anyone help shed light if this is expected or if I am doing something incorrect?

#

starting the service like:

example_registry = (dag.container()
                        .from_("nignx")
                        .as_service().with_hostname("my-registry"))
await example_registry.start()

dag.modB().publish(url="http://my-registry")
await example_registry.stop()
obtuse gazelle
feral linden
#

this comes from me writing a test for the module.

#

so basically i am spinning up a registry.
then i am testing my publish function to be able to push to a registry by passing in a URL

#

i do not want to update the modB's function signature.

feral linden
obtuse gazelle
#

I can't really think of a clean way in making this work within Dagger. The fact that Publish doesn't currently allow targeting services, makes the testing part not so easy