if `core.v1.Secret` doesn’t have `.id`, whats the ...
# general
c
if
core.v1.Secret
doesn’t have
.id
, whats the recommended path for adding it to a volume?
c
It doesn’t have an
id
field in the YAML either.
you would use
.metadata.name
, no?
c
hmm yes that would work, let me see how i can extract it from the Output
c
This will improve soon, but for now:
whatever.metadata.apply(m => m.name)
c
perfect thats what i just did
i was going to ask if that was the most correct 👍
c
Soon this will just be something like
foo.metadata.name
or something, but that’s next release.
c
😮
handling that on the outputs was one of the bigger 😕’s for me
i was also thinking it would be nice to export
core.v1.Container
, because i have some pods that have many containers and i define them as separate values to keep the deployment from getting too long
i can’t type them to Container for validation in my IDE
c
as it happens we are starting to build higher-level interfaces for this sort of thing.
g
you can see a WIP PR for this change here: https://github.com/pulumi/pulumi-kubernetes/pull/399/files
c
you can imagine something like:
container("nginx", "nginx").mountFile("foo.txt", "nginx").deploy(3)
or something.
the
Output<T>
stuff is weird because we need a way to communicate that the values are computed, but common patterns should be very little code.
c
yeah if this goes well i figure i would be generating some helpers to modify or spawn resources that meet our internal standards
so like inject require labels, specific annotations on ingresses, that kind of thing.
c
in the mean time you can use
@pulumi/kubernetes/types/input
this exposes ALLLLLLL the types.
All of them.
You can use that to prototpye individual containers.
c
perfect, i tried that before but i didnt know how to import that correctly
c
it’s tricky.
We hide it because it’s a ton of types and most of them are not useful.