Skip to content

Commit

Permalink
Merge go.mod
Browse files Browse the repository at this point in the history
  • Loading branch information
tstromberg committed Nov 5, 2019
2 parents 187e18d + eea2348 commit 79c94fb
Show file tree
Hide file tree
Showing 16 changed files with 157 additions and 123 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Release Notes

## Version 1.5.2 - 2019-10-31 (Happy Halloween!)

* service: fix --url mode [#5790](https://github.com/kubernetes/minikube/pull/5790)
* Refactor command runner interface, allow stdin writes [#5530](https://github.com/kubernetes/minikube/pull/5530)
* macOS install docs: minikube is a normal Homebrew formula now [#5750](https://github.com/kubernetes/minikube/pull/5750)
* Allow CPU count check to be disabled using --force [#5803](https://github.com/kubernetes/minikube/pull/5803)
* Make network validation friendlier, especially to corp networks [#5802](https://github.com/kubernetes/minikube/pull/5802)

Thank you to our contributors for this release:

- Anders F Björklund
- Issy Long
- Medya Ghazizadeh
- Thomas Strömberg

## Version 1.5.1 - 2019-10-29

* Set Docker open-files limit ( 'ulimit -n') to be consistent with other runtimes [#5761](https://github.com/kubernetes/minikube/pull/5761)
Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
# Bump these on release - and please check ISO_VERSION for correctness.
VERSION_MAJOR ?= 1
VERSION_MINOR ?= 5
VERSION_BUILD ?= 1
VERSION_BUILD ?= 2
RAW_VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).${VERSION_BUILD}
VERSION ?= v$(RAW_VERSION)

# Default to .0 for higher cache hit rates, as build increments typically don't require new ISO versions
ISO_VERSION ?= v$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_BUILD)
ISO_VERSION ?= v$(VERSION_MAJOR).$(VERSION_MINOR).1
# Dashes are valid in semver, but not Linux packaging. Use ~ to delimit alpha/beta
DEB_VERSION ?= $(subst -,~,$(RAW_VERSION))
RPM_VERSION ?= $(DEB_VERSION)
Expand Down Expand Up @@ -261,6 +261,8 @@ endif
-gofmt -s -w $@
@#golint: Dns should be DNS (compat sed)
@sed -i -e 's/Dns/DNS/g' $@ && rm -f ./-e
@#golint: Html should be HTML (compat sed)
@sed -i -e 's/Html/HTML/g' $@ && rm -f ./-e

pkg/minikube/translate/translations.go: $(shell find "translations/" -type f)
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
Expand Down Expand Up @@ -573,4 +575,4 @@ site: site/themes/docsy/assets/vendor/bootstrap/package.js out/hugo/hugo

.PHONY: out/mkcmp
out/mkcmp:
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $@ cmd/performance/main.go
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $@ cmd/performance/main.go
21 changes: 16 additions & 5 deletions cmd/minikube/cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,16 @@ func runDelete(cmd *cobra.Command, args []string) {

// If the purge flag is set, go ahead and delete the .minikube directory.
if purge {
glog.Infof("Purging the '.minikube' directory located at %s", localpath.MiniPath())
if err := os.RemoveAll(localpath.MiniPath()); err != nil {
exit.WithError("unable to delete minikube config folder", err)
}
out.T(out.Crushed, "Successfully purged minikube directory located at - [{{.minikubeDirectory}}]", out.V{"minikubeDirectory": localpath.MiniPath()})
purgeMinikubeDirectory()
}
}

func purgeMinikubeDirectory() {
glog.Infof("Purging the '.minikube' directory located at %s", localpath.MiniPath())
if err := os.RemoveAll(localpath.MiniPath()); err != nil {
exit.WithError("unable to delete minikube config folder", err)
}
out.T(out.Crushed, "Successfully purged minikube directory located at - [{{.minikubeDirectory}}]", out.V{"minikubeDirectory": localpath.MiniPath()})
}

// DeleteProfiles deletes one or more profiles
Expand Down Expand Up @@ -232,6 +236,13 @@ func deleteProfile(profile *pkg_config.Profile) error {
out.T(out.Crushed, `The "{{.name}}" cluster has been deleted.`, out.V{"name": profile.Name})

machineName := pkg_config.GetMachineName()
if err := deleteContext(machineName); err != nil {
return err
}
return nil
}

func deleteContext(machineName string) error {
if err := kubeconfig.DeleteContext(constants.KubeconfigPath, machineName); err != nil {
return DeletionError{Err: fmt.Errorf("update config: %v", err), Errtype: Fatal}
}
Expand Down
86 changes: 53 additions & 33 deletions cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,7 @@ func runStart(cmd *cobra.Command, args []string) {

// No need to install a driver in download-only mode
if !viper.GetBool(downloadOnly) {
v, err := version.GetSemverVersion()
if err != nil {
out.WarningT("Error parsing minikube version: {{.error}}", out.V{"error": err})
} else if err := driver.InstallOrUpdate(driverName, localpath.MakeMiniPath("bin"), v, viper.GetBool(interactive), viper.GetBool(autoUpdate)); err != nil {
out.WarningT("Unable to update {{.driver}} driver: {{.error}}", out.V{"driver": driverName, "error": err})
}
updateDriver(driverName)
}

k8sVersion, isUpgrade := getKubernetesVersion(oldConfig)
Expand Down Expand Up @@ -360,12 +355,7 @@ func runStart(cmd *cobra.Command, args []string) {
configureMounts()

// enable addons with start command
for _, a := range addonList {
err = cmdcfg.Set(a, "true")
if err != nil {
exit.WithError("addon enable failed", err)
}
}
enableAddons()

if err = loadCachedImagesInConfigFile(); err != nil {
out.T(out.FailureType, "Unable to load cached images from config file.")
Expand All @@ -375,7 +365,31 @@ func runStart(cmd *cobra.Command, args []string) {
if driverName == driver.None {
prepareNone()
}
waitCluster(bs, config)
if err := showKubectlInfo(kubeconfig, k8sVersion); err != nil {
glog.Errorf("kubectl info: %v", err)
}
}

func updateDriver(driverName string) {
v, err := version.GetSemverVersion()
if err != nil {
out.WarningT("Error parsing minikube version: {{.error}}", out.V{"error": err})
} else if err := driver.InstallOrUpdate(driverName, localpath.MakeMiniPath("bin"), v, viper.GetBool(interactive), viper.GetBool(autoUpdate)); err != nil {
out.WarningT("Unable to update {{.driver}} driver: {{.error}}", out.V{"driver": driverName, "error": err})
}
}

func enableAddons() {
for _, a := range addonList {
err := cmdcfg.Set(a, "true")
if err != nil {
exit.WithError("addon enable failed", err)
}
}
}

func waitCluster(bs bootstrapper.Bootstrapper, config cfg.Config) {
var podsToWaitFor []string

if !viper.GetBool(waitUntilHealthy) {
Expand All @@ -385,9 +399,6 @@ func runStart(cmd *cobra.Command, args []string) {
if err := bs.WaitForPods(config.KubernetesConfig, viper.GetDuration(waitTimeout), podsToWaitFor); err != nil {
exit.WithError("Wait failed", err)
}
if err := showKubectlInfo(kubeconfig, k8sVersion); err != nil {
glog.Errorf("kubectl info: %v", err)
}
}

func displayVersion(version string) {
Expand Down Expand Up @@ -741,7 +752,7 @@ func validateFlags(drvName string) {
} else {
cpuCount = viper.GetInt(cpus)
}
if cpuCount < minimumCPUS {
if cpuCount < minimumCPUS && !viper.GetBool(force) {
exit.UsageT("Requested cpu count {{.requested_cpus}} is less than the minimum allowed of {{.minimum_cpus}}", out.V{"requested_cpus": cpuCount, "minimum_cpus": minimumCPUS})
}

Expand Down Expand Up @@ -1009,10 +1020,19 @@ func validateNetwork(h *host.Host, r command.Runner) string {
}

if !driver.BareMetal(h.Driver.DriverName()) {
sshAddr := fmt.Sprintf("%s:22", ip)
conn, err := net.Dial("tcp", sshAddr)
if err != nil {
exit.WithCodeT(exit.IO, `minikube is unable to connect to the VM: {{.error}}
trySSH(h, ip)
}

tryLookup(r)
tryRegistry(r)
return ip
}

func trySSH(h *host.Host, ip string) {
sshAddr := fmt.Sprintf("%s:22", ip)
conn, err := net.Dial("tcp", sshAddr)
if err != nil {
exit.WithCodeT(exit.IO, `minikube is unable to connect to the VM: {{.error}}
This is likely due to one of two reasons:
Expand All @@ -1025,20 +1045,20 @@ Suggested workarounds:
- Configure your local VPN or firewall to allow access to {{.ip}}
- Restart or reinstall {{.hypervisor}}
- Use an alternative --vm-driver`, out.V{"error": err, "hypervisor": h.Driver.DriverName(), "ip": ip})
}
defer conn.Close()
}

if _, err := r.RunCmd(exec.Command("nslookup", "kubernetes.io")); err != nil {
out.WarningT("VM is unable to resolve DNS hosts: {[.error}}", out.V{"error": err})
}
defer conn.Close()
}

// Try both UDP and ICMP to assert basic external connectivity
if _, err := r.RunCmd(exec.Command("/bin/bash", "-c", "nslookup k8s.io 8.8.8.8 || nslookup k8s.io 1.1.1.1 || ping -c1 8.8.8.8")); err != nil {
out.WarningT("VM is unable to directly connect to the internet: {{.error}}", out.V{"error": err})
func tryLookup(r command.Runner) {
// DNS check
if rr, err := r.RunCmd(exec.Command("nslookup", "kubernetes.io")); err != nil {
glog.Warningf("%s failed: %v", rr.Args, err)
out.WarningT("VM may be unable to resolve external DNS records")
}
}

// Try an HTTPS connection to the
func tryRegistry(r command.Runner) {
// Try an HTTPS connection to the image repository
proxy := os.Getenv("HTTPS_PROXY")
opts := []string{"-sS"}
if proxy != "" && !strings.HasPrefix(proxy, "localhost") && !strings.HasPrefix(proxy, "127.0") {
Expand All @@ -1051,10 +1071,10 @@ Suggested workarounds:
}

opts = append(opts, fmt.Sprintf("https://%s/", repo))
if _, err := r.RunCmd(exec.Command("curl", opts...)); err != nil {
out.WarningT("VM is unable to connect to the selected image repository: {{.error}}", out.V{"error": err})
if rr, err := r.RunCmd(exec.Command("curl", opts...)); err != nil {
glog.Warningf("%s failed: %v", rr.Args, err)
out.WarningT("VM is unable to access {{.repository}}, you may need to configure a proxy or set --image-repository", out.V{"repository": repo})
}
return ip
}

// getKubernetesVersion ensures that the requested version is reasonable
Expand Down
1 change: 1 addition & 0 deletions cmd/minikube/cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (
var statusFormat string
var output string

// KubeconfigStatus represents the kubeconfig status
var KubeconfigStatus = struct {
Configured string
Misconfigured string
Expand Down
8 changes: 8 additions & 0 deletions deploy/minikube/releases.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
[
{
"name": "v1.5.2",
"checksums": {
"darwin": "734306019f837a6aee9cb7a0245839f98ea7688ee2cde387099334cb9356c2c4",
"linux": "1972a9a96de85e480012f6d2c9b8a88fd29217b99b1a973ed5e199386659f7e9",
"windows": "9f012922fd8d701070ef3951b0df77b720805a204d4d0dfa15d11899fda8a2d0"
}
},
{
"name": "v1.5.1",
"checksums": {
Expand Down
2 changes: 1 addition & 1 deletion hack/jenkins/linux_integration_tests_kvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ EXPECTED_DEFAULT_DRIVER="kvm2"
# We pick kvm as our gvisor testbed because it is fast & reliable
EXTRA_TEST_ARGS="-gvisor"

mkdir cron && gsutil -qm rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES"
mkdir -p cron && gsutil -qm rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES"
sudo install cron/cleanup_and_reboot_Linux.sh /etc/cron.hourly/cleanup_and_reboot || echo "FAILED TO INSTALL CLEANUP"

# Download files and set permissions
Expand Down
5 changes: 3 additions & 2 deletions hack/jenkins/linux_integration_tests_virtualbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ VM_DRIVER="virtualbox"
JOB_NAME="VirtualBox_Linux"
EXPECTED_DEFAULT_DRIVER="kvm2"

mkdir -p cron && gsutil -m rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron
sudo install cleanup_and_reboot_Linux.sh /etc/cron.hourly/cleanup_and_reboot
mkdir -p cron && gsutil -qm rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES"
sudo install cron/cleanup_and_reboot_Linux.sh /etc/cron.hourly/cleanup_and_reboot || echo "FAILED TO INSTALL CLEANUP"


# Download files and set permissions
source ./common.sh
6 changes: 6 additions & 0 deletions hack/jenkins/release_update_brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ if [ -z "${NEW_SHA256}" ]; then
exit 1
fi

echo "***********************************************************************"
echo "Sorry, this script has not yet been updated to support non-cask updates"
echo "See https://github.com/kubernetes/minikube/issues/5779"
echo "***********************************************************************"
exit 99

git config --global user.name "${GITHUB_USER}"
git config --global user.email "${GITHUB_USER}@google.com"

Expand Down
87 changes: 20 additions & 67 deletions pkg/minikube/cruntime/cruntime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,21 @@ func NewFakeRunner(t *testing.T) *FakeRunner {
}
}

func buffer(s string, err error) (*command.RunResult, error) {
rr := &command.RunResult{}
if err != nil {
return rr, err
}
var buf bytes.Buffer
_, err = buf.WriteString(s)
if err != nil {
return rr, errors.Wrap(err, "Writing outStr to FakeRunner's buffer")
}
rr.Stdout = buf
rr.Stderr = buf
return rr, err
}

// Run a fake command!
func (f *FakeRunner) RunCmd(cmd *exec.Cmd) (*command.RunResult, error) {
xargs := cmd.Args
Expand All @@ -127,77 +142,15 @@ func (f *FakeRunner) RunCmd(cmd *exec.Cmd) (*command.RunResult, error) {
}
switch bin {
case "systemctl":
s, err := f.systemctl(args, root)
rr := &command.RunResult{}
if err != nil {
return rr, err
}
var buf bytes.Buffer
_, err = buf.WriteString(s)
if err != nil {
return rr, errors.Wrap(err, "Writing outStr to FakeRunner's buffer")
}
rr.Stdout = buf
rr.Stderr = buf
return rr, err
return buffer(f.systemctl(args, root))
case "docker":
s, err := f.docker(args, root)
rr := &command.RunResult{}
if err != nil {
return rr, err
}
var buf bytes.Buffer
_, err = buf.WriteString(s)
if err != nil {
return rr, errors.Wrap(err, "Writing FakeRunner's buffer")
}
rr.Stdout = buf
rr.Stderr = buf
return rr, err

return buffer(f.docker(args, root))
case "crictl":
s, err := f.crictl(args, root)
rr := &command.RunResult{}
if err != nil {
return rr, err
}
var buf bytes.Buffer
_, err = buf.WriteString(s)
if err != nil {
return rr, errors.Wrap(err, "Writing to FakeRunner's buffer")
}
rr.Stdout = buf
rr.Stderr = buf
return rr, err
return buffer(f.crictl(args, root))
case "crio":
s, err := f.crio(args, root)
rr := &command.RunResult{}
if err != nil {
return rr, err
}
var buf bytes.Buffer
_, err = buf.WriteString(s)
if err != nil {
return rr, errors.Wrap(err, "Writing to FakeRunner's buffer")
}
rr.Stdout = buf
rr.Stderr = buf
return rr, err
return buffer(f.crio(args, root))
case "containerd":
s, err := f.containerd(args, root)
rr := &command.RunResult{}
if err != nil {
return rr, err
}

var buf bytes.Buffer
_, err = buf.WriteString(s)
if err != nil {
return rr, errors.Wrap(err, "Writing to FakeRunner's buffer")
}
rr.Stdout = buf
rr.Stderr = buf
return rr, err
return buffer(f.containerd(args, root))
default:
rr := &command.RunResult{}
return rr, nil
Expand Down
Loading

0 comments on commit 79c94fb

Please sign in to comment.