generated from cybozu-go/neco-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
constants.go
146 lines (111 loc) · 4.13 KB
/
constants.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
package constants
const (
// Version is the meows version.
Version = "0.16.0"
)
// Container names
const (
// RunnerContainerName is a container name which runs GitHub Actions runner.
RunnerContainerName = "runner"
)
// Metadata keys
const (
RunnerSecretExpiresAtAnnotationKey = "meows.cybozu.com/expires-at"
// RunnerPoolFinalizer is a finalizer for runnerpool resource.
RunnerPoolFinalizer = "meows.cybozu.com/runnerpool"
// AppNameLabelKey is a label key for application name.
AppNameLabelKey = "app.kubernetes.io/name"
// AppComponentLabelKey is a label key for the component.
AppComponentLabelKey = "app.kubernetes.io/component"
// AppInstanceLabelKey is a label key for the instance name.
AppInstanceLabelKey = "app.kubernetes.io/instance"
// RunnerPodName is the label key to select individual pod.
RunnerPodName = "meows.cybozu.com/runner-pod-name"
)
const (
// AppName is the application name.
AppName = "meows"
// AppComponentRunner is the component name for runner.
AppComponentRunner = "runner"
)
// Container ports
const (
// RunnerListenPort is the port number for runner container.
RunnerListenPort = 8080
// RunnerMetricsPortName is the port name for runner container.
RunnerMetricsPortName = "metrics"
)
// Container endpoints
const (
// DeletionTimeEndpoint is the endpoint to get deletion time for runner container.
DeletionTimeEndpoint = "deletion_time"
// StatusEndPoint is the endpoint to get status of a runner pod.
StatusEndPoint = "status"
)
// Runner pods state.
const (
RunnerPodStateInitializing = "initializing"
RunnerPodStateRunning = "running"
RunnerPodStateDebugging = "debugging"
RunnerPodStateStale = "stale"
)
// Exit state of Actions Listener.
const (
ListenerExitStateRetryableError = "retryable_error"
ListenerExitStateUpdating = "updating"
ListenerExitStateUndefined = "undefined"
)
// Constants for controller option configmap.
const (
// OptionConfigMapName is a configmap name for the controller option.
OptionConfigMapName = "meows-cm"
// Data keys for controller option.
OptionConfigMapDataOrganizationRule = "organization-rule"
OptionConfigMapDataRepositoryRule = "repository-rule"
)
// Constants for GitHub credential secret.
const (
// DefaultCredentialSecretName is the default secret name for GitHub credential secret.
DefaultCredentialSecretName = "meows-github-cred"
// Data keys for GitHub App's credential.
CredentialSecretDataAppID = "app-id"
CredentialSecretDataAppInstallationID = "app-installation-id"
CredentialSecretDataAppPrivateKey = "app-private-key"
// Data keys for GitHub personal access token (PAT).
CredentialSecretDataPATToken = "token"
)
const (
DefaultSlackAgentServiceName = "slack-agent.meows.svc"
)
// Directory path for runner pods.
const (
// RunnerRootDirPath is a directory path where GitHub Actions Runner will be installed.
RunnerRootDirPath = "/runner"
// RunnerWorkDirPath is a working directory path for job execution.
RunnerWorkDirPath = "/runner/_work"
// RunnerVarDirPath is a directory path for storing variable files.
RunnerVarDirPath = "/var/meows"
// SlackChannelFilePath is a file path for the Slack channel to be notified.
SlackChannelFilePath = RunnerVarDirPath + "/slack_channel"
// SecretsDirName is a directory name for storing secret files.
SecretsDirName = "secrets"
// RunnerTokenFileName is a file name for GitHub registration token.
RunnerTokenFileName = "runnertoken"
)
// Environment variables
const (
// PodNameEnvName is a env field key for POD_NAME.
PodNameEnvName = "POD_NAME"
// PodNamespaceEnvName is a env field key for POD_NAMESPACE.
PodNamespaceEnvName = "POD_NAMESPACE"
// RunnerOrgEnvName is a env field key for RUNNER_ORG.
RunnerOrgEnvName = "RUNNER_ORG"
// RunnerRepoEnvName is a env field key for RUNNER_REPO.
RunnerRepoEnvName = "RUNNER_REPO"
// RunnerPoolNameEnvName is a env field key for RUNNER_POOL_NAME.
RunnerPoolNameEnvName = "RUNNER_POOL_NAME"
// RunnerOptionEnvName is a env field key for RUNNER_OPTION
RunnerOptionEnvName = "RUNNER_OPTION"
// SlackChannelEnvName is a env field key for MEOWS_SLACK_CHANNEL
SlackChannelEnvName = "MEOWS_SLACK_CHANNEL"
)