forked from Azure/acs-engine
-
Notifications
You must be signed in to change notification settings - Fork 1
/
converterfromupgradeapi.go
27 lines (22 loc) · 1.06 KB
/
converterfromupgradeapi.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package api
import "github.com/Azure/acs-engine/pkg/api/vlabs"
///////////////////////////////////////////////////////////
// The converter exposes functions to convert the top level
// ContainerService resource
//
// All other functions are internal helper functions used
// for converting.
///////////////////////////////////////////////////////////
// ConvertUpgradeContainerServiceToVLabs converts an unversioned ContainerService to a vlabs ContainerService
func ConvertUpgradeContainerServiceToVLabs(api *UpgradeContainerService) *vlabs.UpgradeContainerService {
vlabsUCS := &vlabs.UpgradeContainerService{}
vlabsUCS.OrchestratorProfile = &vlabs.OrchestratorProfile{}
convertUpgradeOrchestratorProfileToVLabs(api.OrchestratorProfile, vlabsUCS.OrchestratorProfile)
return vlabsUCS
}
func convertUpgradeOrchestratorProfileToVLabs(api *OrchestratorProfile, o *vlabs.OrchestratorProfile) {
o.OrchestratorType = vlabs.OrchestratorType(api.OrchestratorType)
if api.OrchestratorVersion != "" {
o.OrchestratorVersion = vlabs.OrchestratorVersion(api.OrchestratorVersion)
}
}