Skip to content

Commit 38780d5

Browse files
committed
remove references to m3
1 parent b8a849b commit 38780d5

File tree

7 files changed

+24
-30
lines changed

7 files changed

+24
-30
lines changed

cluster/cluster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
)
2525

2626
func GetK8sConfig(token string) *rest.Config {
27-
// if m3 is running inside k8s by default he will have access to the ca cert from the k8s local authority
27+
// if console is running inside k8s by default he will have access to the ca cert from the k8s local authority
2828
const (
2929
rootCAFile = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
3030
)

cluster/config.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@ var (
3535
)
3636

3737
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)
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)
4040
// NOTE: using kubectl proxy is for local development only, since every request send to localhost:8001 will bypass service account authentication
4141
// 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`
4343
host, port := env.Get("KUBERNETES_SERVICE_HOST", ""), env.Get("KUBERNETES_SERVICE_PORT", "")
4444
apiServerAddress := "http://localhost:8001"
4545
if host != "" && port != "" {
4646
apiServerAddress = "https://" + net.JoinHostPort(host, port)
4747
}
48-
return env.Get(M3K8sAPIServer, apiServerAddress)
48+
return env.Get(McsK8sAPIServer, apiServerAddress)
4949
}
5050

5151
// getK8sAPIServerInsecure allow to tell the k8s client to skip TLS certificate verification, ie: when connecting to a k8s cluster
5252
// that uses certificate not trusted by your machine
5353
func getK8sAPIServerInsecure() bool {
54-
return strings.ToLower(env.Get(m3k8SAPIServerInsecure, "off")) == "on"
54+
return strings.ToLower(env.Get(McsK8SAPIServerInsecure, "off")) == "on"
5555
}
5656

5757
// GetNsFromFile assumes console is running inside a k8s pod and extract the current namespace from the
@@ -69,7 +69,7 @@ var namespace = GetNsFromFile()
6969

7070
// Returns the namespace in which the controller is installed
7171
func GetNs() string {
72-
return env.Get(M3Namespace, namespace)
72+
return env.Get(McsNamespace, namespace)
7373
}
7474

