Merge branch 'master' into minikube-blacklist

pull/8428/head
Thomas Stromberg 2020-06-09 16:49:39 -07:00
commit 09672520ea
22 changed files with 1779 additions and 31 deletions

View File

@ -32,7 +32,7 @@ RPM_VERSION ?= $(DEB_VERSION)
GO_VERSION ?= 1.13.8
INSTALL_SIZE ?= $(shell du out/minikube-windows-amd64.exe | cut -f1)
BUILDROOT_BRANCH ?= 2019.02.10
BUILDROOT_BRANCH ?= 2020.02.2
REGISTRY?=gcr.io/k8s-minikube
# Get git commit id
@ -52,7 +52,7 @@ MINIKUBE_BUCKET ?= minikube/releases
MINIKUBE_UPLOAD_LOCATION := gs://${MINIKUBE_BUCKET}
MINIKUBE_RELEASES_URL=https://github.com/kubernetes/minikube/releases/download
KERNEL_VERSION ?= 4.19.107
KERNEL_VERSION ?= 5.4.40
# latest from https://github.com/golangci/golangci-lint/releases
GOLINT_VERSION ?= v1.26.0
# Limit number of default jobs, to avoid the CI builds running out of memory
@ -205,6 +205,8 @@ minikube_iso: # old target kept for making tests happy
git clone --depth=1 --branch=$(BUILDROOT_BRANCH) https://github.com/buildroot/buildroot $(BUILD_DIR)/buildroot; \
fi;
$(MAKE) BR2_EXTERNAL=../../deploy/iso/minikube-iso minikube_defconfig -C $(BUILD_DIR)/buildroot
mkdir -p $(BUILD_DIR)/buildroot/output/build
echo "module buildroot.org/go" > $(BUILD_DIR)/buildroot/output/build/go.mod
$(MAKE) -C $(BUILD_DIR)/buildroot
mv $(BUILD_DIR)/buildroot/output/images/rootfs.iso9660 $(BUILD_DIR)/minikube.iso

1
OWNERS
View File

@ -9,6 +9,7 @@ reviewers:
- josedonizetti
- blueelvis
- priyawadhwa
- prasadkatti
approvers:
- tstromberg
- afbjorklund

View File

@ -613,6 +613,11 @@ func validateDriver(ds registry.DriverState, existing *config.ClusterConfig) {
exit.WithCodeT(exit.Unavailable, "The driver '{{.driver}}' is not supported on {{.os}}", out.V{"driver": name, "os": runtime.GOOS})
}
// if we are only downloading artifacts for a driver, we can stop validation here
if viper.GetBool("download-only") {
return
}
st := ds.State
glog.Infof("status for %s: %+v", name, st)

View File

@ -56,6 +56,7 @@ CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_X86_ACPI_CPUFREQ=y
CONFIG_PCI=y
CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI=y
CONFIG_PCCARD=y
@ -398,6 +399,7 @@ CONFIG_AGP_AMD64=y
CONFIG_AGP_INTEL=y
CONFIG_DRM=y
CONFIG_DRM_I915=y
CONFIG_DRM_VIRTIO_GPU=y
CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_TILEBLITTING=y
CONFIG_FB_EFI=y
@ -441,6 +443,7 @@ CONFIG_RTC_CLASS=y
CONFIG_DMADEVICES=y
CONFIG_VIRT_DRIVERS=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_FS=y
CONFIG_HYPERV=m
CONFIG_HYPERV_UTILS=m
CONFIG_HYPERV_BALLOON=m
@ -468,6 +471,7 @@ CONFIG_ZISOFS=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
CONFIG_PROC_KCORE=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_HUGETLBFS=y
CONFIG_NFS_FS=y

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,56 @@
# hack taken from CMakeLists.txt
# PATCH_COMMAND sed -i "s/luaL_reg/luaL_Reg/g" ${PROJECT_SOURCE_DIR}/userspace/libsinsp/chisel.cpp && sed -i "s/luaL_reg/luaL_Reg/g" ${PROJECT_SOURCE_DIR}/userspace/libsinsp/lua_parser.cpp && sed -i "s/luaL_getn/lua_objlen /g" ${PROJECT_SOURCE_DIR}/userspace/libsinsp/lua_parser_api.cpp
diff -ur sysdig-0.23.1.orig/userspace/libsinsp/chisel.cpp sysdig-0.23.1/userspace/libsinsp/chisel.cpp
--- sysdig-0.23.1.orig/userspace/libsinsp/chisel.cpp 2018-08-14 22:58:06.000000000 +0200
+++ sysdig-0.23.1/userspace/libsinsp/chisel.cpp 2020-05-17 12:33:38.871530253 +0200
@@ -96,7 +96,7 @@
// Lua callbacks
///////////////////////////////////////////////////////////////////////////////
#ifdef HAS_LUA_CHISELS
-const static struct luaL_reg ll_sysdig [] =
+const static struct luaL_Reg ll_sysdig [] =
{
{"set_filter", &lua_cbacks::set_global_filter},
{"set_snaplen", &lua_cbacks::set_snaplen},
@@ -132,7 +132,7 @@
{NULL,NULL}
};
-const static struct luaL_reg ll_chisel [] =
+const static struct luaL_Reg ll_chisel [] =
{
{"request_field", &lua_cbacks::request_field},
{"set_filter", &lua_cbacks::set_filter},
@@ -144,7 +144,7 @@
{NULL,NULL}
};
-const static struct luaL_reg ll_evt [] =
+const static struct luaL_Reg ll_evt [] =
{
{"field", &lua_cbacks::field},
{"get_num", &lua_cbacks::get_num},
diff -ur sysdig-0.23.1.orig/userspace/libsinsp/lua_parser_api.cpp sysdig-0.23.1/userspace/libsinsp/lua_parser_api.cpp
--- sysdig-0.23.1.orig/userspace/libsinsp/lua_parser_api.cpp 2018-08-14 22:58:06.000000000 +0200
+++ sysdig-0.23.1/userspace/libsinsp/lua_parser_api.cpp 2020-05-17 12:33:53.019534358 +0200
@@ -235,7 +235,7 @@
fprintf(stderr, "%s\n", err.c_str());
throw sinsp_exception("parser API error");
}
- int n = luaL_getn(ls, 3); /* get size of table */
+ int n = lua_objlen (ls, 3); /* get size of table */
for (i=1; i<=n; i++)
{
lua_rawgeti(ls, 3, i);
diff -ur sysdig-0.23.1.orig/userspace/libsinsp/lua_parser.cpp sysdig-0.23.1/userspace/libsinsp/lua_parser.cpp
--- sysdig-0.23.1.orig/userspace/libsinsp/lua_parser.cpp 2018-08-14 22:58:06.000000000 +0200
+++ sysdig-0.23.1/userspace/libsinsp/lua_parser.cpp 2020-05-17 12:33:46.343532385 +0200
@@ -14,7 +14,7 @@
#include "lauxlib.h"
}
-const static struct luaL_reg ll_filter [] =
+const static struct luaL_Reg ll_filter [] =
{
{"rel_expr", &lua_parser_cbacks::rel_expr},
{"bool_op", &lua_parser_cbacks::bool_op},

View File

@ -0,0 +1,12 @@
diff -ur libvarlink-19.orig/meson.build libvarlink-19/meson.build
--- libvarlink-19.orig/meson.build 2020-03-06 11:42:33.000000000 +0100
+++ libvarlink-19/meson.build 2020-05-17 13:27:52.972980173 +0200
@@ -96,8 +96,4 @@
'tags',
output : 'tags',
command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files)
- custom_target(
- 'ctags',
- output : 'ctags',
- command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files)
endif

View File

@ -3,9 +3,10 @@ BR2_CCACHE=y
BR2_OPTIMIZE_2=y
BR2_TOOLCHAIN_BUILDROOT_VENDOR="minikube"
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
BR2_BINUTILS_VERSION_2_30_X=y
BR2_GCC_VERSION_7_X=y
BR2_SSP_STRONG=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_4=y
BR2_BINUTILS_VERSION_2_32_X=y
BR2_GCC_VERSION_9_X=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_GCC_ENABLE_LTO=y
BR2_TARGET_GENERIC_HOSTNAME="minikube"
@ -36,22 +37,22 @@ BR2_PACKAGE_SSHFS=y
BR2_PACKAGE_XFSPROGS=y
BR2_PACKAGE_PARTED=y
BR2_PACKAGE_CA_CERTIFICATES=y
BR2_PACKAGE_CURL=y
BR2_PACKAGE_BRIDGE_UTILS=y
BR2_PACKAGE_EBTABLES=y
BR2_PACKAGE_ETHTOOL=y
BR2_PACKAGE_IPROUTE2=y
BR2_PACKAGE_IPTABLES=y
BR2_PACKAGE_PROCPS_NG=y
BR2_PACKAGE_PSMISC=y
BR2_PACKAGE_RSYNC=y
BR2_PACKAGE_SOCAT=y
BR2_PACKAGE_SUDO=y
BR2_PACKAGE_ACL=y
BR2_PACKAGE_COREUTILS=y
BR2_PACKAGE_LIBRESSL=y
BR2_PACKAGE_LIBRESSL_BIN=y
BR2_PACKAGE_LIBCURL_CURL=y
BR2_PACKAGE_LIBOPENSSL=y
BR2_PACKAGE_LIBOPENSSL_BIN=y
BR2_PACKAGE_OPENVMTOOLS=y
BR2_PACKAGE_OPENVMTOOLS_PROCPS=y
BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_SYSTEMD_MACHINED=y
BR2_PACKAGE_SYSTEMD_VCONSOLE=y

View File

@ -9,6 +9,7 @@ define AUTOMOUNT_INSTALL_INIT_SYSTEMD
$(AUTOMOUNT_PKGDIR)/minikube-automount.service \
$(TARGET_DIR)/usr/lib/systemd/system/minikube-automount.service
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
ln -fs /usr/lib/systemd/system/minikube-automount.service \
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/minikube-automount.service
endef

View File

@ -2,4 +2,4 @@ config BR2_PACKAGE_CNI_PLUGINS
bool "cni-plugins"
default y
depends on BR2_x86_64
depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS

View File

@ -2,4 +2,4 @@ config BR2_PACKAGE_CNI
bool "cni"
default y
depends on BR2_x86_64
depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS

View File

@ -1,7 +1,7 @@
config BR2_PACKAGE_CONMON
bool "conmon"
depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
depends on BR2_TOOLCHAIN_HAS_THREADS
select BR2_PACKAGE_LIBGLIB2
select BR2_PACKAGE_SYSTEMD

View File

@ -2,8 +2,8 @@ config BR2_PACKAGE_CONTAINERD_BIN
bool "containerd-bin"
default y
depends on BR2_x86_64
depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_USE_MMU # lvm2
depends on !BR2_STATIC_LIBS # lvm2

View File

@ -2,8 +2,8 @@ config BR2_PACKAGE_CRIO_BIN
bool "crio-bin"
default y
depends on BR2_x86_64
depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_USE_MMU # lvm2
depends on !BR2_STATIC_LIBS # lvm2

View File

@ -5,7 +5,7 @@
################################################################################
HYPERV_DAEMONS_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
HYPERV_DAEMONS_SITE = https://www.kernel.org/pub/linux/kernel/v4.x
HYPERV_DAEMONS_SITE = https://www.kernel.org/pub/linux/kernel/v5.x
HYPERV_DAEMONS_SOURCE = linux-$(HYPERV_DAEMONS_VERSION).tar.xz
define HYPERV_DAEMONS_BUILD_CMDS

View File

@ -2,8 +2,8 @@ config BR2_PACKAGE_PODMAN
bool "podman"
default y
depends on BR2_x86_64
depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
depends on BR2_TOOLCHAIN_HAS_THREADS
select BR2_PACKAGE_RUNC_MASTER
select BR2_PACKAGE_CONMON

View File

@ -1,7 +1,7 @@
config BR2_PACKAGE_RUNC_MASTER
bool "runc-master"
depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
depends on BR2_TOOLCHAIN_HAS_THREADS
help
runC is a CLI tool for spawning and running containers
@ -12,6 +12,6 @@ config BR2_PACKAGE_RUNC_MASTER
https://github.com/opencontainers/runc
comment "runc needs a toolchain w/ threads"
depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS && \
BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS && \
BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
depends on !BR2_TOOLCHAIN_HAS_THREADS

View File

@ -4,3 +4,6 @@ sha256 0e7ee2c78ebf7cd0d3a933d51148bef04a64f64fb27ccf70d59cddf9ca1e517a VBoxGue
# From http://download.virtualbox.org/virtualbox/5.2.32/SHA256SUMS
sha256 ff6390e50cb03718cd3f5779627910999c12279b465e340c80d7175778a33958 VirtualBox-5.2.32.tar.bz2
sha256 4311c7408a3410e6a33264a9062347d9eec04f58339a49f0a60488c0cabc8996 VBoxGuestAdditions_5.2.32.iso
# From http://download.virtualbox.org/virtualbox/5.2.42/SHA256SUMS
sha256 e5bee2e34f349aac115ee93974febfe3213ad5e94045fa36b9f04b5f8caa3720 VirtualBox-5.2.42.tar.bz2
sha256 ff784417295e48e3cee80a596faf05e3b0976e1b94d3b88427939912b0c1fc45 VBoxGuestAdditions_5.2.42.iso

View File

@ -4,7 +4,7 @@
#
################################################################################
VBOX_GUEST_VERSION = 5.2.32
VBOX_GUEST_VERSION = 5.2.42
VBOX_GUEST_SITE = http://download.virtualbox.org/virtualbox/$(VBOX_GUEST_VERSION)
VBOX_GUEST_LICENSE = GPLv2
VBOX_GUEST_LICENSE_FILES = COPYING

