@@ -103,7 +103,17 @@ def get_floating_tag(rel, tags):
103103 return found
104104
105105
106- # Append the coreos-assembler build json `input_` to `out`, the target release stream.
106+ def populate_oci_image (buildid , oci ):
107+ # The `image` field uses a floating tag and the `digest-ref` field uses
108+ # a digest pullspec. See: https://github.com/coreos/stream-metadata-go/pull/46.
109+ tag = get_floating_tag (buildid , oci ["tags" ])
110+ return {
111+ "image" : oci ["image" ] + f":{ tag } " ,
112+ "digest-ref" : oci ["image" ] + "@" + oci ["digest" ],
113+ }
114+
115+
116+ # Append the coreos-assembler build meta.json `input_` to `out`, the target release stream.
107117def append_build (out , input_ ):
108118 arch = input_ .get ("coreos-assembler.basearch" )
109119
@@ -182,13 +192,7 @@ def append_build(out, input_):
182192 # KubeVirt specific additions: https://github.com/coreos/stream-metadata-go/pull/41
183193 if input_ .get ("kubevirt" , None ) is not None :
184194 arch_dict ["media" ].setdefault ("kubevirt" , {}).setdefault ("image" , {})
185- # The `image` field uses a floating tag and the `digest-ref` field uses
186- # a digest pullspec. See: https://github.com/coreos/stream-metadata-go/pull/46.
187- tag = get_floating_tag (input_ ["buildid" ], input_ ["kubevirt" ]["tags" ])
188- arch_dict ["media" ]["kubevirt" ]["image" ] = {
189- "image" : input_ ["kubevirt" ]["image" ] + f":{ tag } " ,
190- "digest-ref" : input_ ["kubevirt" ]["image" ] + "@" + input_ ["kubevirt" ]["digest" ],
191- }
195+ arch_dict ["media" ]["kubevirt" ]["image" ] = populate_oci_image (input_ ["buildid" ], input_ ["kubevirt" ])
192196
193197 # Azure: https://github.com/coreos/stream-metadata-go/issues/13
194198 inputaz = input_ .get ("azure" )
0 commit comments