mirror of https://github.com/knative/caching.git
upgrade to latest dependencies (#719)
bumping knative.dev/hack 549c360...d71d569:
> d71d569 🐛 Location-agnostic sign release (# 268)
> b674d64 Update community files (# 270)
bumping knative.dev/pkg decc1cc...fb44e94:
> fb44e94 Update community files (# 2676)
Signed-off-by: Knative Automation <automation@knative.team>
This commit is contained in:
parent
5b981dba4d
commit
67e93bdd80
4
go.mod
4
go.mod
|
@ -11,8 +11,8 @@ require (
|
||||||
k8s.io/client-go v0.25.4
|
k8s.io/client-go v0.25.4
|
||||||
k8s.io/code-generator v0.25.4
|
k8s.io/code-generator v0.25.4
|
||||||
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1
|
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1
|
||||||
knative.dev/hack v0.0.0-20230207150947-549c3605c670
|
knative.dev/hack v0.0.0-20230210215449-d71d569c4308
|
||||||
knative.dev/pkg v0.0.0-20230207013346-decc1cc0acad
|
knative.dev/pkg v0.0.0-20230210013552-fb44e94cccb1
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
|
8
go.sum
8
go.sum
|
@ -798,10 +798,10 @@ k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkI
|
||||||
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU=
|
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU=
|
||||||
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 h1:GfD9OzL11kvZN5iArC6oTS7RTj7oJOIfnislxYlqTj8=
|
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 h1:GfD9OzL11kvZN5iArC6oTS7RTj7oJOIfnislxYlqTj8=
|
||||||
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||||
knative.dev/hack v0.0.0-20230207150947-549c3605c670 h1:1+DsejqC6ex9vq8kS9blFqsr/FEpSTR1hRdtFAm/iEA=
|
knative.dev/hack v0.0.0-20230210215449-d71d569c4308 h1:zH5OedRfo9SB22o25VNQ+vygceTvOujsnLYaALb8jos=
|
||||||
knative.dev/hack v0.0.0-20230207150947-549c3605c670/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
|
knative.dev/hack v0.0.0-20230210215449-d71d569c4308/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
|
||||||
knative.dev/pkg v0.0.0-20230207013346-decc1cc0acad h1:jedK7bc5p5KtxJ5/qGvV3xtYuyddci/F8cynxyyOI6c=
|
knative.dev/pkg v0.0.0-20230210013552-fb44e94cccb1 h1:VUjBhCMWbugVNWkGIbgW6yfjvAuEPCN7UE1xzMeHJvE=
|
||||||
knative.dev/pkg v0.0.0-20230207013346-decc1cc0acad/go.mod h1:VO/fcEsq43seuONRQxZyftWHjpMabYzRHDtpSEQ/eoQ=
|
knative.dev/pkg v0.0.0-20230210013552-fb44e94cccb1/go.mod h1:VO/fcEsq43seuONRQxZyftWHjpMabYzRHDtpSEQ/eoQ=
|
||||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||||
|
|
|
@ -111,6 +111,7 @@ export KO_DOCKER_REPO="gcr.io/knative-nightly"
|
||||||
# Build stripped binary to reduce size
|
# Build stripped binary to reduce size
|
||||||
export GOFLAGS="-ldflags=-s -ldflags=-w"
|
export GOFLAGS="-ldflags=-s -ldflags=-w"
|
||||||
export GITHUB_TOKEN=""
|
export GITHUB_TOKEN=""
|
||||||
|
readonly IMAGES_REFS_FILE="${IMAGES_REFS_FILE:-$(mktemp -d)/images_refs.txt}"
|
||||||
|
|
||||||
# Convenience function to run the hub tool.
|
# Convenience function to run the hub tool.
|
||||||
# Parameters: $1..$n - arguments to hub.
|
# Parameters: $1..$n - arguments to hub.
|
||||||
|
@ -313,40 +314,83 @@ function build_from_source() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_images_in_yamls() {
|
function get_images_in_yamls() {
|
||||||
rm -rf imagerefs.txt
|
rm -rf "$IMAGES_REFS_FILE"
|
||||||
echo "Assembling a list of image refences to sign"
|
echo "Assembling a list of image refences to sign"
|
||||||
for file in $@; do
|
for file in "$@"; do
|
||||||
[[ "${file##*.}" != "yaml" ]] && continue
|
[[ "${file##*.}" != "yaml" ]] && continue
|
||||||
echo "Inspecting ${file}"
|
echo "Inspecting ${file}"
|
||||||
for image in $(grep -oh "\S*${KO_DOCKER_REPO}\S*" "${file}"); do
|
while read -r image; do
|
||||||
echo $image >> imagerefs.txt
|
echo "$image" >> "$IMAGES_REFS_FILE"
|
||||||
|
done < <(grep -oh "\S*${KO_DOCKER_REPO}\S*" "${file}")
|
||||||
done
|
done
|
||||||
|
if [[ -f "$IMAGES_REFS_FILE" ]]; then
|
||||||
|
sort -uo "$IMAGES_REFS_FILE" "$IMAGES_REFS_FILE" # Remove duplicate entries
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function find_checksums_file() {
|
||||||
|
for file in "$@"; do
|
||||||
|
if [[ "${file}" == *"checksums.txt" ]]; then
|
||||||
|
echo "${file}"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
sort -uo imagerefs.txt imagerefs.txt # Remove duplicate entries
|
warning "cannot find checksums file"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Build a release from source.
|
# Build a release from source.
|
||||||
function sign_release() {
|
function sign_release() {
|
||||||
get_images_in_yamls "${ARTIFACTS_TO_PUBLISH}"
|
|
||||||
if (( ! IS_PROW )); then # This function can't be run by devs on their laptops
|
if (( ! IS_PROW )); then # This function can't be run by devs on their laptops
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
get_images_in_yamls "${ARTIFACTS_TO_PUBLISH}"
|
||||||
|
local checksums_file
|
||||||
|
checksums_file="$(find_checksums_file "${ARTIFACTS_TO_PUBLISH}")"
|
||||||
|
|
||||||
|
if ! [[ -f "${checksums_file}" ]]; then
|
||||||
|
echo '>> No checksums file found, generating one'
|
||||||
|
checksums_file="$(mktemp -d)/checksums.txt"
|
||||||
|
for file in ${ARTIFACTS_TO_PUBLISH}; do
|
||||||
|
pushd "$(dirname "$file")" >/dev/null
|
||||||
|
sha256sum "$(basename "$file")" >> "${checksums_file}"
|
||||||
|
popd >/dev/null
|
||||||
|
done
|
||||||
|
ARTIFACTS_TO_PUBLISH="${ARTIFACTS_TO_PUBLISH} ${checksums_file}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Notarizing mac binaries needs to be done before cosign as it changes the checksum values
|
# Notarizing mac binaries needs to be done before cosign as it changes the checksum values
|
||||||
# of the darwin binaries
|
# of the darwin binaries
|
||||||
if [ -n "${APPLE_CODESIGN_KEY}" ] && [ -n "${APPLE_CODESIGN_PASSWORD_FILE}" ] && [ -n "${APPLE_NOTARY_API_KEY}" ]; then
|
if [ -n "${APPLE_CODESIGN_KEY}" ] && [ -n "${APPLE_CODESIGN_PASSWORD_FILE}" ] && [ -n "${APPLE_NOTARY_API_KEY}" ]; then
|
||||||
banner "Notarizing macOS Binaries for the release"
|
banner "Notarizing macOS Binaries for the release"
|
||||||
FILES=$(find -- * -type f -name "*darwin*")
|
local macos_artifacts
|
||||||
for file in $FILES; do
|
declare -a macos_artifacts=()
|
||||||
|
while read -r file; do
|
||||||
|
if echo "$file" | grep -q "darwin"; then
|
||||||
|
macos_artifacts+=("${file}")
|
||||||
rcodesign sign "${file}" --p12-file="${APPLE_CODESIGN_KEY}" \
|
rcodesign sign "${file}" --p12-file="${APPLE_CODESIGN_KEY}" \
|
||||||
--code-signature-flags=runtime \
|
--code-signature-flags=runtime \
|
||||||
--p12-password-file="${APPLE_CODESIGN_PASSWORD_FILE}"
|
--p12-password-file="${APPLE_CODESIGN_PASSWORD_FILE}"
|
||||||
|
fi
|
||||||
|
done < <(echo "${ARTIFACTS_TO_PUBLISH}" | tr ' ' '\n')
|
||||||
|
if [[ -z "${macos_artifacts[*]}" ]]; then
|
||||||
|
warning "No macOS binaries found, skipping notarization"
|
||||||
|
else
|
||||||
|
local zip_file
|
||||||
|
zip_file="$(mktemp -d)/files.zip"
|
||||||
|
zip "$zip_file" -@ < <(printf "%s\n" "${macos_artifacts[@]}")
|
||||||
|
rcodesign notary-submit "$zip_file" --api-key-path="${APPLE_NOTARY_API_KEY}" --wait
|
||||||
|
true > "${checksums_file}" # Clear the checksums file
|
||||||
|
for file in ${ARTIFACTS_TO_PUBLISH}; do
|
||||||
|
if echo "$file" | grep -q "checksums.txt"; then
|
||||||
|
continue # Don't checksum the checksums file
|
||||||
|
fi
|
||||||
|
pushd "$(dirname "$file")" >/dev/null
|
||||||
|
sha256sum "$(basename "$file")" >> "${checksums_file}"
|
||||||
|
popd >/dev/null
|
||||||
done
|
done
|
||||||
zip files.zip ${FILES}
|
|
||||||
rcodesign notary-submit files.zip --api-key-path="${APPLE_NOTARY_API_KEY}" --wait
|
|
||||||
sha256sum ${ARTIFACTS_TO_PUBLISH//checksums.txt/} > checksums.txt
|
|
||||||
echo "🧮 Post Notarization Checksum:"
|
echo "🧮 Post Notarization Checksum:"
|
||||||
cat checksums.txt
|
cat "$checksums_file"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ID_TOKEN=$(gcloud auth print-identity-token --audiences=sigstore \
|
ID_TOKEN=$(gcloud auth print-identity-token --audiences=sigstore \
|
||||||
|
@ -354,23 +398,25 @@ function sign_release() {
|
||||||
--impersonate-service-account="${SIGNING_IDENTITY}")
|
--impersonate-service-account="${SIGNING_IDENTITY}")
|
||||||
echo "Signing Images with the identity ${SIGNING_IDENTITY}"
|
echo "Signing Images with the identity ${SIGNING_IDENTITY}"
|
||||||
## Sign the images with cosign
|
## Sign the images with cosign
|
||||||
if [[ -f "imagerefs.txt" ]]; then
|
if [[ -f "$IMAGES_REFS_FILE" ]]; then
|
||||||
COSIGN_EXPERIMENTAL=1 cosign sign $(cat imagerefs.txt) --recursive --identity-token="${ID_TOKEN}"
|
COSIGN_EXPERIMENTAL=1 cosign sign $(cat "$IMAGES_REFS_FILE") \
|
||||||
|
--recursive --identity-token="${ID_TOKEN}"
|
||||||
if [ -n "${ATTEST_IMAGES:-}" ]; then # Temporary Feature Gate
|
if [ -n "${ATTEST_IMAGES:-}" ]; then # Temporary Feature Gate
|
||||||
provenance-generator --clone-log=/logs/clone.json \
|
provenance-generator --clone-log=/logs/clone.json \
|
||||||
--image-refs=imagerefs.txt --output=attestation.json
|
--image-refs="$IMAGES_REFS_FILE" --output=attestation.json
|
||||||
mkdir -p "${ARTIFACTS}"/attestation && cp attestation.json "${ARTIFACTS}"/attestation
|
mkdir -p "${ARTIFACTS}"/attestation && cp attestation.json "${ARTIFACTS}"/attestation
|
||||||
COSIGN_EXPERIMENTAL=1 cosign attest $(cat imagerefs.txt) --recursive --identity-token="${ID_TOKEN}" \
|
COSIGN_EXPERIMENTAL=1 cosign attest $(cat "$IMAGES_REFS_FILE") \
|
||||||
|
--recursive --identity-token="${ID_TOKEN}" \
|
||||||
--predicate=attestation.json --type=slsaprovenance
|
--predicate=attestation.json --type=slsaprovenance
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## Check if there is checksums.txt file. If so, sign the checksum file
|
echo "Signing checksums with the identity ${SIGNING_IDENTITY}"
|
||||||
if [[ -f "checksums.txt" ]]; then
|
COSIGN_EXPERIMENTAL=1 cosign sign-blob "$checksums_file" \
|
||||||
echo "Signing Images with the identity ${SIGNING_IDENTITY}"
|
--output-signature="${checksums_file}.sig" \
|
||||||
COSIGN_EXPERIMENTAL=1 cosign sign-blob checksums.txt --output-signature=checksums.txt.sig --output-certificate=checksums.txt.pem --identity-token="${ID_TOKEN}"
|
--output-certificate="${checksums_file}.pem" \
|
||||||
ARTIFACTS_TO_PUBLISH="${ARTIFACTS_TO_PUBLISH} checksums.txt.sig checksums.txt.pem"
|
--identity-token="${ID_TOKEN}"
|
||||||
fi
|
ARTIFACTS_TO_PUBLISH="${ARTIFACTS_TO_PUBLISH} ${checksums_file}.sig ${checksums_file}.pem"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Copy tagged images from the nightly GCR to the release GCR, tagging them 'latest'.
|
# Copy tagged images from the nightly GCR to the release GCR, tagging them 'latest'.
|
||||||
|
|
|
@ -687,10 +687,10 @@ k8s.io/utils/internal/third_party/forked/golang/net
|
||||||
k8s.io/utils/net
|
k8s.io/utils/net
|
||||||
k8s.io/utils/strings/slices
|
k8s.io/utils/strings/slices
|
||||||
k8s.io/utils/trace
|
k8s.io/utils/trace
|
||||||
# knative.dev/hack v0.0.0-20230207150947-549c3605c670
|
# knative.dev/hack v0.0.0-20230210215449-d71d569c4308
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
knative.dev/hack
|
knative.dev/hack
|
||||||
# knative.dev/pkg v0.0.0-20230207013346-decc1cc0acad
|
# knative.dev/pkg v0.0.0-20230210013552-fb44e94cccb1
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
knative.dev/pkg/apis
|
knative.dev/pkg/apis
|
||||||
knative.dev/pkg/apis/duck
|
knative.dev/pkg/apis/duck
|
||||||
|
|
Loading…
Reference in New Issue