This repository has been archived by the owner on Oct 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
names.go
54 lines (44 loc) · 1.57 KB
/
names.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
package common
import (
"io/ioutil"
)
// Defines well-known names in the A01 system
const (
StorageVolumeNameArtifacts = "artifacts-storage"
StorageVolumeNameSecrets = "secrets-storage"
StorageVolumeNameTools = "tools-storage"
DNSNameTaskStore = "data-store-svc"
DNSNameEmailService = "email-report-svc"
DNSNameReportService = "report-internal-svc"
SecretNameAgents = "agent-secrets"
SystemConfigMapName = "a01-system-config"
)
const (
// RunStatusInitialized is set when a run is just created
RunStatusInitialized = "Initialized"
// RunStatusPublished is set when tasks are added to the task broker queue
RunStatusPublished = "Published"
// RunStatusRunning is set when test job is created and start running
RunStatusRunning = "Running"
// RunStatusCompleted is set when all tasks are accomplished
RunStatusCompleted = "Completed"
)
// Defines well-known keys in the a01 system config
const (
ConfigKeyEndpointTaskBroker = "endpoint.taskbroker"
ConfigKeyUsernameTaskBroker = "username.taskbroker"
ConfigKeyPasswordKeyTaskBroker = "password.taskbroker"
ConfigKeySecretTaskBroker = "secret.taskbroker"
)
// Defines well-known keys in a product specific secret
const (
ProductSecretKeyLogPathTemplate = "log.path.template"
)
// GetCurrentNamespace returns the namespace this Pod belongs to. If it fails
// to resolve the name, it uses the fallback name.
func GetCurrentNamespace(fallback string) string {
if content, err := ioutil.ReadFile(PathKubeNamespace); err == nil {
return string(content)
}
return fallback
}