-
Notifications
You must be signed in to change notification settings - Fork 201
/
mocks.go
148 lines (139 loc) · 5.75 KB
/
mocks.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
package datamodel
// GetK8sDefaultProperties returns a struct of type Properties for testing purposes.
func GetK8sDefaultProperties(hasWindows bool) *Properties {
p := &Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: Kubernetes,
KubernetesConfig: &KubernetesConfig{},
},
HostedMasterProfile: &HostedMasterProfile{
DNSPrefix: "foo",
},
AgentPoolProfiles: []*AgentPoolProfile{
{
Name: "agentpool",
VMSize: "Standard_D2_v2",
AvailabilityProfile: AvailabilitySet,
},
},
ServicePrincipalProfile: &ServicePrincipalProfile{
ClientID: "clientID",
Secret: "clientSecret",
},
}
if hasWindows {
p.AgentPoolProfiles = []*AgentPoolProfile{
{
Name: "agentpool",
VMSize: "Standard_D2_v2",
AvailabilityProfile: AvailabilitySet,
OSType: Windows,
},
}
p.WindowsProfile = &WindowsProfile{
AdminUsername: "azureuser",
AdminPassword: "replacepassword1234$",
}
}
return p
}
func getMockProperitesWithCustomClouEnv() Properties {
properties := Properties{
CustomCloudEnv: &CustomCloudEnv{
Name: "akscustom",
McrURL: "mcr.microsoft.fakecustomcloud",
RepoDepotEndpoint: "https://repodepot.azure.microsoft.fakecustomcloud/ubuntu",
ManagementPortalURL: "https://portal.azure.microsoft.fakecustomcloud/",
PublishSettingsURL: "",
ServiceManagementEndpoint: "https://management.core.microsoft.fakecustomcloud/",
ResourceManagerEndpoint: "https://management.azure.microsoft.fakecustomcloud/",
ActiveDirectoryEndpoint: "https://login.microsoftonline.microsoft.fakecustomcloud/",
GalleryEndpoint: "",
KeyVaultEndpoint: "https://vault.cloudapi.microsoft.fakecustomcloud/",
GraphEndpoint: "https://graph.cloudapi.microsoft.fakecustomcloud/",
ServiceBusEndpoint: "",
BatchManagementEndpoint: "",
StorageEndpointSuffix: "core.microsoft.fakecustomcloud",
SQLDatabaseDNSSuffix: "database.cloudapi.microsoft.fakecustomcloud",
TrafficManagerDNSSuffix: "",
KeyVaultDNSSuffix: "vault.cloudapi.microsoft.fakecustomcloud",
ServiceBusEndpointSuffix: "",
ServiceManagementVMDNSSuffix: "",
ResourceManagerVMDNSSuffix: "cloudapp.azure.microsoft.fakecustomcloud/",
ContainerRegistryDNSSuffix: ".azurecr.microsoft.fakecustomcloud",
CosmosDBDNSSuffix: "documents.core.microsoft.fakecustomcloud/",
TokenAudience: "https://management.core.microsoft.fakecustomcloud/",
ResourceIdentifiers: ResourceIdentifiers{
Graph: "",
KeyVault: "",
Datalake: "",
Batch: "",
OperationalInsights: "",
Storage: "",
},
},
}
return properties
}
func getMockAddon(name string) KubernetesAddon {
return KubernetesAddon{
Name: name,
Containers: []KubernetesContainerSpec{
{
Name: name,
CPURequests: "50m",
MemoryRequests: "150Mi",
CPULimits: "50m",
MemoryLimits: "150Mi",
},
},
Pools: []AddonNodePoolsConfig{
{
Name: "pool1",
Config: map[string]string{
"min-nodes": "3",
"max-nodes": "3",
},
},
},
}
}
//nolint:gochecknoglobals
var (
AzurePublicCloudSpecForTest = &AzureEnvironmentSpecConfig{
CloudName: "AzurePublicCloud",
// DockerSpecConfig specify the docker engine download repo
DockerSpecConfig: DockerSpecConfig{
DockerEngineRepo: "https://aptdocker.azureedge.net/repo",
DockerComposeDownloadURL: "https://github.com/docker/compose/releases/download",
},
// KubernetesSpecConfig is the default kubernetes container image url.
KubernetesSpecConfig: KubernetesSpecConfig{
KubernetesImageBase: "k8s.gcr.io/",
TillerImageBase: "gcr.io/kubernetes-helm/",
ACIConnectorImageBase: "microsoft/",
NVIDIAImageBase: "nvidia/",
CalicoImageBase: "calico/",
AzureCNIImageBase: "mcr.microsoft.com/containernetworking/",
MCRKubernetesImageBase: "mcr.microsoft.com/",
KubeBinariesSASURLBase: "https://acs-mirror.azureedge.net/kubernetes/",
WindowsTelemetryGUID: "fb801154-36b9-41bc-89c2-f4d4f05472b0",
CNIPluginsDownloadURL: "https://acs-mirror.azureedge.net/cni/cni-plugins-amd64-v0.7.6.tgz",
VnetCNILinuxPluginsDownloadURL: "https://acs-mirror.azureedge.net/azure-cni/v1.1.3/binaries/azure-vnet-cni-linux-amd64-v1.1.3.tgz",
VnetCNIWindowsPluginsDownloadURL: "https://acs-mirror.azureedge.net/azure-cni/v1.1.3/binaries/azure-vnet-cni-singletenancy-windows-amd64-v1.1.3.zip",
ContainerdDownloadURLBase: "https://storage.googleapis.com/cri-containerd-release/",
CSIProxyDownloadURL: "https://acs-mirror.azureedge.net/csi-proxy/v0.1.0/binaries/csi-proxy.tar.gz",
WindowsProvisioningScriptsPackageURL: "https://acs-mirror.azureedge.net/aks-engine/windows/provisioning/signedscripts-v0.2.2.zip",
WindowsPauseImageURL: "mcr.microsoft.com/oss/kubernetes/pause:1.4.0",
AlwaysPullWindowsPauseImage: false,
CseScriptsPackageURL: "https://acs-mirror.azureedge.net/aks/windows/cse/csescripts-v0.0.1.zip",
CNIARM64PluginsDownloadURL: "https://acs-mirror.azureedge.net/cni-plugins/v0.8.7/binaries/cni-plugins-linux-arm64-v0.8.7.tgz",
VnetCNIARM64LinuxPluginsDownloadURL: "https://acs-mirror.azureedge.net/azure-cni/v1.4.13/binaries/azure-vnet-cni-linux-arm64-v1.4.14.tgz",
},
EndpointConfig: AzureEndpointConfig{
ResourceManagerVMDNSSuffix: "cloudapp.azure.com",
},
}
)