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

Commit

Permalink
added kubernetes version validation for managed clusters (#2194)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitsh authored and jackfrancis committed Feb 3, 2018
1 parent 714fe06 commit ca81ded
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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

0 comments on commit ca81ded

Please sign in to comment.