Merge "RIC-208 - KA Decision: ask K8S to restart E2T instance - comment code of kubernetes"
diff --git a/E2Manager/Dockerfile b/E2Manager/Dockerfile
index c6b943b..1679468 100755
--- a/E2Manager/Dockerfile
+++ b/E2Manager/Dockerfile
@@ -39,7 +39,6 @@
tcpdump
COPY --from=ubuntu /opt/E2Manager/router.txt /opt/E2Manager/router.txt
-COPY --from=ubuntu /opt/E2Manager/kube_config.yml /opt/E2Manager/kube_config.yml
COPY --from=ubuntu /opt/E2Manager/main /opt/E2Manager/main
COPY --from=ubuntu /opt/E2Manager/resources/configuration.yaml /opt/E2Manager/resources/configuration.yaml
COPY --from=ubuntu /opt/E2Manager/resources/rmr.verbose /tmp/rmr.verbose
diff --git a/E2Manager/configuration/configuration.go b/E2Manager/configuration/configuration.go
index 4e8883e..5e4c31e 100644
--- a/E2Manager/configuration/configuration.go
+++ b/E2Manager/configuration/configuration.go
@@ -38,10 +38,10 @@
RoutingManager struct {
BaseUrl string
}
- Kubernetes struct {
+/* Kubernetes struct {
ConfigPath string
KubeNamespace string
- }
+ }*/
NotificationResponseBuffer int
BigRedButtonTimeoutSec int
MaxRnibConnectionAttempts int
@@ -72,7 +72,7 @@
config.populateHttpConfig(viper.Sub("http"))
config.populateLoggingConfig(viper.Sub("logging"))
config.populateRoutingManagerConfig(viper.Sub("routingManager"))
- config.populateKubernetesConfig(viper.Sub("kubernetes"))
+ //config.populateKubernetesConfig(viper.Sub("kubernetes"))
config.NotificationResponseBuffer = viper.GetInt("notificationResponseBuffer")
config.BigRedButtonTimeoutSec = viper.GetInt("bigRedButtonTimeoutSec")
config.MaxRnibConnectionAttempts = viper.GetInt("maxRnibConnectionAttempts")
@@ -113,13 +113,13 @@
c.RoutingManager.BaseUrl = rmConfig.GetString("baseUrl")
}
-func (c *Configuration) populateKubernetesConfig(rmConfig *viper.Viper) {
+/*func (c *Configuration) populateKubernetesConfig(rmConfig *viper.Viper) {
if rmConfig == nil {
panic(fmt.Sprintf("#configuration.populateKubernetesConfig - failed to populate Kubernetes configuration: The entry 'kubernetes' not found\n"))
}
c.Kubernetes.ConfigPath = rmConfig.GetString("configPath")
c.Kubernetes.KubeNamespace = rmConfig.GetString("kubeNamespace")
-}
+}*/
func (c *Configuration) populateGlobalRicIdConfig(globalRicIdConfig *viper.Viper) {
if globalRicIdConfig == nil {
@@ -133,7 +133,7 @@
return fmt.Sprintf("{logging.logLevel: %s, http.port: %d, rmr: { port: %d, maxMsgSize: %d}, routingManager.baseUrl: %s, "+
"notificationResponseBuffer: %d, bigRedButtonTimeoutSec: %d, maxRnibConnectionAttempts: %d, "+
"rnibRetryIntervalMs: %d, keepAliveResponseTimeoutMs: %d, keepAliveDelayMs: %d, e2tInstanceDeletionTimeoutMs: %d, "+
- "globalRicId: { plmnId: %s, ricNearRtId: %s, kubernetes: {configPath: %s, kubeNamespace: %s}}",
+ "globalRicId: { plmnId: %s, ricNearRtId: %s}",//, kubernetes: {configPath: %s, kubeNamespace: %s}}",
c.Logging.LogLevel,
c.Http.Port,
c.Rmr.Port,
@@ -148,7 +148,7 @@
c.E2TInstanceDeletionTimeoutMs,
c.GlobalRicId.PlmnId,
c.GlobalRicId.RicNearRtId,
- c.Kubernetes.ConfigPath,
- c.Kubernetes.KubeNamespace,
+/* c.Kubernetes.ConfigPath,
+ c.Kubernetes.KubeNamespace,*/
)
}
diff --git a/E2Manager/configuration/configuration_test.go b/E2Manager/configuration/configuration_test.go
index cad2254..695ed9a 100644
--- a/E2Manager/configuration/configuration_test.go
+++ b/E2Manager/configuration/configuration_test.go
@@ -42,8 +42,8 @@
assert.NotNil(t, config.GlobalRicId)
assert.NotEmpty(t, config.GlobalRicId.PlmnId)
assert.NotEmpty(t, config.GlobalRicId.RicNearRtId)
- assert.NotEmpty(t, config.Kubernetes.KubeNamespace)
- assert.NotEmpty(t, config.Kubernetes.ConfigPath)
+/* assert.NotEmpty(t, config.Kubernetes.KubeNamespace)
+ assert.NotEmpty(t, config.Kubernetes.ConfigPath)*/
}
func TestStringer(t *testing.T) {
@@ -208,7 +208,7 @@
"logging": map[string]interface{}{"logLevel": "info"},
"http": map[string]interface{}{"port": 3800},
"routingManager": map[string]interface{}{"baseUrl": "http://iltlv740.intl.att.com:8080/ric/v1/handles/"},
- "kubernetes": map[string]interface{}{"kubeNamespace": "test", "ConfigPath": "test"},
+ //"kubernetes": map[string]interface{}{"kubeNamespace": "test", "ConfigPath": "test"},
}
buf, err := yaml.Marshal(yamlMap)
if err != nil {
@@ -222,7 +222,7 @@
func() { ParseConfiguration() })
}
-func TestKubernetesConfigNotFoundFailure(t *testing.T) {
+/*func TestKubernetesConfigNotFoundFailure(t *testing.T) {
configPath := "../resources/configuration.yaml"
configPathTmp := "../resources/configuration.yaml_tmp"
err := os.Rename(configPath, configPathTmp)
@@ -252,4 +252,4 @@
}
assert.PanicsWithValue(t, "#configuration.populateKubernetesConfig - failed to populate Kubernetes configuration: The entry 'kubernetes' not found\n",
func() { ParseConfiguration() })
-}
+}*/
diff --git a/E2Manager/container-tag.yaml b/E2Manager/container-tag.yaml
index 5ea99c4..97b7f02 100644
--- a/E2Manager/container-tag.yaml
+++ b/E2Manager/container-tag.yaml
@@ -1,4 +1,4 @@
# The Jenkins job requires a tag to build the Docker image.
# Global-JJB script assumes this file is in the repo root.
---
-tag: 4.4.7
+tag: 4.4.8
diff --git a/E2Manager/go.mod b/E2Manager/go.mod
index 1195401..0339b3c 100644
--- a/E2Manager/go.mod
+++ b/E2Manager/go.mod
@@ -23,6 +23,7 @@
google.golang.org/appengine v1.6.1 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v2 v2.2.8
+ k8s.io/apimachinery v0.17.0
k8s.io/client-go v0.17.0
)
diff --git a/E2Manager/managers/e2t_shutdown_manager.go b/E2Manager/managers/e2t_shutdown_manager.go
index bb89e3b..6287547 100644
--- a/E2Manager/managers/e2t_shutdown_manager.go
+++ b/E2Manager/managers/e2t_shutdown_manager.go
@@ -62,7 +62,7 @@
return nil
}
- go m.kubernetesManager.DeletePod(e2tInstance.PodName)
+ //go m.kubernetesManager.DeletePod(e2tInstance.PodName)
err := m.markE2tInstanceToBeDeleted(e2tInstance)
if err != nil {
diff --git a/E2Manager/managers/e2t_shutdown_manager_test.go b/E2Manager/managers/e2t_shutdown_manager_test.go
index 7490c42..9e3fcc3 100644
--- a/E2Manager/managers/e2t_shutdown_manager_test.go
+++ b/E2Manager/managers/e2t_shutdown_manager_test.go
@@ -35,8 +35,8 @@
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"io/ioutil"
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/client-go/kubernetes/fake"
+ //"k8s.io/apimachinery/pkg/runtime"
+ //"k8s.io/client-go/kubernetes/fake"
"net/http"
"testing"
"time"
@@ -56,11 +56,14 @@
httpClientMock := &mocks.HttpClientMock{}
rmClient := clients.NewRoutingManagerClient(log, config, httpClientMock)
associationManager := NewE2TAssociationManager(log, rnibDataService, e2tInstancesManager, rmClient)
- kubernetesManager := initKubernetesManagerTest(t)
+ //kubernetesManager := initKubernetesManagerTest(t)
- shutdownManager := NewE2TShutdownManager(log, config, rnibDataService, e2tInstancesManager, associationManager, kubernetesManager)
+ /*shutdownManager := NewE2TShutdownManager(log, config, rnibDataService, e2tInstancesManager, associationManager, kubernetesManager)
- return shutdownManager, readerMock, writerMock, httpClientMock, kubernetesManager
+ return shutdownManager, readerMock, writerMock, httpClientMock, kubernetesManager*/
+ shutdownManager := NewE2TShutdownManager(log, config, rnibDataService, e2tInstancesManager, associationManager, nil)
+
+ return shutdownManager, readerMock, writerMock, httpClientMock, nil
}
func TestShutdownSuccess1OutOf3Instances(t *testing.T) {
@@ -409,7 +412,7 @@
writerMock.AssertExpectations(t)
httpClientMock.AssertExpectations(t)
}
-
+/*
func TestShutdownSuccess2Instance2Rans(t *testing.T) {
shutdownManager, readerMock, writerMock, httpClientMock,kubernetesManager := initE2TShutdownManagerTest(t)
@@ -504,4 +507,4 @@
writerMock.AssertExpectations(t)
httpClientMock.AssertExpectations(t)
})
-}
\ No newline at end of file
+}*/
\ No newline at end of file
diff --git a/E2Manager/managers/kubernetes_manager.go b/E2Manager/managers/kubernetes_manager.go
index 09a64b7..12037bf 100644
--- a/E2Manager/managers/kubernetes_manager.go
+++ b/E2Manager/managers/kubernetes_manager.go
@@ -22,12 +22,8 @@
import (
"e2mgr/configuration"
- "e2mgr/e2managererrors"
"e2mgr/logger"
- metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
- "k8s.io/client-go/tools/clientcmd"
- "path/filepath"
)
type KubernetesManager struct {
@@ -39,12 +35,12 @@
func NewKubernetesManager(logger *logger.Logger, config *configuration.Configuration) *KubernetesManager {
return &KubernetesManager{
Logger: logger,
- ClientSet: createClientSet(logger, config),
+ //ClientSet: createClientSet(logger, config),
Config: config,
}
}
-func createClientSet(logger *logger.Logger, config *configuration.Configuration) kubernetes.Interface {
+/*func createClientSet(logger *logger.Logger, config *configuration.Configuration) kubernetes.Interface {
absConfigPath,err := filepath.Abs(config.Kubernetes.ConfigPath)
if err != nil {
@@ -64,9 +60,9 @@
return nil
}
return clientSet
-}
+}*/
-func (km KubernetesManager) DeletePod(podName string) error {
+/*func (km KubernetesManager) DeletePod(podName string) error {
km.Logger.Infof("#KubernetesManager.DeletePod - POD name: %s ", podName)
if km.ClientSet == nil {
@@ -88,4 +84,4 @@
km.Logger.Infof("#KubernetesManager.DeletePod - POD %s was deleted", podName)
return nil
-}
\ No newline at end of file
+}*/
\ No newline at end of file
diff --git a/E2Manager/managers/kubernetes_manager_test.go b/E2Manager/managers/kubernetes_manager_test.go
index 0b6a568..ef9bcb4 100644
--- a/E2Manager/managers/kubernetes_manager_test.go
+++ b/E2Manager/managers/kubernetes_manager_test.go
@@ -19,7 +19,7 @@
// platform project (RICP).
package managers
-
+/*
import (
"e2mgr/configuration"
@@ -148,4 +148,5 @@
Annotations: map[string]string{},
},
}
-}
\ No newline at end of file
+}
+*/
\ No newline at end of file
diff --git a/E2Manager/resources/configuration.yaml b/E2Manager/resources/configuration.yaml
index 88e276a..d79565b 100644
--- a/E2Manager/resources/configuration.yaml
+++ b/E2Manager/resources/configuration.yaml
@@ -16,7 +16,4 @@
e2tInstanceDeletionTimeoutMs: 15000
globalRicId:
plmnId: 131014
- ricNearRtId: 556670
-kubernetes:
- configPath: ./kube_config.yml
- kubeNamespace: ricplt
\ No newline at end of file
+ ricNearRtId: 556670
\ No newline at end of file