This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 558
GetSupportedVersion returns the right win default #3079
Merged
CecileRobertMichon
merged 7 commits into
Azure:master
from
CecileRobertMichon:k8s-win-version-hotfix
May 29, 2018
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d9a3b54
GetSupportedVersion returns the right win default
2a28c39
unit tests
916e621
fix unit test
7964f17
fixed validation with windows pools
6140f62
fix lint
3d8c866
Fix bug not validatinf first agent
1b0af6d
check for empty version
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"apiVersion": "2017-01-31", | ||
"properties": { | ||
"orchestratorProfile": { | ||
"orchestratorType": "Kubernetes" | ||
}, | ||
"masterProfile": { | ||
"count": 1, | ||
"dnsPrefix": "masterdns1" | ||
}, | ||
"agentPoolProfiles": [ | ||
{ | ||
"name": "agentpool1", | ||
"count": 3, | ||
"vmSize": "Standard_D2_v2" | ||
}, | ||
{ | ||
"name": "agentpool2", | ||
"count": 3, | ||
"vmSize": "Standard_D2_v2", | ||
"osType": "Windows" | ||
} | ||
], | ||
"windowsProfile": { | ||
"adminUsername": "azureuser", | ||
"adminPassword": "replacepassword1234$" | ||
}, | ||
"linuxProfile": { | ||
"adminUsername": "azureuser", | ||
"ssh": { | ||
"publicKeys": [ | ||
{ | ||
"keyData": "ssh-rsa PUBLICKEY azureuser@linuxvm" | ||
} | ||
] | ||
} | ||
}, | ||
"servicePrincipalProfile": { | ||
"clientId": "ServicePrincipalClientID", | ||
"secret": "myServicePrincipalClientSecret" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
pkg/acsengine/testdata/v20170701/kubernetes-win-default-version.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"apiVersion": "2017-07-01", | ||
"properties": { | ||
"orchestratorProfile": { | ||
"orchestratorType": "Kubernetes" | ||
}, | ||
"masterProfile": { | ||
"count": 1, | ||
"dnsPrefix": "masterdns1", | ||
"OSDiskSizeGB": 200, | ||
"vmSize": "Standard_D2_v2" | ||
}, | ||
"agentPoolProfiles": [ | ||
{ | ||
"name": "agentpool1", | ||
"count": 1, | ||
"vmSize": "Standard_D2_v2", | ||
"OSDiskSizeGB": 200, | ||
"availabilityProfile": "AvailabilitySet" | ||
}, | ||
{ | ||
"name": "agentpool2", | ||
"count": 1, | ||
"vmSize": "Standard_D3_v2", | ||
"availabilityProfile": "AvailabilitySet", | ||
"osType": "Windows" | ||
} | ||
], | ||
"windowsProfile": { | ||
"adminUsername": "azureuser", | ||
"adminPassword": "replacepassword1234$" | ||
}, | ||
"linuxProfile": { | ||
"adminUsername": "azureuser", | ||
"ssh": { | ||
"publicKeys": [ | ||
{ | ||
"keyData": "ssh-rsa PUBLICKEY azureuser@linuxvm" | ||
} | ||
] | ||
} | ||
}, | ||
"servicePrincipalProfile": { | ||
"clientId": "ServicePrincipalClientID", | ||
"secret": "myServicePrincipalClientSecret" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we shouldn't silently override. If a value is passed in we should throw an error if invalid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would tend to agree with you but this PR is intended to fix the bug, not change the behavior of default k8s version definition... The silent override was already in place for getting the k8s version for API version
v20170701
so I don't think we want to change the behavior in this PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does validation happen before this so we don't have to worry about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do validate beforehand. So if I pass in something random as
orchestratorVersion
such as0.5
I getFATA[0000] error loading API model in generateCmd: error parsing the api model: OrchestratorProfile has unknown orchestrator version: 0.5
The only case where this function overrides the version is if it is empty or if the cluster is a Windows cluster and the passed in version is valid but not supported for Windows, in which case the user gets default. I looked into fixing validation to also take into account "is this a Windows cluster? If so, is the passed in version valid for Windows?" but it's not straight forward since it requires having the agent pool profiles. I can make that an additional change in this PR if we see value in it.
TLDR: Is it okay to override the version if the value passed in for the user is not supported with windows but is a valid version or should we fail instead?