Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pulumi Python : pulumi_kubernetes.ConfigFile throws TypeError #1226

Closed
kmr0877 opened this issue Jul 29, 2020 · 4 comments
Closed

Pulumi Python : pulumi_kubernetes.ConfigFile throws TypeError #1226

kmr0877 opened this issue Jul 29, 2020 · 4 comments
Assignees
Milestone

Comments

@kmr0877
Copy link

kmr0877 commented Jul 29, 2020

Problem description

I am trying to install KFServing using pulumi_kubernetes.ConfigFile using the code shown below.
Not sure if this is right approach to do it else if I am missing something?
Thanks for your help 😄

kfserving = pulumi_kubernetes.ConfigFile(
    'kfserving', 'kfserving.yaml'
)

kfserving.yaml downloaded from Kubeflow/KFserving

  • Other: The above manifest file works fine with command kubectl apply -f kfserving.yaml

Errors & Logs

error: Program failed with an unhandled exception:
    error: Traceback (most recent call last):
      File "C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin\pulumi-language-python-exec", line 85, in <module>
        loop.run_until_complete(coro)
      File "c:\users\appdata\local\programs\python\python37\Lib\asyncio\base_events.py", line 579, in run_until_complete
        return future.result()
      File "C:\Users\.virtualenvs\poc_kfserving-ag4xjMhI\lib\site-packages\pulumi\runtime\stack.py", line 81, in run_in_stack       
        await run_pulumi_func(lambda: Stack(func))
      File "C:\Users\.virtualenvs\poc_kfserving-ag4xjMhI\lib\site-packages\pulumi\runtime\stack.py", line 50, in run_pulumi_func    
        await RPC_MANAGER.rpcs.pop()
      File "C:\Users\.virtualenvs\poc_kfserving-ag4xjMhI\lib\site-packages\pulumi\runtime\rpc_manager.py", line 67, in rpc_wrapper  
        result = await rpc
      File "C:\Users\.virtualenvs\poc_kfserving-ag4xjMhI\lib\site-packages\pulumi\runtime\resource.py", line 474, in do_register_resource_outputs
        serialized_props = await rpc.serialize_properties(outputs, {})
      File "C:\Users\.virtualenvs\poc_kfserving-ag4xjMhI\lib\site-packages\pulumi\runtime\rpc.py", line 68, in serialize_properties 
        result = await serialize_property(v, deps, input_transformer)
      File "C:\Users\.virtualenvs\poc_kfserving-ag4xjMhI\lib\site-packages\pulumi\runtime\rpc.py", line 173, in serialize_property  
        value = await serialize_property(output.future(), deps, input_transformer)
      File "C:\Users\.virtualenvs\poc_kfserving-ag4xjMhI\lib\site-packages\pulumi\runtime\rpc.py", line 159, in serialize_property  
        future_return = await asyncio.ensure_future(awaitable)
      File "C:\Users\.virtualenvs\poc_kfserving-ag4xjMhI\lib\site-packages\pulumi\output.py", line 114, in get_value
        val = await self._future
      File "C:\Users\.virtualenvs\poc_kfserving-ag4xjMhI\lib\site-packages\pulumi\output.py", line 155, in run
        value = await self._future
      File "C:\Users\.virtualenvs\poc_kfserving-ag4xjMhI\lib\site-packages\pulumi\output.py", line 340, in gather_futures
        return await asyncio.gather(*value_futures)
      File "C:\Users\.virtualenvs\poc_kfserving-ag4xjMhI\lib\site-packages\pulumi\output.py", line 114, in get_value
        val = await self._future
      File "C:\Users\.virtualenvs\poc_kfserving-ag4xjMhI\lib\site-packages\pulumi\output.py", line 155, in run
        value = await self._future
      File "C:\Users\.virtualenvs\poc_kfserving-ag4xjMhI\lib\site-packages\pulumi\output.py", line 176, in run
        transformed: Input[U] = func(value)
      File "C:\Users\.virtualenvs\poc_kfserving-ag4xjMhI\lib\site-packages\pulumi_kubernetes\yaml.py", line 260, in <lambda>        
        CustomResourceDefinition(f"{x}", opts, **obj)))]
    TypeError: __init__() got an unexpected keyword argument 'status'
    error: an unhandled error occurred: Program exited with non-zero exit code: 1

Affected product version(s)

  • Pulumi Version - v2.7.1
  • Python 3.8.2

requirements.txt

pulumi>=2.0.0,<3.0.0
pulumi-kubernetes>=2.0.0,<3.0.0
@banerjeeip
Copy link

try ./ before the file name if the file name is in the same folder as main.py. In my case, I have a sub-folder named 'yaml' and here is how I've gotten it to work:

grafana_config=ConfigFile('grafana-config', './yaml/grafana-ingress.yaml')

@lblackstone
Copy link
Member

lblackstone commented Jul 31, 2020

Just to make sure this isn't a problem with the arguments to ConfigFile, can you try

kfserving = pulumi_kubernetes.ConfigFile(
    "kfserving",
    file_id="kfserving.yaml",
)

Example usage is documented here


Edit: Actually, it looks like it's a problem with the manifest. The CRD shouldn't include the status field as an input (it's an output field).

@lblackstone
Copy link
Member

I'm going to close this issue since it appears to be a problem with the manifest, and the SDK is correctly flagging the input as a TypeError.

Alternatively, we could make the provider ignore the status field to better match the behavior of kubectl, but I think that might be surprising to users who thought they were setting the status.

cc @lukehoban

@lblackstone lblackstone added this to the current milestone Jul 31, 2020
@kmr0877
Copy link
Author

kmr0877 commented Aug 3, 2020

@lblackstone Seem like it is. Appreciate your response. Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants