-
Notifications
You must be signed in to change notification settings - Fork 351
Expand file tree
/
Copy pathcommon.go
More file actions
54 lines (46 loc) · 1.87 KB
/
common.go
File metadata and controls
54 lines (46 loc) · 1.87 KB
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
/*
Copyright 2021.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package common
import (
"os"
)
const (
// ArgoCDInstanceName is the default Argo CD instance name
ArgoCDInstanceName = "openshift-gitops"
// DisableDefaultInstallEnvVar is an env variable to disable the default instance
DisableDefaultInstallEnvVar = "DISABLE_DEFAULT_ARGOCD_INSTANCE"
// DisableDefaultArgoCDConsoleLink is an env variable to disable the default Argo CD ConsoleLink
DisableDefaultArgoCDConsoleLink = "DISABLE_DEFAULT_ARGOCD_CONSOLELINK"
// InfraNodeLabelSelector is a nodeSelector for infrastructure nodes in Openshift
InfraNodeLabelSelector = "node-role.kubernetes.io/infra"
// Default console plugin image
DefaultConsoleImage = "uay.io/redhat-user-workloads/rh-openshift-gitops-tenant/console-plugin-rhel8"
// Default console plugin version
DefaultConsoleVersion = "latest"
// Default console plugin installation OCP version
DefaultDynamicPluginStartOCPVersion = "4.15.0"
// ImagePullPolicyEnvVar is the environment variable for configuring image pull policy
ImagePullPolicy = "IMAGE_PULL_POLICY"
)
// InfraNodeSelector returns openshift label for infrastructure nodes
func InfraNodeSelector() map[string]string {
return map[string]string{
"node-role.kubernetes.io/infra": "",
}
}
func StringFromEnv(env string, defaultValue string) string {
if str := os.Getenv(env); str != "" {
return str
}
return defaultValue
}