Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Kubernetes 1.11 builds #2943

Merged
merged 4 commits into from
Jul 4, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pkg/minikube/bootstrapper/kubeadm/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ sudo /usr/bin/kubeadm alpha phase controlplane all --config {{.KubeadmConfigFile
sudo /usr/bin/kubeadm alpha phase etcd local --config {{.KubeadmConfigFile}}
`))

var kubeadmInitTemplate = template.Must(template.New("kubeadmInitTemplate").Parse(
"sudo /usr/bin/kubeadm init --config {{.KubeadmConfigFile}} {{if .SkipPreflightChecks}}--skip-preflight-checks{{else}}{{range .Preflights}}--ignore-preflight-errors={{.}} {{end}}{{end}}"))
var kubeadmInitTemplate = template.Must(template.New("kubeadmInitTemplate").Parse(`
sudo /usr/bin/kubeadm init --config {{.KubeadmConfigFile}} {{if .SkipPreflightChecks}}--skip-preflight-checks{{else}}{{range .Preflights}}--ignore-preflight-errors={{.}} {{end}}{{end}} &&
sudo /usr/bin/kubeadm alpha phase addon all
`))

// printMapInOrder sorts the keys and prints the map in order, combining key
// value pairs with the separator character
Expand Down
9 changes: 9 additions & 0 deletions pkg/minikube/bootstrapper/kubeadm/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,17 @@ var versionSpecificOpts = []VersionedExtraOption{
Key: "admission-control",
Value: strings.Join(util.DefaultAdmissionControllers, ","),
},
LessThanOrEqual: semver.MustParse("1.10.10"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this break when there's a 1.10.11 ? Does semver.MustParse("1.10.*") not work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The semver library doesn't support *'s :(

panic: semver: Parse(1.10.*): Invalid character(s) found in patch number "*"

I'll change to something like 1000

GreaterThanOrEqual: semver.MustParse("1.9.0-alpha.0"),
},
{
Option: util.ExtraOption{
Component: Apiserver,
Key: "enable-admission-plugins",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary? I got a working cluster with just removing the admission-control line from /var/lib/kubeadm.yaml, so the rest of the default manifest was fine without needing any more overrides.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not necessary, but we pass some different defaults than kubeadm.

Value: strings.Join(util.DefaultAdmissionControllers, ","),
},
GreaterThanOrEqual: semver.MustParse("1.11.0-alpha.0"),
},
}

func VersionIsBetween(version, gte, lte semver.Version) bool {
Expand Down