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
{{ message }}
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.
The only rule affected is the container_image rule, and more specifically its implementation function _impl().
Is this a regression?
No.
Description
Depending if the base argument is directly given to the implementation function, or if this argument is given through the attribute of the rule ctx.attr.base, the process of this argument is different.
This difference of behaviour is introduced in the get_from_target() function in the file container/layer_tools.bzl.
def get_from_target(ctx, name, attr_target, file_target = None):
"""Gets all layers from the given target.
Args:
ctx: The context
name: The name of the target
attr_target: The attribute to get layers from
file_target: If not None, layers are extracted from this target
Returns:
The extracted layers
"""
if file_target:
return _extract_layers(ctx, name, file_target)
elif attr_target and ImageInfo in attr_target:
return attr_target[ImageInfo].container_parts
elif attr_target and ImportInfo in attr_target:
return attr_target[ImportInfo].container_parts
else:
if not hasattr(attr_target, "files"):
return {}
target = attr_target.files.to_list()[0]
return _extract_layers(ctx, name, target)
Where we give the value of ctx.attr.base to attr_target, and the value of the base argument to file_target.
On the one hand we call _extract_layers() with an argument of type File, and on the other hand we call directly this function with an argument of type Target.
…its implementation function (#2083) (#2084)
Really override the ctx.attr.base attribute with the 'base' argument of
the implementattion function of the `container_image` rule.
…its implementation function (bazelbuild#2083) (bazelbuild#2084)
Really override the ctx.attr.base attribute with the 'base' argument of
the implementattion function of the `container_image` rule.
This issue was closed.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
🐞 bug report
Affected Rule
The only rule affected is the
container_image
rule, and more specifically its implementation function_impl()
.Is this a regression?
No.
Description
Depending if the
base
argument is directly given to the implementation function, or if this argument is given through the attribute of the rulectx.attr.base
, the process of this argument is different.This difference of behaviour is introduced in the
get_from_target()
function in the file container/layer_tools.bzl.Where we give the value of
ctx.attr.base
to attr_target, and the value of thebase
argument to file_target.On the one hand we call
_extract_layers()
with an argument of type File, and on the other hand we call directly this function with an argument of type Target.🔬 Minimal Reproduction
🔥 Exception or Error
🌍 Your Environment
Operating System:
Output of
bazel version
:Rules_docker version:
The text was updated successfully, but these errors were encountered: