forked from juju/juju
-
Notifications
You must be signed in to change notification settings - Fork 0
/
facadeversions.go
125 lines (122 loc) · 4.36 KB
/
facadeversions.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
// Copyright 2014 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package api
// facadeVersions lists the best version of facades that we know about. This
// will be used to pick out a default version for communication, given the list
// of known versions that the API server tells us it is capable of supporting.
// This map should be updated whenever the API server exposes a new version (so
// that the client will use it whenever it is available).
// New facades should start at 1.
// Facades that existed before versioning start at 0.
var facadeVersions = map[string]int{
"Action": 3,
"ActionPruner": 1,
"Agent": 2,
"AgentTools": 1,
"AllModelWatcher": 2,
"AllWatcher": 1,
"Annotations": 2,
"Application": 10,
"ApplicationOffers": 2,
"ApplicationScaler": 1,
"Backups": 2,
"Block": 2,
"Bundle": 3,
"CAASAgent": 1,
"CAASFirewaller": 1,
"CAASOperator": 1,
"CAASOperatorProvisioner": 1,
"CAASOperatorUpgrader": 1,
"CAASUnitProvisioner": 1,
"CharmRevisionUpdater": 2,
"Charms": 2,
"Cleaner": 2,
"Client": 2,
"Cloud": 5,
"Controller": 7,
"CredentialManager": 1,
"CredentialValidator": 2,
"CrossController": 1,
"CrossModelRelations": 1,
"Deployer": 1,
"DiskManager": 2,
"EntityWatcher": 2,
"ExternalControllerUpdater": 1,
"FanConfigurer": 1,
"FilesystemAttachmentsWatcher": 2,
"Firewaller": 5,
"FirewallRules": 1,
"HighAvailability": 2,
"HostKeyReporter": 1,
"ImageManager": 2,
"ImageMetadata": 3,
"ImageMetadataManager": 1,
"InstanceMutater": 2,
"InstancePoller": 3,
"KeyManager": 1,
"KeyUpdater": 1,
"LeadershipService": 2,
"LifeFlag": 1,
"LogForwarding": 1,
"Logger": 1,
"MachineActions": 1,
"MachineManager": 6,
"MachineUndertaker": 1,
"Machiner": 1,
"MeterStatus": 1,
"MetricsAdder": 2,
"MetricsDebug": 2,
"MetricsManager": 1,
"MigrationFlag": 1,
"MigrationMaster": 1,
"MigrationMinion": 1,
"MigrationStatusWatcher": 1,
"MigrationTarget": 1,
"ModelConfig": 2,
"ModelGeneration": 1,
"ModelManager": 7,
"ModelUpgrader": 1,
"NotifyWatcher": 1,
"OfferStatusWatcher": 1,
"Payloads": 1,
"PayloadsHookContext": 1,
"Pinger": 1,
"Provisioner": 9,
"ProxyUpdater": 2,
"Reboot": 2,
"RelationStatusWatcher": 1,
"RelationUnitsWatcher": 1,
"RemoteRelations": 1,
"Resources": 1,
"ResourcesHookContext": 1,
"Resumer": 2,
"RetryStrategy": 1,
"Singular": 2,
"Spaces": 3,
"SSHClient": 2,
"StatusHistory": 2,
"Storage": 6,
"StorageProvisioner": 4,
"StringsWatcher": 1,
"Subnets": 2,
"Undertaker": 1,
"UnitAssigner": 1,
"Uniter": 12,
"Upgrader": 1,
"UpgradeSeries": 1,
"UpgradeSteps": 1,
"UserManager": 2,
"VolumeAttachmentsWatcher": 2,
"VolumeAttachmentPlansWatcher": 1,
}
// bestVersion tries to find the newest version in the version list that we can
// use.
func bestVersion(desiredVersion int, versions []int) int {
best := 0
for _, version := range versions {
if version <= desiredVersion && version > best {
best = version
}
}
return best
}