forked from kubernetes/kubernetes
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Link Kubernetes against BoringCrypto, release-1.20 edition
This commit includes support both for the dockerized make build flow as well as bazel, though bazel builds require the glibc-source package to be installed with apt. Key changes compared to upstream: * force all binaries to be dynamically linked * force fipsonly encryption on kubectl * include glibc source in kubernetes-src.tar.gz * include glibc, go stdlib, and boringSSL licenses in LICENSES This was cherry-picked from the release-1.19 branch. Original Change-Id: Ic6fdb03f3340e0b4548c2c586570ab2d35fc7ef3 - OSS changed a singular LICENSES file to a LICENSES directory tree in kubernetes#90575 This commit: * restores OSS changes in build/lib/release.sh and build/root/BUILD.root * rewrites the boringcrypto build additions to copy licenses into LICENSES/host/... subdirs This commit should be squashed into the BoringCrypto commit. Original Change-Id: I1346440f0be318e40bcdae74afe1b7dbc87f51ef - Rebase core images on an internal go-runner which contains glibc. GKE's boringcrypto-patched binaries require glibc at runtime. bug=167220504 bug=170986849 Original Change-Id: I1dbc0ca45379e80b746a1a334a214087408f716f Change-Id: I56c4148b1a0e665ce5c86a945bb35a98bd5ea581
- Loading branch information
Showing
24 changed files
with
290 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v1.15.8-legacy-1 | ||
v1.15.8b5-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2017 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Tars up host source dependences into the _output directory, and licenses into a _output/src/LICENSES/host directory. | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. | ||
source "${KUBE_ROOT}/build/common.sh" | ||
|
||
mkdir -p "${KUBE_OUTPUT}/src" | ||
rm -f "${KUBE_OUTPUT}/src/*.tar" | ||
tar cf "${KUBE_OUTPUT}/src/glibc.tar" -C /usr/src glibc | ||
|
||
HOST_LICENSES_DIR="${KUBE_OUTPUT}/src/LICENSES/host" | ||
rm -fr "${HOST_LICENSES_DIR}" | ||
|
||
format_license() { | ||
local -r host_licenses_dir=$1 | ||
local -r dep=$2 | ||
local -r src_license=$3 | ||
local dep_license_dir="${host_licenses_dir}/${dep}" | ||
mkdir -p "${dep_license_dir}" | ||
( | ||
echo | ||
echo "= ${dep} licensed under: =" | ||
echo | ||
cat "${src_license}" | ||
echo | ||
) >"${dep_license_dir}/LICENSE" | ||
} | ||
|
||
# If you change this list, also be sure to change build/licenses.bzl. | ||
format_license "${HOST_LICENSES_DIR}" "glibc" /usr/src/glibc/debian/copyright | ||
format_license "${HOST_LICENSES_DIR}" "go" /usr/local/go/LICENSE | ||
format_license "${HOST_LICENSES_DIR}" "goboring" /usr/local/go/src/crypto/internal/boring/LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Copyright 2018 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This is a rough transliteration of build/copy-host-source.sh, using the | ||
# Bazel workspace dependencies instead of the _output directory. | ||
|
||
_separator = "================================================================================" | ||
|
||
def _format_license(host_licenses_dir, pkg_name, read_cmd): | ||
dep_license_dir = "%s/%s" % (host_licenses_dir, pkg_name) | ||
dep_license_file = "%s/LICENSE" % (dep_license_dir) | ||
return ";".join([ | ||
"mkdir -p %s" % (dep_license_dir), | ||
"echo -e '= %s licensed under: =\n' >> %s" % (pkg_name, dep_license_file), | ||
"%s > %s" % (read_cmd, dep_license_file), | ||
]) | ||
|
||
# Creates a file named HOST_LICENSES.tar containing a LICENSES/host/... directory structure | ||
# containing licenses of glibc, and the Go std library and BoringCrypto / BoringSSL. | ||
def gen_licenses(**kwargs): | ||
srcs = [ | ||
"@glibc_src//:debian-copyright", | ||
"@go_src//file", | ||
] | ||
|
||
# If you change this list, also be sure to change build/copy-host-source.sh. | ||
cmds = [ | ||
_format_license("LICENSES/host", "glibc", "cat $(location @glibc_src//:debian-copyright)"), | ||
_format_license("LICENSES/host", "go", "tar -Oxf $(location @go_src//file) go/LICENSE"), | ||
_format_license("LICENSES/host", "goboring", "tar -Oxf $(location @go_src//file) go/src/crypto/internal/boring/LICENSE"), | ||
"tar -cf $@ --owner=0 --group=0 --numeric-owner LICENSES", | ||
] | ||
|
||
native.genrule( | ||
name = "gen_licenses", | ||
srcs = srcs, | ||
outs = ["HOST_LICENSES.tar"], | ||
cmd = ";".join(cmds), | ||
**kwargs | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.