Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into luowei-dev
Browse files Browse the repository at this point in the history
yayaha committed Aug 25, 2021
2 parents 6e89511 + 0bb1f67 commit 615df84
Showing 153 changed files with 14,516 additions and 13,595 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -20,7 +20,10 @@ jobs:
id: gendocs
run: |
make generate-docs
echo "::set-output name=changes::$(git status --porcelain)"
c=$(git status --porcelain)
c="${c//$'\n'/'%0A'}"
c="${c//$'\r'/'%0D'}"
echo "::set-output name=changes::$c"
- name: Create PR
if: ${{ steps.gendocs.outputs.changes != '' }}
uses: peter-evans/create-pull-request@v3
@@ -37,6 +40,7 @@ jobs:
body: |
Committing changes resulting from `make generate-docs`.
This PR is auto-generated by the [gendocs](https://github.com/kubernetes/minikube/blob/master/.github/workflows/docs.yml) CI workflow.
```
${{ steps.gendocs.outputs.changes }}
```
6 changes: 5 additions & 1 deletion .github/workflows/leaderboard.yml
Original file line number Diff line number Diff line change
@@ -21,7 +21,10 @@ jobs:
id: leaderboard
run: |
make update-leaderboard
echo "::set-output name=changes::$(git status --porcelain)"
c=$(git status --porcelain)
c="${c//$'\n'/'%0A'}"
c="${c//$'\r'/'%0D'}"
echo "::set-output name=changes::$c"
env:
GITHUB_TOKEN: ${{ secrets.MINIKUBE_BOT_PAT }}
- name: Create PR
@@ -40,6 +43,7 @@ jobs:
body: |
Committing changes resulting from `make update-leaderboard`.
This PR is auto-generated by the [update-leaderboard](https://github.com/kubernetes/minikube/blob/master/.github/workflows/leaderboard.yml) CI workflow.
```
${{ steps.leaderboard.outputs.changes }}
```
4 changes: 2 additions & 2 deletions .github/workflows/pr_verified.yaml
Original file line number Diff line number Diff line change
@@ -854,7 +854,7 @@ jobs:
$docker_running = $?
}
Write-Output "Docker is running"
docker system prune -f
docker system prune -f --volumes
- name: Info
shell: powershell
run: |
@@ -949,7 +949,7 @@ jobs:
$docker_running = $?
}
Write-Output "Docker is running"
docker system prune -f
docker system prune -f --volumes
- name: Info
continue-on-error: true
shell: powershell
2 changes: 1 addition & 1 deletion .github/workflows/update-golang-version.yml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ env:
GOPROXY: https://proxy.golang.org
GO_VERSION: '1.16.7'
jobs:
bump-k8s-versions:
bump-golang-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
45 changes: 45 additions & 0 deletions .github/workflows/update-golint-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "update-golint-version"
on:
workflow_dispatch:
schedule:
# every Monday at around 3 am pacific/10 am UTC
- cron: "0 10 * * 1"
env:
GOPROXY: https://proxy.golang.org
GO_VERSION: '1.16.7'
jobs:
bump-golint-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ${{env.GO_VERSION}}
stable: true
- name: Bump Golint Versions
id: bumpGolint
run: |
make update-golint-version
echo "::set-output name=changes::$(git status --porcelain)"
- name: Create PR
if: ${{ steps.bumpGolint.outputs.changes != '' }}
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.MINIKUBE_BOT_PAT }}
commit-message: bump golaint versions
committer: minikube-bot <[email protected]>
author: minikube-bot <[email protected]>
branch: auto_bump_golint_version
push-to-fork: minikube-bot/minikube
base: master
delete-branch: true
title: 'bump golint version'
labels: ok-to-test
body: |
Golangci-lint Project release a [new version](https://github.com/golangci/golangci-lint/releases),
This PR was auto-generated by `make update-golint-version` using [update-golint-version.yml](https://github.com/kubernetes/minikube/tree/master/.github/workflows/update-golint-version.yml) CI Workflow.
7 changes: 6 additions & 1 deletion .github/workflows/update-k8s-versions.yml
Original file line number Diff line number Diff line change
@@ -20,7 +20,10 @@ jobs:
id: bumpk8s
run: |
make update-kubernetes-version
echo "::set-output name=changes::$(git status --porcelain)"
c=$(git status --porcelain)
c="${c//$'\n'/'%0A'}"
c="${c//$'\r'/'%0D'}"
echo "::set-output name=changes::$c"
- name: Create PR
if: ${{ steps.bumpk8s.outputs.changes != '' }}
uses: peter-evans/create-pull-request@v3
@@ -39,5 +42,7 @@ jobs:
This PR was auto-generated by `make update-kubernetes-version` using [update-k8s-versions.yml](https://github.com/kubernetes/minikube/tree/master/.github/workflows) CI Workflow.
Please only merge if all the tests pass.
```
${{ steps.bumpk8s.outputs.changes }}
```
26 changes: 16 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ KUBERNETES_VERSION ?= $(shell egrep "DefaultKubernetesVersion =" pkg/minikube/co
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 ?= v1.22.0-1628238775-12122
ISO_VERSION ?= v1.22.0-1628974786-12268
# Dashes are valid in semver, but not Linux packaging. Use ~ to delimit alpha/beta
DEB_VERSION ?= $(subst -,~,$(RAW_VERSION))
DEB_REVISION ?= 0
@@ -32,14 +32,15 @@ RPM_VERSION ?= $(DEB_VERSION)
RPM_REVISION ?= 0

# used by hack/jenkins/release_build_and_upload.sh and KVM_BUILD_IMAGE, see also BUILD_IMAGE below
# update this only by running `make update-golang-version`
GO_VERSION ?= 1.16.7

# replace "x.y.0" => "x.y". kube-cross and golang.org/dl use different formats for x.y.0 go versions
KVM_GO_VERSION ?= $(GO_VERSION:.0=)


INSTALL_SIZE ?= $(shell du out/minikube-windows-amd64.exe | cut -f1)
BUILDROOT_BRANCH ?= 2020.02.12
BUILDROOT_BRANCH ?= 2021.02.4
REGISTRY ?= gcr.io/k8s-minikube

# Get git commit id
@@ -65,17 +66,18 @@ MINIKUBE_BUCKET ?= minikube/releases
MINIKUBE_UPLOAD_LOCATION := gs://${MINIKUBE_BUCKET}
MINIKUBE_RELEASES_URL=https://github.com/kubernetes/minikube/releases/download

KERNEL_VERSION ?= 4.19.182
# latest from https://github.com/golangci/golangci-lint/releases
GOLINT_VERSION ?= v1.39.0
KERNEL_VERSION ?= 4.19.202
# latest from https://github.com/golangci/golangci-lint/releases
# update this only by running `make update-golint-version`
GOLINT_VERSION ?= v1.42.0
# Limit number of default jobs, to avoid the CI builds running out of memory
GOLINT_JOBS ?= 4
# see https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint
GOLINT_GOGC ?= 100
# options for lint (golangci-lint)
GOLINT_OPTIONS = --timeout 7m \
--build-tags "${MINIKUBE_INTEGRATION_BUILD_TAGS}" \
--enable gofmt,goimports,gocritic,golint,gocyclo,misspell,nakedret,stylecheck,unconvert,unparam,dogsled \
--enable gofmt,goimports,gocritic,revive,gocyclo,misspell,nakedret,stylecheck,unconvert,unparam,dogsled \
--exclude 'variable on range scope.*in function literal|ifElseChain'

export GO111MODULE := on
@@ -280,8 +282,6 @@ minikube_iso: deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/usr/b
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 host-python
$(MAKE) -C $(BUILD_DIR)/buildroot
mv $(BUILD_DIR)/buildroot/output/images/rootfs.iso9660 $(BUILD_DIR)/minikube.iso
@@ -682,7 +682,7 @@ docker-multi-arch-builder:
env $(X_BUILD_ENV) docker buildx rm --builder $(X_DOCKER_BUILDER) || true
env $(X_BUILD_ENV) docker buildx create --name $(X_DOCKER_BUILDER) --buildkitd-flags '--debug' || true

KICBASE_ARCH = linux/arm64,linux/amd64
KICBASE_ARCH = linux/amd64,linux/arm,linux/arm64,linux/ppc64le,linux/s390x
KICBASE_IMAGE_GCR ?= $(REGISTRY)/kicbase:$(KIC_VERSION)
KICBASE_IMAGE_HUB ?= kicbase/stable:$(KIC_VERSION)
KICBASE_IMAGE_REGISTRIES ?= $(KICBASE_IMAGE_GCR) $(KICBASE_IMAGE_HUB)
@@ -785,7 +785,7 @@ release-notes:
update-leaderboard:
hack/update_contributions.sh

out/docker-machine-driver-kvm2: out/docker-machine-driver-kvm2-amd64
out/docker-machine-driver-kvm2: out/docker-machine-driver-kvm2-$(GOARCH)
$(if $(quiet),@echo " CP $@")
$(Q)cp $< $@

@@ -973,6 +973,12 @@ update-kubernetes-version:
(cd hack/update/kubernetes_version && \
go run update_kubernetes_version.go)

.PHONY: update-golint-version
update-golint-version:
(cd hack/update/golint_version && \
go run update_golint_version.go)


.PHONY: update-kubernetes-version-pr
update-kubernetes-version-pr:
ifndef GITHUB_TOKEN
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@ minikube runs the latest stable release of Kubernetes, with support for standard
* [Dashboard](https://minikube.sigs.k8s.io/docs/handbook/dashboard/) - `minikube dashboard`
* [Container runtimes](https://minikube.sigs.k8s.io/docs/handbook/config/#runtime-configuration) - `minikube start --container-runtime`
* [Configure apiserver and kubelet options](https://minikube.sigs.k8s.io/docs/handbook/config/#modifying-kubernetes-defaults) via command-line flags
* Supports common [CI environments](https://github.com/minikube-ci/examples)

As well as developer-friendly features:

4 changes: 2 additions & 2 deletions cmd/auto-pause/auto-pause-hook/config.go
Original file line number Diff line number Diff line change
@@ -91,8 +91,8 @@ func selfRegistration(clientset *kubernetes.Clientset, caCert []byte) {
klog.Fatal(err2)
}
}
var failurePolicy v1.FailurePolicyType = v1.Fail
var sideEffects v1.SideEffectClass = v1.SideEffectClassNone
var failurePolicy = v1.Fail
var sideEffects = v1.SideEffectClassNone

webhookConfig := &v1.MutatingWebhookConfiguration{
ObjectMeta: metav1.ObjectMeta{
3 changes: 2 additions & 1 deletion cmd/minikube/cmd/delete.go
Original file line number Diff line number Diff line change
@@ -157,7 +157,8 @@ func runDelete(cmd *cobra.Command, args []string) {
if err != nil {
klog.Warningf("'error loading profiles in minikube home %q: %v", localpath.MiniPath(), err)
}
profilesToDelete := append(validProfiles, invalidProfiles...)
profilesToDelete := validProfiles
profilesToDelete = append(profilesToDelete, invalidProfiles...)
// in the case user has more than 1 profile and runs --purge
// to prevent abandoned VMs/containers, force user to run with delete --all
if purge && len(profilesToDelete) > 1 && !deleteAll {
3 changes: 2 additions & 1 deletion cmd/minikube/cmd/delete_test.go
Original file line number Diff line number Diff line change
@@ -221,7 +221,8 @@ func TestDeleteAllProfiles(t *testing.T) {
t.Errorf("ListProfiles length = %d, expected %d\nvalid: %v\ninvalid: %v\n", len(validProfiles)+len(inValidProfiles), numberOfTotalProfileDirs, validProfiles, inValidProfiles)
}

profiles := append(validProfiles, inValidProfiles...)
profiles := validProfiles
profiles = append(profiles, inValidProfiles...)
hostAndDirsDeleter = hostAndDirsDeleterMock
errs := DeleteProfiles(profiles)

85 changes: 85 additions & 0 deletions cmd/minikube/cmd/docker-env.go
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@ limitations under the License.
package cmd

import (
"encoding/json"
"fmt"
"io"
"net"
@@ -33,6 +34,7 @@ import (
apiWait "k8s.io/apimachinery/pkg/util/wait"

"github.com/spf13/cobra"
"gopkg.in/yaml.v2"
"k8s.io/klog/v2"

kconst "k8s.io/kubernetes/cmd/kubeadm/app/constants"
@@ -384,12 +386,94 @@ func dockerSetScript(ec DockerEnvConfig, w io.Writer) error {
dockerSetEnvTmpl = dockerEnvTCPTmpl
}
envVars := dockerEnvVars(ec)
if ec.Shell == "none" {
switch outputFormat {
case "":
// shell "none"
break
case "text":
for k, v := range envVars {
_, err := fmt.Fprintf(w, "%s=%s\n", k, v)
if err != nil {
return err
}
}
return nil
case "json":
json, err := json.Marshal(envVars)
if err != nil {
return err
}
_, err = w.Write(json)
if err != nil {
return err
}
_, err = w.Write([]byte{'\n'})
if err != nil {
return err
}
return nil
case "yaml":
yaml, err := yaml.Marshal(envVars)
if err != nil {
return err
}
_, err = w.Write(yaml)
if err != nil {
return err
}
return nil
default:
exit.Message(reason.InternalOutputUsage, "error: --output must be 'text', 'yaml' or 'json'")
}
}
return shell.SetScript(ec.EnvConfig, w, dockerSetEnvTmpl, dockerShellCfgSet(ec, envVars))
}

// dockerSetScript writes out a shell-compatible 'docker-env unset' script
func dockerUnsetScript(ec DockerEnvConfig, w io.Writer) error {
vars := dockerEnvNames(ec)
if ec.Shell == "none" {
switch outputFormat {
case "":
// shell "none"
break
case "text":
for _, n := range vars {
_, err := fmt.Fprintf(w, "%s\n", n)
if err != nil {
return err
}
}
return nil
case "json":
json, err := json.Marshal(vars)
if err != nil {
return err
}
_, err = w.Write(json)
if err != nil {
return err
}
_, err = w.Write([]byte{'\n'})
if err != nil {
return err
}
return nil
case "yaml":
yaml, err := yaml.Marshal(vars)
if err != nil {
return err
}
_, err = w.Write(yaml)
if err != nil {
return err
}
return nil
default:
exit.Message(reason.InternalOutputUsage, "error: --output must be 'text', 'yaml' or 'json'")
}
}
return shell.UnsetScript(ec.EnvConfig, w, vars)
}

@@ -508,5 +592,6 @@ func init() {
dockerEnvCmd.Flags().BoolVar(&sshHost, "ssh-host", false, "Use SSH connection instead of HTTPS (port 2376)")
dockerEnvCmd.Flags().BoolVar(&sshAdd, "ssh-add", false, "Add SSH identity key to SSH authentication agent")
dockerEnvCmd.Flags().StringVar(&shell.ForceShell, "shell", "", "Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect")
dockerEnvCmd.Flags().StringVarP(&outputFormat, "output", "o", "", "One of 'text', 'yaml' or 'json'.")
dockerEnvCmd.Flags().BoolVarP(&dockerUnset, "unset", "u", false, "Unset variables instead of setting them")
}
Loading

0 comments on commit 615df84

Please sign in to comment.