Skip to content

Can't give a 'user' argument to the container_image implementation #2081

Description

🐞 bug report

Affected Rule

The only rule affected is the implementation function of the rule container_image, the function _impl / image.implementation in the file container/image.bzl.

Is this a regression?

No.

Description

The user argument can be given to the rule container_image but we can't give it to the implementation function.

🔬 Minimal Reproduction

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

def _my_container_image_impl(ctx):
    return _container.image.implementation(ctx, user = "myuser")

my_container_image = rule(
    implementation = _my_container_image_impl,
    attrs = _container.image.attrs,
    outputs = _container.image.outputs,
    cfg = _container.image.cfg,
    toolchains = [
        "@io_bazel_rules_docker//toolchains/docker:toolchain_type",
    ],
)

🔥 Exception or Error

...
Error: _impl() got unexpected keyword argument: user

🌍 Your Environment

Operating System:

linux/amd64

Output of bazel version:

4.2.2 / 5.0.0 / 5.1.1

rules_docker version:

v0.23.0 / v0.24.0 / master (0768e1b7f6aa973f9879ac5b8f622dd2f3d88f1d)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions