This message was deleted.
# python
s
This message was deleted.
b
@white-forest-65475 the format for
.get
is
<namespace>/<service-name>
w
Do you mean I should try:
Copy code
argocd_service = k8s.core.v1.Service.get(namespace.metadata.name, "argocd-server")
This produces an error about expecting a name. I also tried:
Copy code
argocd_service = k8s.core.v1.Service.get(pulumi.Output.concat(namespace.metadata.name, "/argocd-server"))
But this fails with a typerror as
.get
requires at least 2 args -
resource_name
and `id`: https://github.com/pulumi/pulumi-kubernetes/blob/3157468a01a22603ae0a2e618851929770c1b762/sdk/python/pulumi_kubernetes/core/v1/Service.py#L285-L286
b
Copy code
argocd_service = k8s.core.v1.Service.get("argo-service", pulumi.Output.concat(namespace.metadata.name, "/argocd-server"))
the first argument is the name you want to pass to your resource
the second is the id of it
w
Ahah! A new error, but an expected one. Thanks! Just to check something - this doesn’t create a new Service resource, right? The ConfigGroup created this Service resource first and I’m just trying to extract info from it, not build a new one. I guess all resources must have a name even if those names don’t end up resulting in any diff output?
b
correct, it retrieves an existing resource
🙌 1
w
Worked. Thanks again! That’s twice you’ve helped me… is there anything I can do to help you? 🙂
b
spread the Pulumi word far and wide 😄
👍 2
w
I’m building this as a POC for a devops org I’m about to start working at in two weeks, so maybe I can convince them 🙂 fairly large org, so it would be a big shift, but I like to bring a pitch with me.
b
feel free to DM me, I can send out some swag
w
cheers! might do.