https://pulumi.com logo
#general
Title
# general
c

calm-greece-42329

02/23/2019, 12:02 AM
if
core.v1.Secret
doesn’t have
.id
, whats the recommended path for adding it to a volume?
c

creamy-potato-29402

02/23/2019, 12:03 AM
It doesn’t have an
id
field in the YAML either.
you would use
.metadata.name
, no?
c

calm-greece-42329

02/23/2019, 12:04 AM
hmm yes that would work, let me see how i can extract it from the Output
c

creamy-potato-29402

02/23/2019, 12:05 AM
This will improve soon, but for now:
whatever.metadata.apply(m => m.name)
c

calm-greece-42329

02/23/2019, 12:06 AM
perfect thats what i just did
i was going to ask if that was the most correct 👍
c

creamy-potato-29402

02/23/2019, 12:06 AM
Soon this will just be something like
foo.metadata.name
or something, but that’s next release.
c

calm-greece-42329

02/23/2019, 12:12 AM
😮
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

creamy-potato-29402

02/23/2019, 12:14 AM
as it happens we are starting to build higher-level interfaces for this sort of thing.
g

gorgeous-egg-16927

02/23/2019, 12:14 AM
you can see a WIP PR for this change here: https://github.com/pulumi/pulumi-kubernetes/pull/399/files
c

creamy-potato-29402

02/23/2019, 12:15 AM
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

calm-greece-42329

02/23/2019, 12:17 AM
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

creamy-potato-29402

02/23/2019, 12:17 AM
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

calm-greece-42329

02/23/2019, 12:18 AM
perfect, i tried that before but i didnt know how to import that correctly
c

creamy-potato-29402

02/23/2019, 12:19 AM
it’s tricky.
We hide it because it’s a ton of types and most of them are not useful.