Skip to content

Commit

Permalink
Merge pull request #3 from wbuchwalter/enable-k8v1.6-multiplegpu
Browse files Browse the repository at this point in the history
Parametrize kubernetes version checking function
  • Loading branch information
ritazh authored May 25, 2017
2 parents 78ad83b + 49278b9 commit a34ecfa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion parts/kubernetesagentcustomdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ write_files:
KUBELET_REGISTER_SCHEDULABLE=true
KUBELET_NODE_LABELS=role=agent
KUBELET_POD_INFRA_CONTAINER_IMAGE={{WrapAsVariable "kubernetesPodInfraContainerSpec"}}
{{if IsKubernetesGte16}}
{{if IsKubernetesVersionGe "1.6.0"}}
KUBELET_FEATURE_GATES=--feature-gates=Accelerators=true
{{end}}

Expand Down
7 changes: 4 additions & 3 deletions pkg/acsengine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,12 @@ func (t *TemplateGenerator) getTemplateFuncMap(cs *api.ContainerService) map[str
return cs.Properties.OrchestratorProfile.OrchestratorType == api.DCOS &&
cs.Properties.OrchestratorProfile.OrchestratorVersion == api.DCOS190
},
"IsKubernetesGte16": func() bool {
"IsKubernetesVersionGe": func(version string) bool {
targetVersion := api.OrchestratorVersion(version)
targetVersionOrdinal := VersionOrdinal(targetVersion)
orchestratorVersionOrdinal := VersionOrdinal(cs.Properties.OrchestratorProfile.OrchestratorVersion)
kubernetes16VersionOrdinal := VersionOrdinal(api.Kubernetes160)
return cs.Properties.OrchestratorProfile.OrchestratorType == api.Kubernetes &&
orchestratorVersionOrdinal >= kubernetes16VersionOrdinal
orchestratorVersionOrdinal >= targetVersionOrdinal
},
"RequiresFakeAgentOutput": func() bool {
return cs.Properties.OrchestratorProfile.OrchestratorType == api.Kubernetes
Expand Down
2 changes: 1 addition & 1 deletion pkg/acsengine/templates.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a34ecfa

Please sign in to comment.