Skip to content

Commit

Permalink
Merge pull request #43 from infosiftr/defense-in-depth
Browse files Browse the repository at this point in the history
Add more "defense in depth" to collecting manifests for deploy
  • Loading branch information
yosifkit authored May 6, 2024
2 parents c8b6c1a + 3dcc133 commit 468ffc5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion deploy.jq
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ def tagged_manifests(builds_selector; tags_extractor):
$i
| tags_extractor
| ..|strings # no matter what "tags_extractor" gives us, this will flatten us to a stream of strings
] += $i.build.resolved.manifests
] += [
# as an extra protection against cross-architecture "bleeding" ("riscv64" infra pushing "amd64" images, for example), filter the list of manifests to those whose architecture matches the architecture it is supposed to be for
# to be explicitly clear, this filtering is *also* done as part of our "builds.json" generation, so this is an added layer of best-effort protection that will be especially important to preserve and/or replicate if/when we solve the "not built yet so include the previous contents of the tag" portion of the problem at this layer instead of in the currently-separate put-shared process
$i.build.resolved.manifests[]
| select(.annotations["com.docker.official-images.bashbrew.arch"] // "" == $i.build.arch) # this assumes "registry.SynthesizeIndex" created this list of manifests (because it sets this annotation), but it would be reasonable for us to reimplement that conversion of "OCI platform object" to "bashbrew architecture" in pure jq if it was prudent or necessary to do so
]
)
;
def arch_tagged_manifests($arch):
Expand Down

0 comments on commit 468ffc5

Please sign in to comment.