Skip to content

Commit 17012aa

Browse files
committed
Merge branch 'master' into buildroot-2021.02.10
2 parents 5f07e15 + 75bf64a commit 17012aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+858
-340
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
- "!deploy/iso/**"
1313
env:
1414
GOPROXY: https://proxy.golang.org
15-
GO_VERSION: '1.18'
15+
GO_VERSION: '1.18.1'
1616
permissions:
1717
contents: read
1818

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- master
77
env:
88
GOPROXY: https://proxy.golang.org
9-
GO_VERSION: '1.18'
9+
GO_VERSION: '1.18.1'
1010
permissions:
1111
contents: read
1212

@@ -29,7 +29,7 @@ jobs:
2929
echo "::set-output name=changes::$c"
3030
- name: Create PR
3131
if: ${{ steps.gendocs.outputs.changes != '' }}
32-
uses: peter-evans/create-pull-request@f1a7646cead32c950d90344a4fb5d4e926972a8f
32+
uses: peter-evans/create-pull-request@bd72e1b7922d417764d27d30768117ad7da78a0e
3333
with:
3434
token: ${{ secrets.MINIKUBE_BOT_PAT }}
3535
commit-message: Update auto-generated docs and translations

.github/workflows/functional_verified.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ on:
2121
- deleted
2222
env:
2323
GOPROXY: https://proxy.golang.org
24-
GO_VERSION: '1.18'
24+
GO_VERSION: '1.18.1'
2525

2626
permissions:
2727
contents: read

.github/workflows/leaderboard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
release:
88
types: [published]
99
env:
10-
GO_VERSION: '1.18'
10+
GO_VERSION: '1.18.1'
1111
permissions:
1212
contents: read
1313

@@ -32,7 +32,7 @@ jobs:
3232
GITHUB_TOKEN: ${{ secrets.MINIKUBE_BOT_PAT }}
3333
- name: Create PR
3434
if: ${{ steps.leaderboard.outputs.changes != '' }}
35-
uses: peter-evans/create-pull-request@f1a7646cead32c950d90344a4fb5d4e926972a8f
35+
uses: peter-evans/create-pull-request@bd72e1b7922d417764d27d30768117ad7da78a0e
3636
with:
3737
token: ${{ secrets.MINIKUBE_BOT_PAT }}
3838
commit-message: Update leaderboard

.github/workflows/master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
- "!deploy/iso/**"
1515
env:
1616
GOPROXY: https://proxy.golang.org
17-
GO_VERSION: '1.18'
17+
GO_VERSION: '1.18.1'
1818
permissions:
1919
contents: read
2020

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
- "!deploy/iso/**"
1313
env:
1414
GOPROXY: https://proxy.golang.org
15-
GO_VERSION: '1.18'
15+
GO_VERSION: '1.18.1'
1616
permissions:
1717
contents: read
1818

.github/workflows/time-to-k8s-public-chart.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- cron: "0 2,14 * * *"
77
env:
88
GOPROXY: https://proxy.golang.org
9-
GO_VERSION: '1.18'
9+
GO_VERSION: '1.18.1'
1010
permissions:
1111
contents: read
1212

.github/workflows/time-to-k8s.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [released]
66
env:
77
GOPROXY: https://proxy.golang.org
8-
GO_VERSION: '1.18'
8+
GO_VERSION: '1.18.1'
99
permissions:
1010
contents: read
1111

@@ -26,7 +26,7 @@ jobs:
2626
./hack/benchmark/time-to-k8s/time-to-k8s.sh
2727
echo "::set-output name=version::$(minikube version --short)"
2828
- name: Create PR
29-
uses: peter-evans/create-pull-request@f1a7646cead32c950d90344a4fb5d4e926972a8f
29+
uses: peter-evans/create-pull-request@bd72e1b7922d417764d27d30768117ad7da78a0e
3030
with:
3131
token: ${{ secrets.MINIKUBE_BOT_PAT }}
3232
commit-message: add time-to-k8s benchmark for ${{ steps.timeToK8sBenchmark.outputs.version }}

.github/workflows/translations.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- "translations/**"
77
env:
88
GOPROXY: https://proxy.golang.org
9-
GO_VERSION: '1.18'
9+
GO_VERSION: '1.18.1'
1010
permissions:
1111
contents: read
1212

.github/workflows/update-golang-version.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- cron: "0 9 * * 1"
77
env:
88
GOPROXY: https://proxy.golang.org
9-
GO_VERSION: '1.18'
9+
GO_VERSION: '1.18.1'
1010
permissions:
1111
contents: read
1212

@@ -26,7 +26,7 @@ jobs:
2626
echo "::set-output name=changes::$(git status --porcelain)"
2727
- name: Create PR
2828
if: ${{ steps.bumpGolang.outputs.changes != '' }}
29-
uses: peter-evans/create-pull-request@f1a7646cead32c950d90344a4fb5d4e926972a8f
29+
uses: peter-evans/create-pull-request@bd72e1b7922d417764d27d30768117ad7da78a0e
3030
with:
3131
token: ${{ secrets.MINIKUBE_BOT_PAT }}
3232
commit-message: bump golang versions

.github/workflows/update-golint-version.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- cron: "0 10 * * 1"
77
env:
88
GOPROXY: https://proxy.golang.org
9-
GO_VERSION: '1.18'
9+
GO_VERSION: '1.18.1'
1010
permissions:
1111
contents: read
1212

@@ -26,7 +26,7 @@ jobs:
2626
echo "::set-output name=changes::$(git status --porcelain)"
2727
- name: Create PR
2828
if: ${{ steps.bumpGolint.outputs.changes != '' }}
29-
uses: peter-evans/create-pull-request@f1a7646cead32c950d90344a4fb5d4e926972a8f
29+
uses: peter-evans/create-pull-request@bd72e1b7922d417764d27d30768117ad7da78a0e
3030
with:
3131
token: ${{ secrets.MINIKUBE_BOT_PAT }}
3232
commit-message: bump golint versions

.github/workflows/update-k8s-versions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- cron: "0 8 * * 1"
77
env:
88
GOPROXY: https://proxy.golang.org
9-
GO_VERSION: '1.18'
9+
GO_VERSION: '1.18.1'
1010
permissions:
1111
contents: read
1212

@@ -31,7 +31,7 @@ jobs:
3131
echo "::set-output name=changes::$c"
3232
- name: Create PR
3333
if: ${{ steps.bumpk8s.outputs.changes != '' }}
34-
uses: peter-evans/create-pull-request@f1a7646cead32c950d90344a4fb5d4e926972a8f
34+
uses: peter-evans/create-pull-request@bd72e1b7922d417764d27d30768117ad7da78a0e
3535
with:
3636
token: ${{ secrets.MINIKUBE_BOT_PAT }}
3737
commit-message: bump default/newest kubernetes versions

.github/workflows/update-kubadm-constants.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- cron: "0 6 * * 1"
77
env:
88
GOPROXY: https://proxy.golang.org
9-
GO_VERSION: '1.18'
9+
GO_VERSION: '1.18.1'
1010
permissions:
1111
contents: read
1212

@@ -29,7 +29,7 @@ jobs:
2929
echo "::set-output name=changes::$c"
3030
- name: Create PR
3131
if: ${{ steps.bumpKubAdmConsts.outputs.changes != '' }}
32-
uses: peter-evans/create-pull-request@f1a7646cead32c950d90344a4fb5d4e926972a8f
32+
uses: peter-evans/create-pull-request@bd72e1b7922d417764d27d30768117ad7da78a0e
3333
with:
3434
token: ${{ secrets.MINIKUBE_BOT_PAT }}
3535
commit-message: update image constants for kubeadm images

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ KUBERNETES_VERSION ?= $(shell egrep "DefaultKubernetesVersion =" pkg/minikube/co
2323
KIC_VERSION ?= $(shell egrep "Version =" pkg/drivers/kic/types.go | cut -d \" -f2)
2424

2525
# Default to .0 for higher cache hit rates, as build increments typically don't require new ISO versions
26-
ISO_VERSION ?= v1.25.2-1648512003-13860
26+
ISO_VERSION ?= v1.25.2-1649577058-13659
2727
# Dashes are valid in semver, but not Linux packaging. Use ~ to delimit alpha/beta
2828
DEB_VERSION ?= $(subst -,~,$(RAW_VERSION))
2929
DEB_REVISION ?= 0
@@ -33,7 +33,7 @@ RPM_REVISION ?= 0
3333

3434
# used by hack/jenkins/release_build_and_upload.sh and KVM_BUILD_IMAGE, see also BUILD_IMAGE below
3535
# update this only by running `make update-golang-version`
36-
GO_VERSION ?= 1.18
36+
GO_VERSION ?= 1.18.1
3737
# update this only by running `make update-golang-version`
3838
GO_K8S_VERSION_PREFIX ?= v1.24.0
3939

cmd/minikube/cmd/cache.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ const allFlag = "all"
3838
// cacheCmd represents the cache command
3939
var cacheCmd = &cobra.Command{
4040
Use: "cache",
41-
Short: "Add, delete, or push a local image into minikube",
42-
Long: "Add, delete, or push a local image into minikube",
41+
Short: "Manage cache for images",
42+
Long: "Add an image into minikube as a local cache, or delete, reload the cached images",
4343
}
4444

4545
// addCacheCmd represents the cache add command

cmd/minikube/cmd/config/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ var settings = []Setting{
163163
name: "native-ssh",
164164
set: SetBool,
165165
},
166+
{
167+
name: config.Rootless,
168+
set: SetBool,
169+
},
166170
}
167171

168172
// ConfigCmd represents the config command

cmd/minikube/cmd/root.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ var RootCmd = &cobra.Command{
7272
out.WarningT("User name '{{.username}}' is not valid", out.V{"username": userName})
7373
exit.Message(reason.Usage, "User name must be 60 chars or less.")
7474
}
75+
// viper maps $MINIKUBE_ROOTLESS to "rootless" property automatically, but it does not do vice versa,
76+
// so we map "rootless" property to $MINIKUBE_ROOTLESS expliclity here.
77+
// $MINIKUBE_ROOTLESS is referred by KIC runner, which is decoupled from viper.
78+
if viper.GetBool(config.Rootless) {
79+
os.Setenv(constants.MinikubeRootlessEnv, "true")
80+
}
7581
},
7682
}
7783

@@ -206,6 +212,7 @@ func init() {
206212
RootCmd.PersistentFlags().StringP(config.ProfileName, "p", constants.DefaultClusterName, `The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently.`)
207213
RootCmd.PersistentFlags().StringP(configCmd.Bootstrapper, "b", "kubeadm", "The name of the cluster bootstrapper that will set up the Kubernetes cluster.")
208214
RootCmd.PersistentFlags().String(config.UserFlag, "", "Specifies the user executing the operation. Useful for auditing operations executed by 3rd party tools. Defaults to the operating system username.")
215+
RootCmd.PersistentFlags().Bool(config.Rootless, false, "Force to use rootless driver (docker and podman driver only)")
209216

210217
groups := templates.CommandGroups{
211218
{

cmd/minikube/cmd/start.go

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434

3535
"github.com/Delta456/box-cli-maker/v2"
3636
"github.com/blang/semver/v4"
37+
"github.com/docker/go-connections/nat"
3738
"github.com/docker/machine/libmachine/ssh"
3839
"github.com/google/go-containerregistry/pkg/authn"
3940
"github.com/google/go-containerregistry/pkg/name"
@@ -941,7 +942,7 @@ func validateUser(drvName string) {
941942
return
942943
}
943944

944-
out.ErrT(style.Stopped, `The "{{.driver_name}}" driver should not be used with root privileges.`, out.V{"driver_name": drvName})
945+
out.ErrT(style.Stopped, `The "{{.driver_name}}" driver should not be used with root privileges. If you wish to continue as root, use --force.`, out.V{"driver_name": drvName})
945946
out.ErrT(style.Tip, "If you are running minikube within a VM, consider using --driver=none:")
946947
out.ErrT(style.Documentation, " {{.url}}", out.V{"url": "https://minikube.sigs.k8s.io/docs/reference/drivers/none/"})
947948

@@ -1246,26 +1247,22 @@ func validateFlags(cmd *cobra.Command, drvName string) {
12461247
validateInsecureRegistry()
12471248
}
12481249

1249-
// This function validates that the --ports are not below 1024 for the host and not outside range
1250+
// validatePorts validates that the --ports are not below 1024 for the host and not outside range
12501251
func validatePorts(ports []string) error {
1251-
for _, portDuplet := range ports {
1252-
parts := strings.Split(portDuplet, ":")
1253-
if len(parts) > 2 {
1254-
ip := parts[0]
1255-
if net.ParseIP(ip) == nil {
1256-
return errors.Errorf("Sorry, the IP address provided with --ports flag is invalid: %s", ip)
1257-
}
1258-
parts = parts[1:]
1259-
}
1260-
for i, port := range parts {
1261-
p, err := strconv.Atoi(port)
1252+
_, portBindingsMap, err := nat.ParsePortSpecs(ports)
1253+
if err != nil {
1254+
return errors.Errorf("Sorry, one of the ports provided with --ports flag is not valid %s (%v)", ports, err)
1255+
}
1256+
for _, portBindings := range portBindingsMap {
1257+
for _, portBinding := range portBindings {
1258+
p, err := strconv.Atoi(portBinding.HostPort)
12621259
if err != nil {
12631260
return errors.Errorf("Sorry, one of the ports provided with --ports flag is not valid %s", ports)
12641261
}
12651262
if p > 65535 || p < 1 {
12661263
return errors.Errorf("Sorry, one of the ports provided with --ports flag is outside range %s", ports)
12671264
}
1268-
if detect.IsMicrosoftWSL() && p < 1024 && i == 0 {
1265+
if detect.IsMicrosoftWSL() && p < 1024 {
12691266
return errors.Errorf("Sorry, you cannot use privileged ports on the host (below 1024) %s", ports)
12701267
}
12711268
}

cmd/minikube/cmd/start_flags.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,12 +555,22 @@ func generateNewConfigFromFlags(cmd *cobra.Command, k8sVersion string, rtime str
555555
exit.Message(reason.Usage, "Ensure your {{.driver_name}} is running and is healthy.", out.V{"driver_name": driver.FullName(drvName)})
556556
}
557557
if si.Rootless {
558+
out.Styled(style.Notice, "Using rootless {{.driver_name}} driver", out.V{"driver_name": driver.FullName(drvName)})
558559
if cc.KubernetesConfig.ContainerRuntime == constants.Docker {
559560
exit.Message(reason.Usage, "--container-runtime must be set to \"containerd\" or \"cri-o\" for rootless")
560561
}
561562
// KubeletInUserNamespace feature gate is essential for rootless driver.
562563
// See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-in-userns/
563564
cc.KubernetesConfig.FeatureGates = addFeatureGate(cc.KubernetesConfig.FeatureGates, "KubeletInUserNamespace=true")
565+
} else {
566+
if oci.IsRootlessForced() {
567+
if driver.IsDocker(drvName) {
568+
exit.Message(reason.Usage, "Using rootless Docker driver was required, but the current Docker does not seem rootless. Try 'docker context use rootless' .")
569+
} else {
570+
exit.Message(reason.Usage, "Using rootless driver was required, but the current driver does not seem rootless")
571+
}
572+
}
573+
out.Styled(style.Notice, "Using {{.driver_name}} driver with the root privilege", out.V{"driver_name": driver.FullName(drvName)})
564574
}
565575
if si.StorageDriver == "btrfs" {
566576
klog.Info("auto-setting LocalStorageCapacityIsolation to false because using btrfs storage driver")

0 commit comments

Comments
 (0)