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

0.23.0 container_bundle crashes when called with empty images list #2010

Closed
hanikesn opened this issue Feb 1, 2022 · 0 comments · Fixed by #2067
Closed

0.23.0 container_bundle crashes when called with empty images list #2010

hanikesn opened this issue Feb 1, 2022 · 0 comments · Fixed by #2067

Comments

@hanikesn
Copy link

hanikesn commented Feb 1, 2022

🐞 bug report

Affected Rule

The issue is caused by the rule: `incremental_load`

Is this a regression?

Yes, the previous version in which this bug was not present was: ....

Introduced via #1957, confirmed working 0.22

Description

Using `container_bundle` with an empty `images = {}` causes an error

🔬 Minimal Reproduction

load("@io_bazel_rules_docker//container:container.bzl", "container_bundle")

container_bundle(
    name = "bundle_to_push",
    images = {}
    tags = ["no-remote-cache"],
)

🔥 Exception or Error


Traceback (most recent call last):
        File "/home/hanikel/.cache/bazel/186c259db594aa2669550cf1f9e672c6/external/io_bazel_rules_docker/container/bundle.bzl", line 67, column 15, in _container_bundle_impl
                _incr_load(
        File "/home/hanikel/.cache/bazel/186c259db594aa2669550cf1f9e672c6/external/io_bazel_rules_docker/container/layer_tools.bzl", line 232, column 28, in incremental_load
                run_tag = images.keys()[0]
Error: index out of range (index is 0, but sequence has 0 elements)
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

Successfully merging a pull request may close this issue.

1 participant