Skip to content

Commit

Permalink
Merge branch 'master' into buildroot-2021.02.10
Browse files Browse the repository at this point in the history
  • Loading branch information
afbjorklund committed Apr 19, 2022
2 parents 5f07e15 + 75bf64a commit 17012aa
Show file tree
Hide file tree
Showing 82 changed files with 858 additions and 340 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- "!deploy/iso/**"
env:
GOPROXY: https://proxy.golang.org
GO_VERSION: '1.18'
GO_VERSION: '1.18.1'
permissions:
contents: read

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- master
env:
GOPROXY: https://proxy.golang.org
GO_VERSION: '1.18'
GO_VERSION: '1.18.1'
permissions:
contents: read

Expand All @@ -29,7 +29,7 @@ jobs:
echo "::set-output name=changes::$c"
- name: Create PR
if: ${{ steps.gendocs.outputs.changes != '' }}
uses: peter-evans/create-pull-request@f1a7646cead32c950d90344a4fb5d4e926972a8f
uses: peter-evans/create-pull-request@bd72e1b7922d417764d27d30768117ad7da78a0e
with:
token: ${{ secrets.MINIKUBE_BOT_PAT }}
commit-message: Update auto-generated docs and translations
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/functional_verified.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
- deleted
env:
GOPROXY: https://proxy.golang.org
GO_VERSION: '1.18'
GO_VERSION: '1.18.1'

permissions:
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/leaderboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
release:
types: [published]
env:
GO_VERSION: '1.18'
GO_VERSION: '1.18.1'
permissions:
contents: read

Expand All @@ -32,7 +32,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.MINIKUBE_BOT_PAT }}
- name: Create PR
if: ${{ steps.leaderboard.outputs.changes != '' }}
uses: peter-evans/create-pull-request@f1a7646cead32c950d90344a4fb5d4e926972a8f
uses: peter-evans/create-pull-request@bd72e1b7922d417764d27d30768117ad7da78a0e
with:
token: ${{ secrets.MINIKUBE_BOT_PAT }}
commit-message: Update leaderboard
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
- "!deploy/iso/**"
env:
GOPROXY: https://proxy.golang.org
GO_VERSION: '1.18'
GO_VERSION: '1.18.1'
permissions:
contents: read

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- "!deploy/iso/**"
env:
GOPROXY: https://proxy.golang.org
GO_VERSION: '1.18'
GO_VERSION: '1.18.1'
permissions:
contents: read

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/time-to-k8s-public-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: "0 2,14 * * *"
env:
GOPROXY: https://proxy.golang.org
GO_VERSION: '1.18'
GO_VERSION: '1.18.1'
permissions:
contents: read

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/time-to-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [released]
env:
GOPROXY: https://proxy.golang.org
GO_VERSION: '1.18'
GO_VERSION: '1.18.1'
permissions:
contents: read

Expand All @@ -26,7 +26,7 @@ jobs:
./hack/benchmark/time-to-k8s/time-to-k8s.sh
echo "::set-output name=version::$(minikube version --short)"
- name: Create PR
uses: peter-evans/create-pull-request@f1a7646cead32c950d90344a4fb5d4e926972a8f
uses: peter-evans/create-pull-request@bd72e1b7922d417764d27d30768117ad7da78a0e
with:
token: ${{ secrets.MINIKUBE_BOT_PAT }}
commit-message: add time-to-k8s benchmark for ${{ steps.timeToK8sBenchmark.outputs.version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "translations/**"
env:
GOPROXY: https://proxy.golang.org
GO_VERSION: '1.18'
GO_VERSION: '1.18.1'
permissions:
contents: read

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-golang-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: "0 9 * * 1"
env:
GOPROXY: https://proxy.golang.org
GO_VERSION: '1.18'
GO_VERSION: '1.18.1'
permissions:
contents: read

Expand All @@ -26,7 +26,7 @@ jobs:
echo "::set-output name=changes::$(git status --porcelain)"
- name: Create PR
if: ${{ steps.bumpGolang.outputs.changes != '' }}
uses: peter-evans/create-pull-request@f1a7646cead32c950d90344a4fb5d4e926972a8f
uses: peter-evans/create-pull-request@bd72e1b7922d417764d27d30768117ad7da78a0e
with:
token: ${{ secrets.MINIKUBE_BOT_PAT }}
commit-message: bump golang versions
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-golint-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: "0 10 * * 1"
env:
GOPROXY: https://proxy.golang.org
GO_VERSION: '1.18'
GO_VERSION: '1.18.1'
permissions:
contents: read

Expand All @@ -26,7 +26,7 @@ jobs:
echo "::set-output name=changes::$(git status --porcelain)"
- name: Create PR
if: ${{ steps.bumpGolint.outputs.changes != '' }}
uses: peter-evans/create-pull-request@f1a7646cead32c950d90344a4fb5d4e926972a8f
uses: peter-evans/create-pull-request@bd72e1b7922d417764d27d30768117ad7da78a0e
with:
token: ${{ secrets.MINIKUBE_BOT_PAT }}
commit-message: bump golint versions
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-k8s-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: "0 8 * * 1"
env:
GOPROXY: https://proxy.golang.org
GO_VERSION: '1.18'
GO_VERSION: '1.18.1'
permissions:
contents: read

Expand All @@ -31,7 +31,7 @@ jobs:
echo "::set-output name=changes::$c"
- name: Create PR
if: ${{ steps.bumpk8s.outputs.changes != '' }}
uses: peter-evans/create-pull-request@f1a7646cead32c950d90344a4fb5d4e926972a8f
uses: peter-evans/create-pull-request@bd72e1b7922d417764d27d30768117ad7da78a0e
with:
token: ${{ secrets.MINIKUBE_BOT_PAT }}
commit-message: bump default/newest kubernetes versions
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-kubadm-constants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: "0 6 * * 1"
env:
GOPROXY: https://proxy.golang.org
GO_VERSION: '1.18'
GO_VERSION: '1.18.1'
permissions:
contents: read

Expand All @@ -29,7 +29,7 @@ jobs:
echo "::set-output name=changes::$c"
- name: Create PR
if: ${{ steps.bumpKubAdmConsts.outputs.changes != '' }}
uses: peter-evans/create-pull-request@f1a7646cead32c950d90344a4fb5d4e926972a8f
uses: peter-evans/create-pull-request@bd72e1b7922d417764d27d30768117ad7da78a0e
with:
token: ${{ secrets.MINIKUBE_BOT_PAT }}
commit-message: update image constants for kubeadm images
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.25.2-1648512003-13860
ISO_VERSION ?= v1.25.2-1649577058-13659
# Dashes are valid in semver, but not Linux packaging. Use ~ to delimit alpha/beta
DEB_VERSION ?= $(subst -,~,$(RAW_VERSION))
DEB_REVISION ?= 0
Expand All @@ -33,7 +33,7 @@ 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.18
GO_VERSION ?= 1.18.1
# update this only by running `make update-golang-version`
GO_K8S_VERSION_PREFIX ?= v1.24.0

Expand Down
4 changes: 2 additions & 2 deletions cmd/minikube/cmd/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ const allFlag = "all"
// cacheCmd represents the cache command
var cacheCmd = &cobra.Command{
Use: "cache",
Short: "Add, delete, or push a local image into minikube",
Long: "Add, delete, or push a local image into minikube",
Short: "Manage cache for images",
Long: "Add an image into minikube as a local cache, or delete, reload the cached images",
}

// addCacheCmd represents the cache add command
Expand Down
4 changes: 4 additions & 0 deletions cmd/minikube/cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ var settings = []Setting{
name: "native-ssh",
set: SetBool,
},
{
name: config.Rootless,
set: SetBool,
},
}

// ConfigCmd represents the config command
Expand Down
7 changes: 7 additions & 0 deletions cmd/minikube/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ var RootCmd = &cobra.Command{
out.WarningT("User name '{{.username}}' is not valid", out.V{"username": userName})
exit.Message(reason.Usage, "User name must be 60 chars or less.")
}
// viper maps $MINIKUBE_ROOTLESS to "rootless" property automatically, but it does not do vice versa,
// so we map "rootless" property to $MINIKUBE_ROOTLESS expliclity here.
// $MINIKUBE_ROOTLESS is referred by KIC runner, which is decoupled from viper.
if viper.GetBool(config.Rootless) {
os.Setenv(constants.MinikubeRootlessEnv, "true")
}
},
}

Expand Down Expand Up @@ -206,6 +212,7 @@ func init() {
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.`)
RootCmd.PersistentFlags().StringP(configCmd.Bootstrapper, "b", "kubeadm", "The name of the cluster bootstrapper that will set up the Kubernetes cluster.")
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.")
RootCmd.PersistentFlags().Bool(config.Rootless, false, "Force to use rootless driver (docker and podman driver only)")

groups := templates.CommandGroups{
{
Expand Down
25 changes: 11 additions & 14 deletions cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (

"github.com/Delta456/box-cli-maker/v2"
"github.com/blang/semver/v4"
"github.com/docker/go-connections/nat"
"github.com/docker/machine/libmachine/ssh"
"github.com/google/go-containerregistry/pkg/authn"
"github.com/google/go-containerregistry/pkg/name"
Expand Down Expand Up @@ -941,7 +942,7 @@ func validateUser(drvName string) {
return
}

out.ErrT(style.Stopped, `The "{{.driver_name}}" driver should not be used with root privileges.`, out.V{"driver_name": drvName})
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})
out.ErrT(style.Tip, "If you are running minikube within a VM, consider using --driver=none:")
out.ErrT(style.Documentation, " {{.url}}", out.V{"url": "https://minikube.sigs.k8s.io/docs/reference/drivers/none/"})

Expand Down Expand Up @@ -1246,26 +1247,22 @@ func validateFlags(cmd *cobra.Command, drvName string) {
validateInsecureRegistry()
}

// This function validates that the --ports are not below 1024 for the host and not outside range
// validatePorts validates that the --ports are not below 1024 for the host and not outside range
func validatePorts(ports []string) error {
for _, portDuplet := range ports {
parts := strings.Split(portDuplet, ":")
if len(parts) > 2 {
ip := parts[0]
if net.ParseIP(ip) == nil {
return errors.Errorf("Sorry, the IP address provided with --ports flag is invalid: %s", ip)
}
parts = parts[1:]
}
for i, port := range parts {
p, err := strconv.Atoi(port)
_, portBindingsMap, err := nat.ParsePortSpecs(ports)
if err != nil {
return errors.Errorf("Sorry, one of the ports provided with --ports flag is not valid %s (%v)", ports, err)
}
for _, portBindings := range portBindingsMap {
for _, portBinding := range portBindings {
p, err := strconv.Atoi(portBinding.HostPort)
if err != nil {
return errors.Errorf("Sorry, one of the ports provided with --ports flag is not valid %s", ports)
}
if p > 65535 || p < 1 {
return errors.Errorf("Sorry, one of the ports provided with --ports flag is outside range %s", ports)
}
if detect.IsMicrosoftWSL() && p < 1024 && i == 0 {
if detect.IsMicrosoftWSL() && p < 1024 {
return errors.Errorf("Sorry, you cannot use privileged ports on the host (below 1024) %s", ports)
}
}
Expand Down
10 changes: 10 additions & 0 deletions cmd/minikube/cmd/start_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -555,12 +555,22 @@ func generateNewConfigFromFlags(cmd *cobra.Command, k8sVersion string, rtime str
exit.Message(reason.Usage, "Ensure your {{.driver_name}} is running and is healthy.", out.V{"driver_name": driver.FullName(drvName)})
}
if si.Rootless {
out.Styled(style.Notice, "Using rootless {{.driver_name}} driver", out.V{"driver_name": driver.FullName(drvName)})
if cc.KubernetesConfig.ContainerRuntime == constants.Docker {
exit.Message(reason.Usage, "--container-runtime must be set to \"containerd\" or \"cri-o\" for rootless")
}
// KubeletInUserNamespace feature gate is essential for rootless driver.
// See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-in-userns/
cc.KubernetesConfig.FeatureGates = addFeatureGate(cc.KubernetesConfig.FeatureGates, "KubeletInUserNamespace=true")
} else {
if oci.IsRootlessForced() {
if driver.IsDocker(drvName) {
exit.Message(reason.Usage, "Using rootless Docker driver was required, but the current Docker does not seem rootless. Try 'docker context use rootless' .")
} else {
exit.Message(reason.Usage, "Using rootless driver was required, but the current driver does not seem rootless")
}
}
out.Styled(style.Notice, "Using {{.driver_name}} driver with the root privilege", out.V{"driver_name": driver.FullName(drvName)})
}
if si.StorageDriver == "btrfs" {
klog.Info("auto-setting LocalStorageCapacityIsolation to false because using btrfs storage driver")
Expand Down

0 comments on commit 17012aa

Please sign in to comment.