Skip to content

Commit

Permalink
chore: remove select() from the examples
Browse files Browse the repository at this point in the history
This is a separate diff so that we can test the previous diff with the
changes plus the examples with `select` in place and make sure
everything works as-is with the new package aliases.
  • Loading branch information
jjmaestro committed Nov 14, 2024
1 parent 1fc2c95 commit e77e966
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 98 deletions.
27 changes: 3 additions & 24 deletions e2e/smoke/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ tar(

cacerts(
name = "cacerts",
package = select({
"@platforms//cpu:arm64": "@bullseye//ca-certificates/arm64:data",
"@platforms//cpu:x86_64": "@bullseye//ca-certificates/amd64:data",
}),
package = "@bullseye//ca-certificates:data",
)

PACKAGES = [
Expand All @@ -69,16 +66,7 @@ PACKAGES = [
# Creates /var/lib/dpkg/status with installed package information.
dpkg_status(
name = "dpkg_status",
controls = select({
"@platforms//cpu:arm64": [
"%s/arm64:control" % package
for package in PACKAGES
],
"@platforms//cpu:x86_64": [
"%s/amd64:control" % package
for package in PACKAGES
],
}),
controls = ["%s:control" % p for p in PACKAGES],
)

oci_image(
Expand All @@ -94,16 +82,7 @@ oci_image(
":group",
":dpkg_status",
":cacerts",
] + select({
"@platforms//cpu:arm64": [
"%s/arm64" % package
for package in PACKAGES
],
"@platforms//cpu:x86_64": [
"%s/amd64" % package
for package in PACKAGES
],
}),
] + PACKAGES,
)

oci_load(
Expand Down
14 changes: 4 additions & 10 deletions examples/debian_flat_repo/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ dpkg_status(
name = "dpkg_status",
controls = select({
"@platforms//cpu:x86_64": [
"%s/amd64:control" % package
"%s:control" % package
for package in PACKAGES_AMD64
],
"@platforms//cpu:arm64": [
"%s/arm64:control" % package
"%s:control" % package
for package in PACKAGES_ARM64
],
}),
Expand All @@ -41,14 +41,8 @@ oci_image(
tars = [
":dpkg_status",
] + select({
"@platforms//cpu:x86_64": [
"%s/amd64" % package
for package in PACKAGES_AMD64
],
"@platforms//cpu:arm64": [
"%s/arm64" % package
for package in PACKAGES_ARM64
],
"@platforms//cpu:x86_64": PACKAGES_AMD64,
"@platforms//cpu:arm64": PACKAGES_ARM64,
}),
)

Expand Down
22 changes: 2 additions & 20 deletions examples/debian_shared_dependencies/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,7 @@ PACKAGES = [
# Creates /var/lib/dpkg/status with installed package information.
dpkg_status(
name = "dpkg_status",
controls = select({
"@platforms//cpu:arm64": [
"%s/arm64:control" % package
for package in PACKAGES
],
"@platforms//cpu:x86_64": [
"%s/amd64:control" % package
for package in PACKAGES
],
}),
controls = ["%s:control" % p for p in PACKAGES],
)

oci_image(
Expand All @@ -80,16 +71,7 @@ oci_image(
":passwd",
":group",
":dpkg_status",
] + select({
"@platforms//cpu:arm64": [
"%s/arm64" % package
for package in PACKAGES
],
"@platforms//cpu:x86_64": [
"%s/amd64" % package
for package in PACKAGES
],
}),
] + PACKAGES,
)

oci_load(
Expand Down
27 changes: 3 additions & 24 deletions examples/debian_snapshot/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ tar(

cacerts(
name = "cacerts",
package = select({
"@platforms//cpu:arm64": "@bullseye//ca-certificates/arm64:data",
"@platforms//cpu:x86_64": "@bullseye//ca-certificates/amd64:data",
}),
package = "@bullseye//ca-certificates:data",
)

PACKAGES = [
Expand All @@ -70,16 +67,7 @@ PACKAGES = [
# Creates /var/lib/dpkg/status with installed package information.
dpkg_status(
name = "dpkg_status",
controls = select({
"@platforms//cpu:arm64": [
"%s/arm64:control" % package
for package in PACKAGES
],
"@platforms//cpu:x86_64": [
"%s/amd64:control" % package
for package in PACKAGES
],
}),
controls = ["%s:control" % p for p in PACKAGES],
)

oci_image(
Expand All @@ -99,16 +87,7 @@ oci_image(
":group",
":dpkg_status",
":cacerts",
] + select({
"@platforms//cpu:arm64": [
"%s/arm64" % package
for package in PACKAGES
],
"@platforms//cpu:x86_64": [
"%s/amd64" % package
for package in PACKAGES
],
}),
] + PACKAGES,
)

oci_load(
Expand Down
22 changes: 2 additions & 20 deletions examples/ubuntu_snapshot/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,7 @@ PACKAGES = [
# Creates /var/lib/dpkg/status with installed package information.
dpkg_status(
name = "dpkg_status",
controls = select({
"@platforms//cpu:arm64": [
"%s/arm64:control" % package
for package in PACKAGES
],
"@platforms//cpu:x86_64": [
"%s/amd64:control" % package
for package in PACKAGES
],
}),
controls = ["%s:control" % p for p in PACKAGES],
)

oci_image(
Expand All @@ -84,16 +75,7 @@ oci_image(
":passwd",
":group",
":dpkg_status",
] + select({
"@platforms//cpu:arm64": [
"%s/arm64" % package
for package in PACKAGES
],
"@platforms//cpu:x86_64": [
"%s/amd64" % package
for package in PACKAGES
],
}),
] + PACKAGES,
)

oci_load(
Expand Down

0 comments on commit e77e966

Please sign in to comment.