7575
// getLatestMinIOImage returns the latest docker image for MinIO if found on the internet
@@ -106,7 +106,7 @@ var latestMinIOImage, errLatestMinIOImage = getLatestMinIOImage(
106106
// a preferred image to be used (configured via ENVIRONMENT VARIABLES) GetMinioImage will return that
107107
// if not, GetMinioImage will try to obtain the image URL for the latest version of MinIO and return that
108108
func GetMinioImage() (*string, error) {
109-
image := strings.TrimSpace(env.Get(M3MinioImage, ""))
109+
image := strings.TrimSpace(env.Get(McsMinioImage, ""))
110110
// if there is a preferred image configured by the user we'll always return that
111111
if image != "" {
112112
return &image, nil
@@ -156,7 +156,7 @@ func getLatestMCImage() (*string, error) {
156156
var latestMCImage, errLatestMCImage = getLatestMCImage()
157157

158158
func GetMCImage() (*string, error) {
159-
image := strings.TrimSpace(env.Get(M3MCImage, ""))
159+
image := strings.TrimSpace(env.Get(McsMCImage, ""))
160160
// if there is a preferred image configured by the user we'll always return that
161161
if image != "" {
162162
return &image, nil

cluster/const.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
package cluster
1818

1919
const (
20-
M3K8sAPIServer = "M3_K8S_API_SERVER"
21-
m3k8SAPIServerInsecure = "M3_K8S_API_SERVER_INSECURE"
22-
M3MinioImage = "M3_MINIO_IMAGE"
23-
M3MCImage = "M3_MC_IMAGE"
24-
M3Namespace = "M3_NAMESPACE"
20+
McsK8sAPIServer = "MCS_K8S_API_SERVER"
21+
McsK8SAPIServerInsecure = "MCS_K8S_API_SERVER_INSECURE"
22+
McsMinioImage = "MCS_MINIO_IMAGE"
23+
McsMCImage = "MCS_MC_IMAGE"
24+
McsNamespace = "MCS_NAMESPACE"
2525
)

restapi/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,5 +236,5 @@ func getSecureExpectCTHeader() string {
236236
// getTenantMemorySize Memory size value to be used when generating the
237237
// MinioInstance request
238238
func getTenantMemorySize() string {
239-
return env.Get(M3TenantMemorySize, defaultTenantMemorySize)
239+
return env.Get(McsTenantMemorySize, defaultTenantMemorySize)
240240
}

restapi/configure_mcs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func configureAPI(api *operations.McsAPI) http.Handler {
110110
// Register admin Service Account Handlers
111111
registerServiceAccountsHandlers(api)
112112

113-
//m3
113+
// Operator Console
114114
// Register tenant handlers
115115
registerTenantHandlers(api)
116116
// Register ResourceQuota handlers

restapi/constants.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@
1717
package restapi
1818

1919
const (
20-
// consts for common configuration
21-
M3Version = `0.1.0`
22-
M3Hostname = "M3_HOSTNAME"
23-
M3Port = "M3_PORT"
24-
M3TLSHostname = "M3_TLS_HOSTNAME"
25-
M3TLSPort = "M3_TLS_PORT"
26-
// M3TenantMemorySize Memory size to be used when creating MinioInstance request
27-
M3TenantMemorySize = "M3_TENANT_MEMORY_SIZE"
20+
// McsTenantMemorySize Memory size to be used when creating MinioInstance request
21+
McsTenantMemorySize = "MCS_TENANT_MEMORY_SIZE"
2822
)

restapi/integrations.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,15 @@ func gkeIntegration(clientset *kubernetes.Clientset, tenantName string, namespac
170170
return err
171171
}
172172
// udpate ingress with this new service
173-
m3Ingress, err := clientset.ExtensionsV1beta1().Ingresses(namespace).Get(context.Background(), "console-ingress", metav1.GetOptions{})
173+
consoleIngress, err := clientset.ExtensionsV1beta1().Ingresses(namespace).Get(context.Background(), "console-ingress", metav1.GetOptions{})
174174
if err != nil {
175175
return err
176176
}
177177

178-
certsInIngress := m3Ingress.ObjectMeta.Annotations["networking.gke.io/managed-certificates"]
178+
certsInIngress := consoleIngress.ObjectMeta.Annotations["networking.gke.io/managed-certificates"]
179179
allCerts := strings.Split(certsInIngress, ",")
180180
allCerts = append(allCerts, manCertName)
181-
m3Ingress.ObjectMeta.Annotations["networking.gke.io/managed-certificates"] = strings.Join(allCerts, ",")
181+
consoleIngress.ObjectMeta.Annotations["networking.gke.io/managed-certificates"] = strings.Join(allCerts, ",")
182182

183183
tenantNodePortIoS := intstr.IntOrString{
184184
Type: intstr.Int,
@@ -190,7 +190,7 @@ func gkeIntegration(clientset *kubernetes.Clientset, tenantName string, namespac
190190
IntVal: int32(tenantMcsNodePort),
191191
}
192192

193-
m3Ingress.Spec.Rules = append(m3Ingress.Spec.Rules, extensionsBeta1.IngressRule{
193+
consoleIngress.Spec.Rules = append(consoleIngress.Spec.Rules, extensionsBeta1.IngressRule{
194194
Host: tenantDomain,
195195
IngressRuleValue: extensionsBeta1.IngressRuleValue{
196196
HTTP: &extensionsBeta1.HTTPIngressRuleValue{
@@ -205,7 +205,7 @@ func gkeIntegration(clientset *kubernetes.Clientset, tenantName string, namespac
205205
},
206206
},
207207
})
208-
m3Ingress.Spec.Rules = append(m3Ingress.Spec.Rules, extensionsBeta1.IngressRule{
208+
consoleIngress.Spec.Rules = append(consoleIngress.Spec.Rules, extensionsBeta1.IngressRule{
209209
Host: tenantMcsDomain,
210210
IngressRuleValue: extensionsBeta1.IngressRuleValue{
211211
HTTP: &extensionsBeta1.HTTPIngressRuleValue{
@@ -221,7 +221,7 @@ func gkeIntegration(clientset *kubernetes.Clientset, tenantName string, namespac
221221
},
222222
})
223223

224-
_, err = clientset.ExtensionsV1beta1().Ingresses(namespace).Update(context.Background(), m3Ingress, metav1.UpdateOptions{})
224+
_, err = clientset.ExtensionsV1beta1().Ingresses(namespace).Update(context.Background(), consoleIngress, metav1.UpdateOptions{})
225225
if err != nil {
226226
return err
227227
}

0 commit comments

Comments
 (0)