View File

@ -34,8 +34,11 @@ import (
v1 "github.com/google/go-containerregistry/pkg/v1"
"github.com/google/go-containerregistry/pkg/v1/daemon"
"github.com/google/go-containerregistry/pkg/v1/remote"
"github.com/google/go-containerregistry/pkg/v1/tarball"
"github.com/pkg/errors"
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/driver"
"k8s.io/minikube/pkg/minikube/localpath"
)
var defaultPlatform = v1.Platform{
@ -94,6 +97,32 @@ func ExistsImageInDaemon(img string) bool {
return false
}
// LoadFromTarball checks if the image exists as a tarball and tries to load it to the local daemon
// TODO: Pass in if we are loading to docker or podman so this function can also be used for podman
func LoadFromTarball(binary, img string) error {
p := filepath.Join(constants.ImageCacheDir, img)
p = localpath.SanitizeCacheDir(p)
switch binary {
case driver.Podman:
return fmt.Errorf("not yet implemented, see issue #8426")
default:
tag, err := name.NewTag(Tag(img))
if err != nil {
return errors.Wrap(err, "new tag")
}
i, err := tarball.ImageFromPath(p, &tag)
if err != nil {
return errors.Wrap(err, "tarball")
}
_, err = daemon.Write(tag, i)
return err
}
}
// Tag returns just the image with the tag
// eg image:tag@sha256:digest -> image:tag if there is an associated tag
// if not possible, just return the initial img

View File

@ -31,6 +31,7 @@ import (
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/download"
"k8s.io/minikube/pkg/minikube/driver"
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/image"
"k8s.io/minikube/pkg/minikube/localpath"
@ -102,7 +103,7 @@ func doCacheBinaries(k8sVersion string) error {
}
// beginDownloadKicBaseImage downloads the kic image
func beginDownloadKicBaseImage(g *errgroup.Group, cc *config.ClusterConfig) {
func beginDownloadKicBaseImage(g *errgroup.Group, cc *config.ClusterConfig, downloadOnly bool) {
if cc.Driver != "docker" {
// TODO: driver == "podman"
glog.Info("Driver isn't docker, skipping base image download")
@ -117,17 +118,36 @@ func beginDownloadKicBaseImage(g *errgroup.Group, cc *config.ClusterConfig) {
out.T(out.Pulling, "Pulling base image ...")
g.Go(func() error {
// TODO #8004 : make base-image respect --image-repository
var finalImg string
// If we end up using a fallback image, notify the user
defer func() {
if finalImg != "" && finalImg != cc.KicBaseImage {
out.WarningT(fmt.Sprintf("minikube was unable to download %s, but successfully downloaded %s as a fallback image", image.Tag(cc.KicBaseImage), image.Tag(finalImg)))
cc.KicBaseImage = finalImg
}
}()
for _, img := range append([]string{cc.KicBaseImage}, kic.FallbackImages...) {
if err := image.LoadFromTarball(driver.Docker, img); err == nil {
glog.Infof("successfully loaded %s from cached tarball", img)
// strip the digest from the img before saving it in the config
// because loading an image from tarball to daemon doesn't load the digest
finalImg = image.Tag(img)
return nil
}
glog.Infof("Downloading %s to local daemon", img)
err := image.WriteImageToDaemon(img)
if err == nil {
if img != cc.KicBaseImage {
out.WarningT(fmt.Sprintf("minikube was unable to download %s, but successfully downloaded %s\n minikube will use %s as a fallback image", image.Tag(cc.KicBaseImage), image.Tag(img), image.Tag(img)))
cc.KicBaseImage = img
}
glog.Infof("successfully downloaded %s", img)
finalImg = img
return nil
}
if downloadOnly {
if err := image.SaveToDir([]string{img}, constants.ImageCacheDir); err == nil {
glog.Infof("successfully saved %s as a tarball", img)
finalImg = img
return nil
}
}
glog.Infof("failed to download %s, will try fallback image if available: %v", img, err)
}
return fmt.Errorf("failed to download kic base image or any fallback image")

View File

@ -195,7 +195,7 @@ func Provision(cc *config.ClusterConfig, n *config.Node, apiServer bool) (comman
}
if driver.IsKIC(cc.Driver) {
beginDownloadKicBaseImage(&kicGroup, cc)
beginDownloadKicBaseImage(&kicGroup, cc, viper.GetBool("download-only"))
}
if !driver.BareMetal(cc.Driver) {