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
Extracting property values to make ARM output variables accessible #3877
Merged
Merged
Changes from 15 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
9013de5
Extracting property values to make ARM output variables accessible
41c5e03
Merge branch 'umaster' into extract_output_params
10d5b53
Merge branch 'umaster' into extract_output_params
30f8bf2
Fixing lint issues
dd66774
Adding test cases
1e6333f
Merge branch 'umaster' into extract_output_params
5725385
Fixing review comments
e58d5e6
Merge remote-tracking branch 'origin/extract_output_params' into extr…
676ce9b
Add new struct type to hold the extracted ARM output params
88b4008
Merge branch 'master' of https://github.com/Azure/acs-engine into ext…
c471d1d
Adding VirtualNetworkName and VNetResourceGroupName to ClusterMetadata
d0a3327
Merge branch 'master' into extract_output_params
3d01a31
Merge branch 'master' of https://github.com/Azure/acs-engine into ext…
eb67cfc
Added more test cases to increase coverage
c521880
fixing vmPrefix bug
a20b0a8
Merge branch 'master' of https://github.com/Azure/acs-engine into ext…
81ed3b6
Fixing review comments
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
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
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 |
---|---|---|
|
@@ -206,7 +206,7 @@ func (t *TemplateGenerator) getTemplateFuncMap(cs *api.ContainerService) templat | |
return cs.Properties.MasterProfile != nil && cs.Properties.MasterProfile.IsVirtualMachineScaleSets() | ||
}, | ||
"IsHostedMaster": func() bool { | ||
return cs.Properties.HostedMasterProfile != nil | ||
return cs.Properties.IsHostedMasterProfile() | ||
}, | ||
"IsDCOS19": func() bool { | ||
return cs.Properties.OrchestratorProfile.OrchestratorType == api.DCOS && | ||
|
@@ -395,7 +395,7 @@ func (t *TemplateGenerator) getTemplateFuncMap(cs *api.ContainerService) templat | |
return getSecurityRules(ports) | ||
}, | ||
"GetUniqueNameSuffix": func() string { | ||
return GenerateClusterID(cs.Properties) | ||
return cs.Properties.GenerateClusterID() | ||
}, | ||
"GetVNETAddressPrefixes": func() string { | ||
return getVNETAddressPrefixes(cs.Properties) | ||
|
@@ -802,12 +802,24 @@ func (t *TemplateGenerator) getTemplateFuncMap(cs *api.ContainerService) templat | |
imageRef := cs.Properties.MasterProfile.ImageRef | ||
return imageRef != nil && len(imageRef.Name) > 0 && len(imageRef.ResourceGroup) > 0 | ||
}, | ||
"GetRouteTableName": func() string { | ||
return cs.Properties.GetRouteTableName() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would it make more sense to have these methods directly on the ContainerService object to encapsulate/hide a bit more the Properties struct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it should be tied to the Properties struct. What are thoughts on moving cs.Properties to a variable? |
||
}, | ||
"GetNSGName": func() string { | ||
return cs.Properties.GetNSGName() | ||
}, | ||
"GetMasterEtcdServerPort": func() int { | ||
return DefaultMasterEtcdServerPort | ||
}, | ||
"GetMasterEtcdClientPort": func() int { | ||
return DefaultMasterEtcdClientPort | ||
}, | ||
"GetPrimaryAvailabilitySetName": func() string { | ||
return cs.Properties.GetPrimaryAvailabilitySetName() | ||
}, | ||
"GetPrimaryScaleSetName": func() string { | ||
return cs.Properties.GetPrimaryScaleSetName() | ||
}, | ||
"UseCloudControllerManager": func() bool { | ||
return cs.Properties.OrchestratorProfile.KubernetesConfig.UseCloudControllerManager != nil && *cs.Properties.OrchestratorProfile.KubernetesConfig.UseCloudControllerManager | ||
}, | ||
|
@@ -907,7 +919,7 @@ func (t *TemplateGenerator) getTemplateFuncMap(cs *api.ContainerService) templat | |
return a - b | ||
}, | ||
"IsCustomVNET": func() bool { | ||
return isCustomVNET(cs.Properties.AgentPoolProfiles) | ||
return cs.Properties.AreAgentProfilesCustomVNET() | ||
}, | ||
"quote": strconv.Quote, | ||
"shellQuote": func(s string) string { | ||
|
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.
nit:
GenerateClusterID
seems to suggest to generate every time it is called...GetClusterID
seems better?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.
Certainly!
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.
ok.. maybe it's generated after all...
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.
Just to clarify, the existing
GenerateClusterID
(before this change) also generates w/ every invocation as well, right?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.
Talked to @tariq1890 , it's seeded using the hash. so clusterID is always the same regardless how many times it is called
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.
In this case, I'd like to get
GetClusterID
:)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.
@jackfrancis no, I've added a new field in Properties to store the ClusterID after it's generated during the first time.