@@ -143,9 +143,8 @@ oci_image_index = rule(
143
143
def _oci_image_impl (ctx ):
144
144
toolchain = ctx .toolchains ["@com_github_datadog_rules_oci//oci:toolchain" ]
145
145
146
- layout = ctx .attr .base [OCILayout ]
147
-
148
146
base_desc = get_descriptor_file (ctx , ctx .attr .base [OCIDescriptor ])
147
+ base_layout = ctx .attr .base [OCILayout ]
149
148
150
149
manifest_desc_file = ctx .actions .declare_file ("{}.manifest.descriptor.json" .format (ctx .label .name ))
151
150
manifest_file = ctx .actions .declare_file ("{}.manifest.json" .format (ctx .label .name ))
@@ -177,7 +176,7 @@ def _oci_image_impl(ctx):
177
176
ctx .actions .run (
178
177
executable = toolchain .sdk .ocitool ,
179
178
arguments = [
180
- "--layout={}" .format (layout .blob_index .path ),
179
+ "--layout={}" .format (base_layout .blob_index .path ),
181
180
"append-layers" ,
182
181
"--bazel-version-file={}" .format (ctx .version_file .path ),
183
182
"--base={}" .format (base_desc .path ),
@@ -196,10 +195,14 @@ def _oci_image_impl(ctx):
196
195
["--annotations={}={}" .format (k , v ) for k , v in annotations .items ()] +
197
196
["--labels={}={}" .format (k , v ) for k , v in labels .items ()] +
198
197
["--env={}" .format (env ) for env in ctx .attr .env ],
199
- inputs = [ctx .version_file , base_desc , layout .blob_index , entrypoint_config_file ] +
200
- ctx .files .layers +
198
+ inputs = [
199
+ ctx .version_file ,
200
+ base_desc ,
201
+ base_layout .blob_index ,
202
+ entrypoint_config_file ,
203
+ ] + ctx .files .layers +
201
204
layer_descriptor_files +
202
- layout .files .to_list (),
205
+ base_layout .files .to_list (),
203
206
outputs = [
204
207
manifest_file ,
205
208
config_file ,
@@ -214,7 +217,10 @@ def _oci_image_impl(ctx):
214
217
),
215
218
OCILayout (
216
219
blob_index = layout_file ,
217
- files = depset (ctx .files .layers + [manifest_file , config_file , layout_file ]),
220
+ files = depset (
221
+ ctx .files .layers + [manifest_file , config_file , layout_file ],
222
+ transitive = [base_layout .files ],
223
+ ),
218
224
),
219
225
DefaultInfo (
220
226
files = depset ([
0 commit comments