@@ -34,27 +34,27 @@ var (
34
34
errCantDetermineMCImage = errors .New ("can't determine MC Image" )
35
35
)
36
36
37
- func getK8sAPIServer () string {
38
- // if m3 is running inside a k8s pod KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT will contain the k8s api server apiServerAddress
39
- // if m3 is not running inside k8s by default will look for the k8s api server on localhost:8001 (kubectl proxy)
37
+ func GetK8sAPIServer () string {
38
+ // if console is running inside a k8s pod KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT will contain the k8s api server apiServerAddress
39
+ // if console is not running inside k8s by default will look for the k8s api server on localhost:8001 (kubectl proxy)
40
40
// NOTE: using kubectl proxy is for local development only, since every request send to localhost:8001 will bypass service account authentication
41
41
// more info here: https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#directly-accessing-the-rest-api
42
- // you can override this using M3_K8S_API_SERVER , ie use the k8s cluster from `kubectl config view`
42
+ // you can override this using MCS_K8S_API_SERVER , ie use the k8s cluster from `kubectl config view`
43
43
host , port := env .Get ("KUBERNETES_SERVICE_HOST" , "" ), env .Get ("KUBERNETES_SERVICE_PORT" , "" )
44
44
apiServerAddress := "http://localhost:8001"
45
45
if host != "" && port != "" {
46
46
apiServerAddress = "https://" + net .JoinHostPort (host , port )
47
47
}
48
- return env .Get (M3K8sAPIServer , apiServerAddress )
48
+ return env .Get (McsK8sAPIServer , apiServerAddress )
49
49
}
50
50
51
51
// getK8sAPIServerInsecure allow to tell the k8s client to skip TLS certificate verification, ie: when connecting to a k8s cluster
52
52
// that uses certificate not trusted by your machine
53
53
func getK8sAPIServerInsecure () bool {
54
- return strings .ToLower (env .Get (m3k8SAPIServerInsecure , "off" )) == "on"
54
+ return strings .ToLower (env .Get (McsK8SAPIServerInsecure , "off" )) == "on"
55
55
}
56
56
57
- // GetNsFromFile assumes mkube is running inside a k8s pod and extract the current namespace from the
57
+ // GetNsFromFile assumes console is running inside a k8s pod and extract the current namespace from the
58
58
// /var/run/secrets/kubernetes.io/serviceaccount/namespace file
59
59
func GetNsFromFile () string {
60
60
dat , err := ioutil .ReadFile ("/var/run/secrets/kubernetes.io/serviceaccount/namespace" )
@@ -64,12 +64,12 @@ func GetNsFromFile() string {
64
64
return string (dat )
65
65
}
66
66
67
- // This operation will run only once at mkube startup
67
+ // This operation will run only once at console startup
68
68
var namespace = GetNsFromFile ()
69
69
70
70
// Returns the namespace in which the controller is installed
71
71
func GetNs () string {
72
- return env .Get (M3Namespace , namespace )
72
+ return env .Get (McsNamespace , namespace )
73
73
}
74
74
75
75
// getLatestMinIOImage returns the latest docker image for MinIO if found on the internet
@@ -106,7 +106,7 @@ var latestMinIOImage, errLatestMinIOImage = getLatestMinIOImage(
106
106
// a preferred image to be used (configured via ENVIRONMENT VARIABLES) GetMinioImage will return that
107
107
// if not, GetMinioImage will try to obtain the image URL for the latest version of MinIO and return that
108
108
func GetMinioImage () (* string , error ) {
109
- image := strings .TrimSpace (env .Get (M3MinioImage , "" ))
109
+ image := strings .TrimSpace (env .Get (McsMinioImage , "" ))
110
110
// if there is a preferred image configured by the user we'll always return that
111
111
if image != "" {
112
112
return & image , nil
@@ -156,7 +156,7 @@ func getLatestMCImage() (*string, error) {
156
156
var latestMCImage , errLatestMCImage = getLatestMCImage ()
157
157
158
158
func GetMCImage () (* string , error ) {
159
- image := strings .TrimSpace (env .Get (M3MCImage , "" ))
159
+ image := strings .TrimSpace (env .Get (McsMCImage , "" ))
160
160
// if there is a preferred image configured by the user we'll always return that
161
161
if image != "" {
162
162
return & image , nil
0 commit comments