You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to reproduced the script from here (in typescript) in python to create a digitalocean container registry credential ContainerRegistryDockerCredentials in python. pulumi/pulumi-kubernetesx#49 (comment) code look like that
However whatever I tried, the docker.credential is everytime None. I tried other property of the ContainerRegistryDockerCredentials and I can confirm I have value like registry_name
File "/home/dzucker/git/Hyperwave.Infrastructure/venv/lib/python3.8/site-packages/pulumi/runtime/rpc.py", line 192, in serialize_property
obj[transformed_key] = await serialize_property(v, deps, input_transformer)
File "/home/dzucker/git/Hyperwave.Infrastructure/venv/lib/python3.8/site-packages/pulumi/runtime/rpc.py", line 173, in serialize_property
value = await serialize_property(output.future(), deps, input_transformer)
File "/home/dzucker/git/Hyperwave.Infrastructure/venv/lib/python3.8/site-packages/pulumi/runtime/rpc.py", line 159, in serialize_property
future_return = await asyncio.ensure_future(awaitable)
File "/home/dzucker/git/Hyperwave.Infrastructure/venv/lib/python3.8/site-packages/pulumi/output.py", line 112, in get_value
val = await self._future
File "/home/dzucker/git/Hyperwave.Infrastructure/venv/lib/python3.8/site-packages/pulumi/output.py", line 174, in run
transformed: Input[U] = func(value)
File "./digitalocean/docker_registry.py", line 42, in print_dc
message_bytes = dc.encode('ascii')
AttributeError: 'NoneType' object has no attribute 'encode'
error: an unhandled error occurred: Program exited with non-zero exit code: 1
I think I have been able to reproduce the bug with the below unit test. which is failing with the error
FAILED [100%]
venv/lib/python3.8/site-packages/pulumi/runtime/mocks.py:35 (test_can_create_kubernetes)
None != This is my credential
Expected :This is my credential
Actual :None
from datetime import datetime
import pulumi
from pulumi_digitalocean import ContainerRegistryDockerCredentials
class MyMocks(pulumi.runtime.Mocks):
def new_resource(self, type_, name, inputs, provider, id_):
if type == 'digitalocean:index/containerRegistryDockerCredentials:ContainerRegistryDockerCredentials':
return [
name,
{
"registryName": inputs["registryName"],
"dockerCredentials": "This is my credential"
},
]
return [name + "_id", inputs]
def call(self, token, args, provider):
return {}
pulumi.runtime.set_mocks(MyMocks())
@pulumi.runtime.test
def test_registry_name_set():
registyr_name = "my-registry"
kb = ContainerRegistryDockerCredentials("tet", registry_name=registyr_name )
def check_project_name(args):
assert args == registyr_name
return kb.registry_name.apply(check_project_name)
@pulumi.runtime.test
def test_contain_docker_credential():
registyr_name = "my-registry"
kb = ContainerRegistryDockerCredentials("tet", registry_name=registyr_name )
def check_project_name(args):
assert args == "This is my credential"
return kb.docker_credentials.apply(check_project_name)
The text was updated successfully, but these errors were encountered:
Thank you @leezen for your reply.
I will check my test again :-)
thank you for the link, Indeed, adding a time on the input solved the problem. I'm able now to publish the token to my kubernetes cluster.
I'm trying to reproduced the script from here (in typescript) in python to create a digitalocean container registry credential ContainerRegistryDockerCredentials in python.
pulumi/pulumi-kubernetesx#49 (comment) code look like that
However whatever I tried, the docker.credential is everytime None. I tried other property of the ContainerRegistryDockerCredentials and I can confirm I have value like registry_name
I tried other idea that I found from the slack https://pulumi-community.slack.com/archives/C84L4E3N1/p1596457104392200?thread_ts=1596452646.389800&cid=C84L4E3N1 however same result.
Am I doing something ? or could it be they are a mapping error on the python property naming. (edited)
I think I have been able to reproduce the bug with the below unit test. which is failing with the error
The text was updated successfully, but these errors were encountered: