Skip to content

Commit

Permalink
Merge pull request kubernetes#44106 from mikedanese/automated-cherry-…
Browse files Browse the repository at this point in the history
…pick-of-#43999-kubernetes#44101-release-1.6

Automatic merge from submit-queue

Automated cherry pick of kubernetes#43999 kubernetes#44101 release 1.6

Automated cherry pick of kubernetes#43999 kubernetes#44101 release 1.6

```release-note
kubeadm: Remove hard-coded default version when fetching stable version from the web fails. Fixes [kubeadm 1.6.1 deploying 1.6.0 control plane](kubernetes/kubeadm#224).
```
  • Loading branch information
Kubernetes Submit Queue authored Apr 5, 2017
2 parents a887f67 + 50317e4 commit 0d33348
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
16 changes: 7 additions & 9 deletions cmd/kubeadm/app/apis/kubeadm/v1alpha1/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ import (
const (
DefaultServiceDNSDomain = "cluster.local"
DefaultServicesSubnet = "10.96.0.0/12"
DefaultKubernetesVersion = "latest-1.6"
// This is only for clusters without internet, were the latest stable version can't be determined
DefaultKubernetesFallbackVersion = "v1.6.0"
DefaultAPIBindPort = 6443
DefaultDiscoveryBindPort = 9898
DefaultAuthorizationMode = "RBAC"
DefaultCACertPath = "/etc/kubernetes/pki/ca.crt"
DefaultCertificatesDir = "/etc/kubernetes/pki"
DefaultKubernetesVersion = "stable-1.6"
DefaultAPIBindPort = 6443
DefaultDiscoveryBindPort = 9898
DefaultAuthorizationMode = "RBAC"
DefaultCACertPath = "/etc/kubernetes/pki/ca.crt"
DefaultCertificatesDir = "/etc/kubernetes/pki"
)

func addDefaultingFuncs(scheme *runtime.Scheme) error {
Expand All @@ -46,7 +44,7 @@ func addDefaultingFuncs(scheme *runtime.Scheme) error {

func SetDefaults_MasterConfiguration(obj *MasterConfiguration) {
if obj.KubernetesVersion == "" {
obj.KubernetesVersion = DefaultKubernetesFallbackVersion
obj.KubernetesVersion = DefaultKubernetesVersion
}

if obj.API.BindPort == 0 {
Expand Down
7 changes: 1 addition & 6 deletions cmd/kubeadm/app/cmd/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (

netutil "k8s.io/apimachinery/pkg/util/net"
kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
kubeadmapiext "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1alpha1"
kubeadmconstants "k8s.io/kubernetes/cmd/kubeadm/app/constants"
kubeadmutil "k8s.io/kubernetes/cmd/kubeadm/app/util"
tokenutil "k8s.io/kubernetes/cmd/kubeadm/app/util/token"
Expand All @@ -45,11 +44,7 @@ func setInitDynamicDefaults(cfg *kubeadmapi.MasterConfiguration) error {
// Validate version argument
ver, err := kubeadmutil.KubernetesReleaseVersion(cfg.KubernetesVersion)
if err != nil {
if cfg.KubernetesVersion != kubeadmapiext.DefaultKubernetesVersion {
return err
} else {
ver = kubeadmapiext.DefaultKubernetesFallbackVersion
}
return err
}
cfg.KubernetesVersion = ver

Expand Down

0 comments on commit 0d33348

Please sign in to comment.