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 562
/
types.go
133 lines (112 loc) · 5.06 KB
/
types.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
package vlabs
// OpenShiftCluster complies with the ARM model of resource definition in a JSON
// template.
type OpenShiftCluster struct {
ID string `json:"id,omitempty"`
Location string `json:"location,omitempty"`
Name string `json:"name,omitempty"`
Plan *ResourcePurchasePlan `json:"plan,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
Type string `json:"type,omitempty"`
Properties *Properties `json:"properties,omitempty"`
}
// ResourcePurchasePlan defines the resource plan as required by ARM for billing
// purposes.
type ResourcePurchasePlan struct {
Name string `json:"name,omitempty"`
Product string `json:"product,omitempty"`
PromotionCode string `json:"promotionCode,omitempty"`
Publisher string `json:"publisher,omitempty"`
}
// Properties represents the cluster definition.
type Properties struct {
// ProvisioningState (out): current state of the OSA resource.
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
// OpenShiftVersion (in): OpenShift version to be created/updated, e.g.
// `v3.10`.
OpenShiftVersion string `json:"openShiftVersion,omitempty"`
// PublicHostname (in,optional): Optional user-specified FQDN for OpenShift
// API server. If specified, after OSA cluster creation, user must create a
// PublicHostname CNAME record forwarding to the returned FQDN value.
PublicHostname string `json:"publicHostname,omitempty"`
// FQDN (out): Auto-allocated FQDN for OpenShift API server.
FQDN string `json:"fqdn,omitempty"`
// RouterProfiles (in,optional/out): Configuration for OpenShift router(s).
RouterProfiles []RouterProfile `json:"routerProfiles,omitempty"`
// AgentPoolProfiles (in): configuration of OpenShift cluster VMs.
AgentPoolProfiles []AgentPoolProfile `json:"agentPoolProfiles,omitempty"`
// TODO: is this compatible with MSI?
// ServicePrincipalProfile (in): Service principal for OpenShift cluster.
ServicePrincipalProfile ServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"`
}
// ProvisioningState represents the current state of the OSA resource.
type ProvisioningState string
const (
// Creating means the OSA resource is being created.
Creating ProvisioningState = "Creating"
// Updating means the existing OSA resource is being updated.
Updating ProvisioningState = "Updating"
// Failed means the OSA resource is in failed state.
Failed ProvisioningState = "Failed"
// Succeeded means the last create/update succeeded.
Succeeded ProvisioningState = "Succeeded"
// Deleting means the OSA resource is being deleted.
Deleting ProvisioningState = "Deleting"
// Migrating means the OSA resource is being migrated from one subscription
// or resource group to another.
Migrating ProvisioningState = "Migrating"
// Upgrading means the existing OAS resource is being upgraded.
Upgrading ProvisioningState = "Upgrading"
)
// RouterProfile represents an OpenShift router.
type RouterProfile struct {
Name string `json:"name,omitempty"`
// PublicSubdomain (in,optional/out): DNS subdomain for OpenShift router. If
// specified, after OSA cluster creation, user must create a (wildcard)
// *.PublicSubdomain CNAME record forwarding to the returned FQDN value. If
// not specified, OSA will auto-allocate and setup a PublicSubdomain and
// return it. The OpenShift master is configured with the PublicSubdomain
// of the "default" RouterProfile.
PublicSubdomain string `json:"publicSubdomain,omitempty"`
// FQDN (out): Auto-allocated FQDN for the OpenShift router.
FQDN string `json:"fqdn,omitempty"`
}
// AgentPoolProfile represents configuration of OpenShift cluster VMs.
type AgentPoolProfile struct {
Name string `json:"name,omitempty"`
Role AgentPoolProfileRole `json:"role,omitempty"`
Count int `json:"count,omitempty"`
VMSize string `json:"vmSize,omitempty"`
// VnetSubnetID is expected to be empty or match
// `^/subscriptions/[^/]+
// /resourceGroups/[^/]+
// /providers/Microsoft.Network
// /virtualNetworks/[^/]+
// /subnets/[^/]+$`
VnetSubnetID string `json:"vnetSubnetID,omitempty"`
OSType OSType `json:"osType,omitempty"`
}
// AgentPoolProfileRole represents the role of the AgentPoolProfile.
type AgentPoolProfileRole string
const (
// AgentPoolProfileRoleCompute is the compute role.
AgentPoolProfileRoleCompute AgentPoolProfileRole = "compute"
// AgentPoolProfileRoleInfra is the infra role.
AgentPoolProfileRoleInfra AgentPoolProfileRole = "infra"
// AgentPoolProfileRoleMaster is the master role.
AgentPoolProfileRoleMaster AgentPoolProfileRole = "master"
)
// OSType represents the OS type of VMs in an AgentPool.
type OSType string
const (
// OSTypeLinux is Linux.
OSTypeLinux OSType = "Linux"
// OSTypeWindows is Windows.
OSTypeWindows OSType = "Windows"
)
// ServicePrincipalProfile contains the client and secret used by the cluster
// for Azure Resource CRUD.
type ServicePrincipalProfile struct {
ClientID string `json:"clientId,omitempty"`
Secret string `json:"secret,omitempty"`
}