Skip to content

Commit

Permalink
Merge pull request #1496 from ConnorJC3/update-speculative-execution
Browse files Browse the repository at this point in the history
Update speculative execution of docker buildx to check buildkit daemon type
  • Loading branch information
k8s-ci-robot committed Jan 25, 2023
2 parents e82d3e2 + 668ff48 commit b926e1e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hack/provenance
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@
# in installations of buildx that do not correctly report their version
# via `docker buildx version`.
#
# Additionally, if the local buildkit worker is the Docker daemon,
# attestation should not be supported and must be disabled.
#
# Thus, this script echos back the flag `--provenance=false` if and only
# if the local buildx installation supports it. If not, it exits silently.

BUILDX_TEST=`docker buildx build --provenance=false 2>&1`
if [[ "${BUILDX_TEST}" == *"See 'docker buildx build --help'."* ]]; then
if [[ "${BUILDX_TEST}" == *"requires exactly 1 argument"* ]]; then
if [[ "${BUILDX_TEST}" == *"requires exactly 1 argument"* ]] && ! docker buildx inspect | grep -qE "^Driver:\s*docker$"; then
echo "--provenance=false"
fi
else
Expand Down

0 comments on commit b926e1e

Please sign in to comment.