Skip to content

Commit

Permalink
Merge pull request kubernetes#43999 from mikedanese/vers-fail
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

kubeadm: fail explicitly when using (stable,latest) in airgapped env

This is unintuitive and unnecessary behavior
  • Loading branch information
Kubernetes Submit Queue authored Apr 3, 2017
2 parents e28cb42 + 3c77465 commit 83249d3
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"
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 83249d3

Please sign in to comment.