Skip to content

Commit

Permalink
Merge branch 'master' into podman-sudo
Browse files Browse the repository at this point in the history
  • Loading branch information
afbjorklund committed Apr 25, 2020
2 parents e99340b + 947dc21 commit 6644c5c
Show file tree
Hide file tree
Showing 143 changed files with 3,265 additions and 1,423 deletions.
944 changes: 476 additions & 468 deletions .github/workflows/master.yml

Large diffs are not rendered by default.

942 changes: 475 additions & 467 deletions .github/workflows/pr.yml

Large diffs are not rendered by default.

89 changes: 89 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,94 @@
# Release Notes

## Version 1.10.0-beta.1 - 2020-04-22

Improvements:
* Skip preload download if --image-repository is set [#7707](https://github.com/kubernetes/minikube/pull/7707)


Bug Fixes:
* ISO: persistently mount /var/lib/containerd [#7843](https://github.com/kubernetes/minikube/pull/7843)
* docker/podman: fix delete -p not cleaning up & add integration test [#7819](https://github.com/kubernetes/minikube/pull/7819)


Huge thank you for this release towards our contributors:
- Anders F Björklund
- Kenta Iso
- Medya Ghazizadeh
- Prasad Katti
- Priya Wadhwa
- Sharif Elgamal
- Thomas Stromberg
- Tobias Klauser


## Version 1.10.0-beta.0 - 2020-04-20

Improvements:
* faster containerd start by preloading images [#7793](https://github.com/kubernetes/minikube/pull/7793)
* Add fish completion support [#7777](https://github.com/kubernetes/minikube/pull/7777)
* Behavior change: start with no arguments uses existing cluster config [#7449](https://github.com/kubernetes/minikube/pull/7449)
* conformance: add --wait=all, reduce quirks [#7716](https://github.com/kubernetes/minikube/pull/7716)
* Upgrade minimum supported k8s version to v1.12 [#7723](https://github.com/kubernetes/minikube/pull/7723)
* Add default CNI network for running wth podman [#7754](https://github.com/kubernetes/minikube/pull/7754)
* Behavior change: fallback to alternate drivers on failure [#7389](https://github.com/kubernetes/minikube/pull/7389)
* Add registry addon feature for docker on mac/windows [#7603](https://github.com/kubernetes/minikube/pull/7603)
* Check node pressure & new option "node_ready" for --wait flag [#7752](https://github.com/kubernetes/minikube/pull/7752)
* docker driver: Add Service & Tunnel features to windows [#7739](https://github.com/kubernetes/minikube/pull/7739)
* Add master node/worker node type to `minikube status` [#7586](https://github.com/kubernetes/minikube/pull/7586)
* Add new wait component apps_running [#7460](https://github.com/kubernetes/minikube/pull/7460)
* none: Add support for OpenRC init (Google CloudShell) [#7539](https://github.com/kubernetes/minikube/pull/7539)
* Upgrade falco-probe module to version 0.21.0 [#7436](https://github.com/kubernetes/minikube/pull/7436)

Bug Fixes:
* Fix multinode cluster creation for VM drivers [#7700](https://github.com/kubernetes/minikube/pull/7700)
* tunnel: Fix resolver file permissions, add DNS forwarding test [#7753](https://github.com/kubernetes/minikube/pull/7753)
* unconfine apparmor for kic [#7658](https://github.com/kubernetes/minikube/pull/7658)
* Fix `minikube delete` output nodename missing with docker/podman driver [#7553](https://github.com/kubernetes/minikube/pull/7553)
* Respect driver.FlagDefaults even if --extra-config is set [#7509](https://github.com/kubernetes/minikube/pull/7509)
* remove docker/podman overlay network for docker-runtime [#7425](https://github.com/kubernetes/minikube/pull/7425)


Huge thank you for this release towards our contributors:

- Alonyb
- Anders F Björklund
- Anshul Sirur
- Balint Pato
- Batuhan Apaydın
- Brad Walker
- Frank Schwichtenberg
- Kenta Iso
- Medya Ghazizadeh
- Michael Vorburger ⛑️
- Pablo Caderno
- Prasad Katti
- Priya Wadhwa
- Radoslaw Smigielski
- Ruben Baez
- Sharif Elgamal
- Thomas Strömberg
- Vikky Omkar
- ZouYu
- gorbondiga
- loftkun
- nestoralonso
- remraz
- sayboras
- tomocy

Thank you so much to users who helped with community triage:

- ps-feng
- Prasad Katti

And big thank you to those who participated in our docs fixit week:

- matjung
- jlaswell
- remraz


## Version 1.9.2 - 2020-04-04

Minor improvements:
Expand Down
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@

# Bump these on release - and please check ISO_VERSION for correctness.
VERSION_MAJOR ?= 1
VERSION_MINOR ?= 9
VERSION_BUILD ?= 2
VERSION_MINOR ?= 10
VERSION_BUILD ?= 0-beta.1
RAW_VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_BUILD)
VERSION ?= v$(RAW_VERSION)

KUBERNETES_VERSION ?= $(shell egrep "DefaultKubernetesVersion =" pkg/minikube/constants/constants.go | cut -d \" -f2)
KIC_VERSION ?= $(shell egrep "Version =" pkg/drivers/kic/types.go | cut -d \" -f2)

# 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).0
ISO_VERSION ?= v$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_BUILD)
# 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 @@ -255,7 +255,7 @@ docker-machine-driver-hyperkit: out/docker-machine-driver-hyperkit ## Build Hype
docker-machine-driver-kvm2: out/docker-machine-driver-kvm2 ## Build KVM2 driver

.PHONY: integration
integration: out/minikube ## Trigger minikube integration test
integration: out/minikube$(IS_EXE) ## Trigger minikube integration test
go test -v -test.timeout=60m ./test/integration --tags="$(MINIKUBE_INTEGRATION_BUILD_TAGS)" $(TEST_ARGS)

.PHONY: integration-none-driver
Expand All @@ -276,7 +276,7 @@ generate-docs: out/minikube ## Automatically generate commands documentation.

.PHONY: gotest
gotest: $(SOURCE_GENERATED) ## Trigger minikube test
go test -tags "$(MINIKUBE_BUILD_TAGS)" $(MINIKUBE_TEST_FILES)
go test -tags "$(MINIKUBE_BUILD_TAGS)" -ldflags="$(MINIKUBE_LDFLAGS)" $(MINIKUBE_TEST_FILES)

.PHONY: extract
extract: ## Compile extract tool
Expand Down Expand Up @@ -397,6 +397,10 @@ reportcard: ## Run goreportcard for minikube
mdlint:
@$(MARKDOWNLINT) $(MINIKUBE_MARKDOWN_FILES)

.PHONY: verify-iso
verify-iso: # Make sure the current ISO exists in the expected bucket
gsutil stat gs://$(ISO_BUCKET)/minikube-$(ISO_VERSION).iso

out/docs/minikube.md: $(shell find "cmd") $(shell find "pkg/minikube/constants") pkg/minikube/assets/assets.go pkg/minikube/translate/translations.go
go run -ldflags="$(MINIKUBE_LDFLAGS)" -tags gendocs hack/help_text/gen_help_text.go

Expand Down
31 changes: 27 additions & 4 deletions cmd/minikube/cmd/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
)

const longDescription = `
Outputs minikube shell completion for the given shell (bash or zsh)
Outputs minikube shell completion for the given shell (bash, zsh or fish)
This depends on the bash-completion binary. Example installation instructions:
OS X:
Expand All @@ -37,15 +37,18 @@ const longDescription = `
$ minikube completion bash > ~/.minikube-completion # for bash users
$ minikube completion zsh > ~/.minikube-completion # for zsh users
$ source ~/.minikube-completion
$ minikube completion fish > ~/.config/fish/completions/minikube.fish # for fish users
Ubuntu:
$ apt-get install bash-completion
$ source /etc/bash-completion
$ source <(minikube completion bash) # for bash users
$ source <(minikube completion zsh) # for zsh users
$ minikube completion fish > ~/.config/fish/completions/minikube.fish # for fish users
Additionally, you may want to output the completion to a file and source in your .bashrc
Note for zsh users: [1] zsh completions are only supported in versions of zsh >= 5.2
Note for fish users: [2] please refer to this docs for more details https://fishshell.com/docs/current/#tab-completion
`

const boilerPlate = `
Expand All @@ -66,24 +69,29 @@ const boilerPlate = `

var completionCmd = &cobra.Command{
Use: "completion SHELL",
Short: "Outputs minikube shell completion for the given shell (bash or zsh)",
Short: "Outputs minikube shell completion for the given shell (bash, zsh or fish)",
Long: longDescription,
Run: func(cmd *cobra.Command, args []string) {
if len(args) != 1 {
exit.UsageT("Usage: minikube completion SHELL")
}
if args[0] != "bash" && args[0] != "zsh" {
if args[0] != "bash" && args[0] != "zsh" && args[0] != "fish" {
exit.UsageT("Sorry, completion support is not yet implemented for {{.name}}", out.V{"name": args[0]})
} else if args[0] == "bash" {
err := GenerateBashCompletion(os.Stdout, cmd.Parent())
if err != nil {
exit.WithError("bash completion failed", err)
}
} else {
} else if args[0] == "zsh" {
err := GenerateZshCompletion(os.Stdout, cmd.Parent())
if err != nil {
exit.WithError("zsh completion failed", err)
}
} else {
err := GenerateFishCompletion(os.Stdout, cmd.Parent())
if err != nil {
exit.WithError("fish completion failed", err)
}
}

},
Expand Down Expand Up @@ -279,3 +287,18 @@ __minikube_bash_source <(__minikube_convert_bash_to_zsh)

return nil
}

// GenerateBashCompletion generates the completion for the bash shell
func GenerateFishCompletion(w io.Writer, cmd *cobra.Command) error {
_, err := w.Write([]byte(boilerPlate))
if err != nil {
return err
}

err = cmd.GenFishCompletion(w, true)
if err != nil {
return errors.Wrap(err, "Error generating fish completion")
}

return nil
}
26 changes: 26 additions & 0 deletions cmd/minikube/cmd/config/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ package config

import (
"io/ioutil"
"net"

"github.com/spf13/cobra"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/out"
"k8s.io/minikube/pkg/minikube/service"
Expand Down Expand Up @@ -184,6 +186,30 @@ var addonsConfigureCmd = &cobra.Command{
out.WarningT("ERROR creating `registry-creds-acr` secret")
}

case "metallb":
profile := ClusterFlagValue()
cfg, err := config.Load(profile)
if err != nil {
out.ErrT(out.FatalType, "Failed to load config {{.profile}}", out.V{"profile": profile})
}

validator := func(s string) bool {
return net.ParseIP(s) != nil
}

if cfg.KubernetesConfig.LoadBalancerStartIP == "" {
cfg.KubernetesConfig.LoadBalancerStartIP = AskForStaticValidatedValue("-- Enter Load Balancer Start IP: ", validator)
}

if cfg.KubernetesConfig.LoadBalancerEndIP == "" {
cfg.KubernetesConfig.LoadBalancerEndIP = AskForStaticValidatedValue("-- Enter Load Balancer End IP: ", validator)
}

err = config.SaveProfile(profile, cfg)
if err != nil {
out.ErrT(out.FatalType, "Failed to save config {{.profile}}", out.V{"profile": profile})
}

default:
out.FailureT("{{.name}} has no available configuration options", out.V{"name": addon})
return
Expand Down
20 changes: 20 additions & 0 deletions cmd/minikube/cmd/config/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,23 @@ func posString(slice []string, element string) int {
func containsString(slice []string, element string) bool {
return posString(slice, element) != -1
}

// AskForStaticValidatedValue asks for a single value to enter and check for valid input
func AskForStaticValidatedValue(s string, validator func(s string) bool) string {
reader := bufio.NewReader(os.Stdin)

for {
response := getStaticValue(reader, s)

// Can't have zero length
if len(response) == 0 {
out.Err("--Error, please enter a value:")
continue
}
if !validator(response) {
out.Err("--Invalid input, please enter a value:")
continue
}
return response
}
}
40 changes: 27 additions & 13 deletions cmd/minikube/cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ func runDelete(cmd *cobra.Command, args []string) {
out.ErrT(out.Meh, `"{{.name}}" profile does not exist, trying anyways.`, out.V{"name": cname})
}

deletePossibleKicLeftOver(cname)

errs := DeleteProfiles([]*config.Profile{profile})
if len(errs) > 0 {
HandleDeletionErrors(errs)
Expand Down Expand Up @@ -189,20 +191,32 @@ func DeleteProfiles(profiles []*config.Profile) []error {
return errs
}

func deleteProfileContainersAndVolumes(name string) {
func deletePossibleKicLeftOver(name string) {
delLabel := fmt.Sprintf("%s=%s", oci.ProfileLabelKey, name)
errs := oci.DeleteContainersByLabel("env", oci.Docker, delLabel)
if errs != nil { // it will error if there is no container to delete
glog.Infof("error deleting containers for %s (might be okay):\n%v", name, errs)
}
errs = oci.DeleteAllVolumesByLabel("env", oci.Docker, delLabel)
if errs != nil { // it will not error if there is nothing to delete
glog.Warningf("error deleting volumes (might be okay).\nTo see the list of volumes run: 'docker volume ls'\n:%v", errs)
}
prefixes := []string{"env", "sudo"}
for i, bin := range []string{oci.Docker, oci.Podman} {
prefix := prefixes[i]
cs, err := oci.ListContainersByLabel(prefix, bin, delLabel)
if err == nil && len(cs) > 0 {
for _, c := range cs {
out.T(out.DeletingHost, `Deleting container "{{.name}}" ...`, out.V{"name": name})
err := oci.DeleteContainer(prefix, bin, c)
if err != nil { // it will error if there is no container to delete
glog.Errorf("error deleting container %q. you might want to delete that manually :\n%v", name, err)
}

errs = oci.PruneAllVolumesByLabel("env", oci.Docker, delLabel)
if len(errs) > 0 { // it will not error if there is nothing to delete
glog.Warningf("error pruning volume (might be okay):\n%v", errs)
}
}

errs := oci.DeleteAllVolumesByLabel(prefix, bin, delLabel)
if errs != nil { // it will not error if there is nothing to delete
glog.Warningf("error deleting volumes (might be okay).\nTo see the list of volumes run: 'docker volume ls'\n:%v", errs)
}

errs = oci.PruneAllVolumesByLabel(prefix, bin, delLabel)
if len(errs) > 0 { // it will not error if there is nothing to delete
glog.Warningf("error pruning volume (might be okay):\n%v", errs)
}
}
}

Expand All @@ -212,7 +226,7 @@ func deleteProfile(profile *config.Profile) error {
// if driver is oci driver, delete containers and volumes
if driver.IsKIC(profile.Config.Driver) {
out.T(out.DeletingHost, `Deleting "{{.profile_name}}" in {{.driver_name}} ...`, out.V{"profile_name": profile.Name, "driver_name": profile.Config.Driver})
deleteProfileContainersAndVolumes(profile.Name)
deletePossibleKicLeftOver(profile.Name)
}
}

Expand Down
1 change: 0 additions & 1 deletion cmd/minikube/cmd/node_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ var nodeStartCmd = &cobra.Command{
}

func init() {
nodeStartCmd.Flags().String("name", "", "The name of the node to start")
nodeStartCmd.Flags().Bool(deleteOnFailure, false, "If set, delete the current cluster if start fails and try again. Defaults to false.")
nodeCmd.AddCommand(nodeStartCmd)
}
1 change: 0 additions & 1 deletion cmd/minikube/cmd/node_stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,5 @@ var nodeStopCmd = &cobra.Command{
}

func init() {
nodeStopCmd.Flags().String("name", "", "The name of the node to delete")
nodeCmd.AddCommand(nodeStopCmd)
}
10 changes: 5 additions & 5 deletions cmd/minikube/cmd/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@ var serviceCmd = &cobra.Command{
cname := ClusterFlagValue()
co := mustload.Healthy(cname)

if driver.NeedsPortForward(co.Config.Driver) {
startKicServiceTunnel(svc, cname)
return
}

urls, err := service.WaitForService(co.API, co.Config.Name, namespace, svc, serviceURLTemplate, serviceURLMode, https, wait, interval)
if err != nil {
var s *service.SVCNotFoundError
Expand All @@ -95,6 +90,11 @@ You may select another namespace by using 'minikube service {{.service}} -n <nam
exit.WithError("Error opening service", err)
}

if driver.NeedsPortForward(co.Config.Driver) {
startKicServiceTunnel(svc, cname)
return
}

openURLs(svc, urls)
},
}
Expand Down
Loading

0 comments on commit 6644c5c

Please sign in to comment.