-
Notifications
You must be signed in to change notification settings - Fork 519
feat: Support Non-Azure Stack Custom Clouds with custom endpoints/root certs/sources.list #3063
feat: Support Non-Azure Stack Custom Clouds with custom endpoints/root certs/sources.list #3063
Conversation
pkg/api/types.go
Outdated
@@ -2071,13 +2094,14 @@ func (p *Properties) GetKubernetesHyperkubeSpec() string { | |||
|
|||
// IsAzureStackCloud return true if the cloud is AzureStack | |||
func (p *Properties) IsAzureStackCloud() bool { | |||
return p.CustomCloudProfile != nil | |||
// For backward compatibility, treat nil Environment and empty Environment name as AzureStackCloud as well | |||
return p.CustomCloudProfile != nil && (p.CustomCloudProfile.Environment == nil || p.CustomCloudProfile.Environment.Name == "" || strings.EqualFold(p.CustomCloudProfile.Environment.Name, "AzureStackCloud")) |
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.
nit:
return p.IsCustomCloudProfile() instead of copying the p.CustomCloudProfile != nil
implementation from the IsCustomCloudProfile
method (i.e., let's just re-use the method)
@jadarsie do we want the p.CustomCloudProfile.Environment == nil
back-compat foo for AzureStackCloud? It would be nice to have IsAzureStackCloud
actually require that the Environment.Name
string property be equal to "AzureStackCloud"
.
pkg/api/vlabs/types.go
Outdated
// IsAzureStackCloud return true if the cloud is AzureStack | ||
func (p *Properties) IsAzureStackCloud() bool { | ||
return p.CustomCloudProfile != nil | ||
// For backward compatibility, treat nil Environment and empty Environment name as AzureStackCloud as well | ||
return p.CustomCloudProfile != nil && (p.CustomCloudProfile.Environment == nil || p.CustomCloudProfile.Environment.Name == "" || strings.EqualFold(p.CustomCloudProfile.Environment.Name, "AzureStackCloud")) |
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.
same comments/questions in api/types.go as well
/azp run pr-e2e |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run pr-e2e |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run pr-e2e |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run pr-e2e |
Azure Pipelines successfully started running 1 pipeline(s). |
Codecov Report
@@ Coverage Diff @@
## master #3063 +/- ##
==========================================
+ Coverage 70.58% 70.85% +0.26%
==========================================
Files 145 145
Lines 25219 25274 +55
==========================================
+ Hits 17802 17907 +105
+ Misses 6312 6251 -61
- Partials 1105 1116 +11
Continue to review full report at Codecov.
|
553609e
to
992835c
Compare
/azp run pr-e2e |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
lgtm
@jadarsie for approval as well
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.
So far so good, let me run e2e against Azure Stack
/azp run pr-e2e |
Azure Pipelines successfully started running 1 pipeline(s). |
e689d48
to
1d74e95
Compare
/azp run pr-e2e |
Azure Pipelines successfully started running 1 pipeline(s). |
/lgtm |
…t certs/sources.list (Azure#3063)
…t certs/sources.list (Azure#3063)
Reason for Change:
Currently, when CustomCloudProfile is specified, aks-engine treats it as Azure Stack and executes many Azure Stack-specific logic (i.e. loading azure stack specific image, setting lower arm api versions, disabling instance metadata, etc).
This makes impossible for users to specify custom cloud endpoints without triggering Azure Stack specific logic.
This PR decouples Azure Stack logic from Custom Cloud logic by introducing an internally computed property "IsCustomCloudProfile".
The main idea is to use “IsAzureStackCloud” property for doing any Azure Stack specific works, and use “IsCustomCloudProfile” property for generating actual azure.json and azurestackcloud.json files in VMs in the end.
I also added following two additional fields to support specifying custom root certificates and sources.list:
Sample customCloudProfile section:
Produces azure.json:
and produces azurestackcloud.json:
Requirements:
Notes: