Does the k8s configFile() or any versions of it su...
# general
g
Does the k8s configFile() or any versions of it supports passing the string instead of file? case is to have a mapped template, and I don’t want to write down final result to a file..? I use jinja2 to render a file to a string
m
I have the same need, I tried to create an ouput string asset and pass that as file but does not work either. I opened this feature request https://github.com/pulumi/pulumi-kubernetes/issues/3174 asking for support of string assets in ConfigFile (I'm using python)
I asked a very similar question to yours in the #CRFURDVQB channel : https://pulumi-community.slack.com/archives/CRFURDVQB/p1723883782196159
Does ConfigFile.get_resource() exist? The documentation https://www.pulumi.com/docs/using-pulumi/adopting-pulumi/migrating-to-pulumi/from-kubernetes/ shows an example with
Copy code
guestbook = k8s.yaml.ConfigFile('guestbook', 'guestbook-all-in-one.yaml')
frontend = guestbook.get_resource('v1/Service', 'frontend')
but I don't actually see
get_resource
as a method on kubernetes.yaml.v2.ConfigFile
Copy code
<class 'pulumi_kubernetes.yaml.v2.ConfigFile.ConfigFile'> ['__annotations__', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_aliases', '_childResources', '_get_providers', '_internal_init', '_name', '_plugin_download_url', '_protect', '_provider', '_providers', '_remote', '_transformations', '_type', '_version', 'file', 'get_provider', 'register_outputs', 'resource_prefix', 'resources', 'skip_await', 'translate_input_property', 'translate_output_property', 'urn']