Skip to content

Commit fb18141

Browse files
authored
Remove some unused constants and functions. (#362)
1 parent 643d198 commit fb18141

File tree

7 files changed

+135
-840
lines changed

7 files changed

+135
-840
lines changed

pkg/agent/datamodel/const.go

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,53 +3,19 @@
33

44
package datamodel
55

6-
const (
7-
VlabsAPIVersion = "vlabs"
8-
)
9-
106
// the orchestrators supported by vlabs
117
const (
12-
// Mesos is the string constant for MESOS orchestrator type
13-
Mesos string = "Mesos"
14-
// DCOS is the string constant for DCOS orchestrator type and defaults to DCOS188
15-
DCOS string = "DCOS"
16-
// Swarm is the string constant for the Swarm orchestrator type
17-
Swarm string = "Swarm"
188
// Kubernetes is the string constant for the Kubernetes orchestrator type
199
Kubernetes string = "Kubernetes"
20-
// SwarmMode is the string constant for the Swarm Mode orchestrator type
21-
SwarmMode string = "SwarmMode"
2210
)
2311

2412
const (
25-
// SwarmVersion is the Swarm orchestrator version
26-
SwarmVersion = "swarm:1.1.0"
27-
// SwarmDockerComposeVersion is the Docker Compose version
28-
SwarmDockerComposeVersion = "1.6.2"
29-
// DockerCEVersion is the DockerCE orchestrator version
30-
DockerCEVersion = "17.03.*"
31-
// DockerCEDockerComposeVersion is the Docker Compose version
32-
DockerCEDockerComposeVersion = "1.14.0"
3313
// KubernetesWindowsDockerVersion is the default version for docker on Windows nodes in kubernetes
3414
KubernetesWindowsDockerVersion = "19.03.5"
3515
// KubernetesDefaultWindowsSku is the default SKU for Windows VMs in kubernetes
3616
KubernetesDefaultWindowsSku = "Datacenter-Core-1809-with-Containers-smalldisk"
3717
)
3818

39-
// validation values
40-
const (
41-
// MinAgentCount are the minimum number of agents per agent pool
42-
MinAgentCount = 1
43-
// MaxAgentCount are the maximum number of agents per agent pool
44-
MaxAgentCount = 100
45-
// MinPort specifies the minimum tcp port to open
46-
MinPort = 1
47-
// MaxPort specifies the maximum tcp port to open
48-
MaxPort = 65535
49-
// MaxDisks specifies the maximum attached disks to add to the cluster
50-
MaxDisks = 4
51-
)
52-
5319
// Availability profiles
5420
const (
5521
// AvailabilitySet means that the vms are in an availability set
@@ -272,26 +238,6 @@ const (
272238
VHDDiskSizeAKS = 30
273239
)
274240

275-
const (
276-
CloudProviderBackoffModeV2 = "v2"
277-
// DefaultKubernetesCloudProviderBackoffRetries is 6, takes effect if DefaultKubernetesCloudProviderBackoff is true
278-
DefaultKubernetesCloudProviderBackoffRetries = 6
279-
// DefaultKubernetesCloudProviderBackoffJitter is 1, takes effect if DefaultKubernetesCloudProviderBackoff is true
280-
DefaultKubernetesCloudProviderBackoffJitter = 1.0
281-
// DefaultKubernetesCloudProviderBackoffDuration is 5, takes effect if DefaultKubernetesCloudProviderBackoff is true
282-
DefaultKubernetesCloudProviderBackoffDuration = 5
283-
// DefaultKubernetesCloudProviderBackoffExponent is 1.5, takes effect if DefaultKubernetesCloudProviderBackoff is true
284-
DefaultKubernetesCloudProviderBackoffExponent = 1.5
285-
// DefaultKubernetesCloudProviderRateLimitQPS is 3, takes effect if DefaultKubernetesCloudProviderRateLimit is true
286-
DefaultKubernetesCloudProviderRateLimitQPS = 3.0
287-
// DefaultKubernetesCloudProviderRateLimitQPSWrite is 1, takes effect if DefaultKubernetesCloudProviderRateLimit is true
288-
DefaultKubernetesCloudProviderRateLimitQPSWrite = 1.0
289-
// DefaultKubernetesCloudProviderRateLimitBucket is 10, takes effect if DefaultKubernetesCloudProviderRateLimit is true
290-
DefaultKubernetesCloudProviderRateLimitBucket = 10
291-
// DefaultKubernetesCloudProviderRateLimitBucketWrite is 10, takes effect if DefaultKubernetesCloudProviderRateLimit is true
292-
DefaultKubernetesCloudProviderRateLimitBucketWrite = DefaultKubernetesCloudProviderRateLimitBucket
293-
)
294-
295241
const (
296242
//AzureEdgeDCOSBootstrapDownloadURL is the azure edge CDN download url
297243
AzureEdgeDCOSBootstrapDownloadURL = "https://dcosio.azureedge.net/dcos/%s/bootstrap/%s.bootstrap.tar.xz"

pkg/agent/datamodel/types.go

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -695,40 +695,6 @@ func (p *Properties) HasWindows() bool {
695695
return false
696696
}
697697

698-
// SetCloudProviderRateLimitDefaults sets default cloudprovider rate limiter config
699-
func (p *Properties) SetCloudProviderRateLimitDefaults() {
700-
if p.OrchestratorProfile.KubernetesConfig.CloudProviderRateLimitBucket == 0 {
701-
var agentPoolProfilesCount = len(p.AgentPoolProfiles)
702-
if agentPoolProfilesCount == 0 {
703-
p.OrchestratorProfile.KubernetesConfig.CloudProviderRateLimitBucket = DefaultKubernetesCloudProviderRateLimitBucket
704-
} else {
705-
p.OrchestratorProfile.KubernetesConfig.CloudProviderRateLimitBucket = agentPoolProfilesCount * MaxAgentCount
706-
}
707-
}
708-
if p.OrchestratorProfile.KubernetesConfig.CloudProviderRateLimitQPS == 0 {
709-
if (DefaultKubernetesCloudProviderRateLimitQPS / float64(p.OrchestratorProfile.KubernetesConfig.CloudProviderRateLimitBucket)) < MinCloudProviderQPSToBucketFactor {
710-
p.OrchestratorProfile.KubernetesConfig.CloudProviderRateLimitQPS = float64(p.OrchestratorProfile.KubernetesConfig.CloudProviderRateLimitBucket) * MinCloudProviderQPSToBucketFactor
711-
} else {
712-
p.OrchestratorProfile.KubernetesConfig.CloudProviderRateLimitQPS = DefaultKubernetesCloudProviderRateLimitQPS
713-
}
714-
}
715-
if p.OrchestratorProfile.KubernetesConfig.CloudProviderRateLimitBucketWrite == 0 {
716-
var agentPoolProfilesCount = len(p.AgentPoolProfiles)
717-
if agentPoolProfilesCount == 0 {
718-
p.OrchestratorProfile.KubernetesConfig.CloudProviderRateLimitBucketWrite = DefaultKubernetesCloudProviderRateLimitBucketWrite
719-
} else {
720-
p.OrchestratorProfile.KubernetesConfig.CloudProviderRateLimitBucketWrite = agentPoolProfilesCount * MaxAgentCount
721-
}
722-
}
723-
if p.OrchestratorProfile.KubernetesConfig.CloudProviderRateLimitQPSWrite == 0 {
724-
if (DefaultKubernetesCloudProviderRateLimitQPSWrite / float64(p.OrchestratorProfile.KubernetesConfig.CloudProviderRateLimitBucketWrite)) < MinCloudProviderQPSToBucketFactor {
725-
p.OrchestratorProfile.KubernetesConfig.CloudProviderRateLimitQPSWrite = float64(p.OrchestratorProfile.KubernetesConfig.CloudProviderRateLimitBucketWrite) * MinCloudProviderQPSToBucketFactor
726-
} else {
727-
p.OrchestratorProfile.KubernetesConfig.CloudProviderRateLimitQPSWrite = DefaultKubernetesCloudProviderRateLimitQPSWrite
728-
}
729-
}
730-
}
731-
732698
// TotalNodes returns the total number of nodes in the cluster configuration
733699
func (p *Properties) TotalNodes() int {
734700
var totalNodes int
@@ -1287,24 +1253,6 @@ func (k *KubernetesConfig) IsAddonEnabled(addonName string) bool {
12871253
return kubeAddon.IsEnabled()
12881254
}
12891255

1290-
// SetCloudProviderBackoffDefaults sets default cloudprovider backoff config
1291-
func (k *KubernetesConfig) SetCloudProviderBackoffDefaults() {
1292-
if k.CloudProviderBackoffDuration == 0 {
1293-
k.CloudProviderBackoffDuration = DefaultKubernetesCloudProviderBackoffDuration
1294-
}
1295-
if k.CloudProviderBackoffRetries == 0 {
1296-
k.CloudProviderBackoffRetries = DefaultKubernetesCloudProviderBackoffRetries
1297-
}
1298-
if !strings.EqualFold(k.CloudProviderBackoffMode, CloudProviderBackoffModeV2) {
1299-
if k.CloudProviderBackoffExponent == 0 {
1300-
k.CloudProviderBackoffExponent = DefaultKubernetesCloudProviderBackoffExponent
1301-
}
1302-
if k.CloudProviderBackoffJitter == 0 {
1303-
k.CloudProviderBackoffJitter = DefaultKubernetesCloudProviderBackoffJitter
1304-
}
1305-
}
1306-
}
1307-
13081256
// PrivateJumpboxProvision checks if a private cluster has jumpbox auto-provisioning
13091257
func (k *KubernetesConfig) PrivateJumpboxProvision() bool {
13101258
if k != nil && k.PrivateCluster != nil && *k.PrivateCluster.Enabled && k.PrivateCluster.JumpboxProfile != nil {

0 commit comments

Comments
 (0)