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 get an error, Output' object is not callable, if Image's registry argument contains outputs:
error: Traceback (most recent call last):
File "/usr/local/bin/pulumi-language-python-exec", line 85, in <module>
loop.run_until_complete(coro)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "/Users/joeduffy/temp/docker-build/docker/py/venv/lib/python3.7/site-packages/pulumi/runtime/stack.py", line 81, in run_in_stack
await run_pulumi_func(lambda: Stack(func))
File "/Users/joeduffy/temp/docker-build/docker/py/venv/lib/python3.7/site-packages/pulumi/runtime/stack.py", line 50, in run_pulumi_func
await RPC_MANAGER.rpcs.pop()
File "/Users/joeduffy/temp/docker-build/docker/py/venv/lib/python3.7/site-packages/pulumi/runtime/rpc_manager.py", line 67, in rpc_wrapper
result = await rpc
File "/Users/joeduffy/temp/docker-build/docker/py/venv/lib/python3.7/site-packages/pulumi/runtime/resource.py", line 440, in do_register_resource_outputs
serialized_props = await rpc.serialize_properties(outputs, {})
File "/Users/joeduffy/temp/docker-build/docker/py/venv/lib/python3.7/site-packages/pulumi/runtime/rpc.py", line 68, in serialize_properties
result = await serialize_property(v, deps, input_transformer)
File "/Users/joeduffy/temp/docker-build/docker/py/venv/lib/python3.7/site-packages/pulumi/runtime/rpc.py", line 173, in serialize_property
value = await serialize_property(output.future(), deps, input_transformer)
File "/Users/joeduffy/temp/docker-build/docker/py/venv/lib/python3.7/site-packages/pulumi/runtime/rpc.py", line 159, in serialize_property
future_return = await asyncio.ensure_future(awaitable)
File "/Users/joeduffy/temp/docker-build/docker/py/venv/lib/python3.7/site-packages/pulumi/output.py", line 114, in get_value
val = await self._future
File "/Users/joeduffy/temp/docker-build/docker/py/venv/lib/python3.7/site-packages/pulumi/output.py", line 155, in run
value = await self._future
File "/Users/joeduffy/temp/docker-build/docker/py/venv/lib/python3.7/site-packages/pulumi/output.py", line 155, in run
value = await self._future
File "/Users/joeduffy/temp/docker-build/docker/py/venv/lib/python3.7/site-packages/pulumi/output.py", line 155, in run
value = await self._future
File "/Users/joeduffy/temp/docker-build/docker/py/venv/lib/python3.7/site-packages/pulumi/output.py", line 176, in run
transformed: Input[U] = func(value)
File "/Users/joeduffy/temp/docker-build/docker/py/venv/lib/python3.7/site-packages/pulumi_docker/image.py", line 234, in <lambda>
lambda args: get_image_data(_ImageArgs(*args))
File "/Users/joeduffy/temp/docker-build/docker/py/venv/lib/python3.7/site-packages/pulumi_docker/image.py", line 225, in get_image_data
image_args.skip_push,
File "/Users/joeduffy/temp/docker-build/docker/py/venv/lib/python3.7/site-packages/pulumi_docker/docker.py", line 228, in build_and_push_image
login_to_registry(registry, log_resource)
File "/Users/joeduffy/temp/docker-build/docker/py/venv/lib/python3.7/site-packages/pulumi_docker/docker.py", line 513, in login_to_registry
log_resource, report_full_command_line=False, stdin=password)
File "/Users/joeduffy/temp/docker-build/docker/py/venv/lib/python3.7/site-packages/pulumi_docker/docker.py", line 585, in run_command_that_must_succeed
cmd, args, log_resource, report_full_command_line, False, stdin, env)
File "/Users/joeduffy/temp/docker-build/docker/py/venv/lib/python3.7/site-packages/pulumi_docker/docker.py", line 651, in run_command_that_can_fail
outs, errs = process.communicate(input=stdin)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/subprocess.py", line 939, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1663, in _communicate
self._save_input(input)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1739, in _save_input
self.stdin.errors)
TypeError: 'Output' object is not callable
error: an unhandled error occurred: Program exited with non-zero exit code: 1
It appears we handle the case when the entire registry itself is an Output, but not the individual properties on that object. They are typed as Input[str], so I expected that to work.
For example, this code fails:
importpulumiimportpulumi_dockerasdocker# Fetch the Docker Hub auth info from config.config=pulumi.Config()
username=config.require('dockerUsername')
password=config.require_secret('dockerPassword')
# Build and publish the image.image=docker.Image('my-image',
build='app',
image_name=f'{username}/myapp',
registry=docker.ImageRegistry(
server='docker.io',
username=username,
password=password,
),
)
# Export the resulting base name in addition to the specific version pushed.pulumi.export('imageName', image.image_name)
whereas this code works just fine:
importpulumiimportpulumi_dockerasdocker# Fetch the Docker Hub auth info from config.config=pulumi.Config()
username=config.require('dockerUsername')
password=config.require_secret('dockerPassword')
defget_registry(pwd):
returndocker.ImageRegistry(
server='docker.io',
username=username,
password=pwd,
)
# Build and publish the image.image=docker.Image('my-image',
build='app',
image_name=f'{username}/myapp',
registry=password.apply(lambdapwd: get_registry(pwd))
)
# Export the resulting base name in addition to the specific version pushed.pulumi.export('imageName', image.image_name)
The text was updated successfully, but these errors were encountered:
doesn't actually unpack the inner properties on, for instance, the registry object. We ran into this recently and I think it's (unfortunately) by design -- meaning we probably need to manually unpack all of the inner possibly-output properties by hand.
I get an error,
Output' object is not callable
, ifImage
'sregistry
argument contains outputs:It appears we handle the case when the entire
registry
itself is anOutput
, but not the individual properties on that object. They are typed asInput[str]
, so I expected that to work.For example, this code fails:
whereas this code works just fine:
The text was updated successfully, but these errors were encountered: