Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

added kubernetes version validation for managed clusters #2194

Merged
merged 1 commit into from
Feb 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions pkg/acsengine/testdata/agentPoolOnly/v20170831/agents.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"properties": {
"dnsPrefix": "agents006",
"fqdn": "agents006.azmk8s.io",
"kubernetesRelease": "1.7",
"kubernetesVersion": "1.7.10",
"agentPoolProfiles": [
{
"name": "agentpool1",
Expand All @@ -26,4 +26,4 @@
"secret": "myServicePrincipalClientSecret"
}
}
}
}
5 changes: 5 additions & 0 deletions pkg/api/apiloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/Azure/acs-engine/pkg/api/agentPoolOnlyApi/v20170831"
apvlabs "github.com/Azure/acs-engine/pkg/api/agentPoolOnlyApi/vlabs"
"github.com/Azure/acs-engine/pkg/api/common"
"github.com/Azure/acs-engine/pkg/api/v20160330"
"github.com/Azure/acs-engine/pkg/api/v20160930"
"github.com/Azure/acs-engine/pkg/api/v20170131"
Expand Down Expand Up @@ -190,6 +191,10 @@ func (a *Apiloader) LoadContainerServiceForAgentPoolOnlyCluster(contents []byte,
if e := json.Unmarshal(contents, &managedCluster); e != nil {
return nil, e
}
// verify orchestrator version
if !common.AllKubernetesSupportedVersions[managedCluster.Properties.KubernetesVersion] {
return nil, a.Translator.Errorf("The selected orchestrator version '%s' is not supported", managedCluster.Properties.KubernetesVersion)
}
if e := managedCluster.Properties.Validate(); validate && e != nil {
return nil, e
}
Expand Down