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
package v1alpha1
const (
ContractLabelPrefix = "contracts.socialweb.computer/"
ContractVersion = "v1alpha1"
)
const (
ContractAtprotoRepos = "atprotorepos"
ContractVaults = "vaults"
ContractComputeVMs = "computevms"
ContractEventSources = "eventsources"
)
const (
ContractLabelAtprotoRepos = ContractLabelPrefix + ContractAtprotoRepos
ContractLabelVaults = ContractLabelPrefix + ContractVaults
ContractLabelComputeVMs = ContractLabelPrefix + ContractComputeVMs
ContractLabelEventSources = ContractLabelPrefix + ContractEventSources
)
const (
ConditionReady = "Ready"
ConditionBackendBound = "BackendBound"
)
func ContractLabel(abstractResource string) string {
return ContractLabelPrefix + abstractResource
}
func ContractLabels(abstractResources ...string) map[string]string {
if len(abstractResources) == 0 {
return nil
}
out := make(map[string]string, len(abstractResources))
for _, r := range abstractResources {
out[ContractLabel(r)] = ContractVersion
}
return out
}