08/26/2020, 10:04 PM
I'm trying to reproduced the script from here (in typescript) in python to create a digitalocean container registry credential
in python. My code look like that
container_registry = ContainerRegistry.get("source", "hyperwave-research")
        registry_creds = pulumi.Output.secret( ContainerRegistryDockerCredentials(

        def encode_base64_dc(dc):
            message_bytes = dc.encode('ascii')
            base64_bytes = base64.b64encode(message_bytes)
            print(f"===> Docker  : {dc}")
            print(f"===> Docker Credential : {base64_bytes.decode('utf-8')}")
            return base64_bytes.decode("utf-8")

        dc = registry_creds.apply(encode_base64_dc)

        self.secret = Secret(
            metadata={"namespace": "default", "name": f"registry-{do_registry_name}"},
            string_data={".dockerconfigjson": dc},
However whatever I tried, the docker.credential is everytime None. I tried other property of the
and I can confirm I have value like registry_name
      File "/home/dzucker/git/Hyperwave.Infrastructure/venv/lib/python3.8/site-packages/pulumi/runtime/", 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/", 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/", 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/", line 112, in get_value
        val = await self._future
      File "/home/dzucker/git/Hyperwave.Infrastructure/venv/lib/python3.8/site-packages/pulumi/", line 174, in run
        transformed: Input[U] = func(value)
      File "./digitalocean/", 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 tried other idea that I found from the slack;cid=C84L4E3N1 however same result. Am I doing something ? or could it be they are a mapping error on the python property naming.