diff options
Diffstat (limited to 'src/k8splugin/plugins')
-rw-r--r-- | src/k8splugin/plugins/deployment/plugin.go | 2 | ||||
-rw-r--r-- | src/k8splugin/plugins/deployment/plugin_test.go | 4 | ||||
-rw-r--r-- | src/k8splugin/plugins/service/plugin.go | 1 | ||||
-rw-r--r-- | src/k8splugin/plugins/service/plugin_test.go | 4 |
4 files changed, 2 insertions, 9 deletions
diff --git a/src/k8splugin/plugins/deployment/plugin.go b/src/k8splugin/plugins/deployment/plugin.go index b500c86e..7ac31753 100644 --- a/src/k8splugin/plugins/deployment/plugin.go +++ b/src/k8splugin/plugins/deployment/plugin.go @@ -41,8 +41,6 @@ func Create(data *utils.ResourceData, client kubernetes.Interface) (string, erro return "", pkgerrors.New("Decoded object contains another resource different than Deployment") } deployment.Namespace = namespace - deployment.Name = data.VnfId + "-" + deployment.Name - result, err := client.AppsV1().Deployments(namespace).Create(deployment) if err != nil { return "", pkgerrors.Wrap(err, "Create Deployment error") diff --git a/src/k8splugin/plugins/deployment/plugin_test.go b/src/k8splugin/plugins/deployment/plugin_test.go index 55e0c803..446f3329 100644 --- a/src/k8splugin/plugins/deployment/plugin_test.go +++ b/src/k8splugin/plugins/deployment/plugin_test.go @@ -28,7 +28,6 @@ import ( func TestCreateDeployment(t *testing.T) { namespace := "test1" name := "mock-deployment" - internalVNFID := "1" testCases := []struct { label string input *utils.ResourceData @@ -47,7 +46,6 @@ func TestCreateDeployment(t *testing.T) { { label: "Successfully create a deployment", input: &utils.ResourceData{ - VnfId: internalVNFID, YamlFilePath: "../../mock_files/mock_yamls/deployment.yaml", }, clientOutput: &appsV1.Deployment{ @@ -56,7 +54,7 @@ func TestCreateDeployment(t *testing.T) { Namespace: namespace, }, }, - expectedResult: internalVNFID + "-" + name, + expectedResult: name, }, } diff --git a/src/k8splugin/plugins/service/plugin.go b/src/k8splugin/plugins/service/plugin.go index e9b45fc8..ea5aecad 100644 --- a/src/k8splugin/plugins/service/plugin.go +++ b/src/k8splugin/plugins/service/plugin.go @@ -42,7 +42,6 @@ func Create(data *utils.ResourceData, client kubernetes.Interface) (string, erro return "", pkgerrors.New("Decoded object contains another resource different than Service") } service.Namespace = namespace - service.Name = data.VnfId + "-" + service.Name result, err := client.CoreV1().Services(namespace).Create(service) if err != nil { diff --git a/src/k8splugin/plugins/service/plugin_test.go b/src/k8splugin/plugins/service/plugin_test.go index 7353f24b..d3614860 100644 --- a/src/k8splugin/plugins/service/plugin_test.go +++ b/src/k8splugin/plugins/service/plugin_test.go @@ -28,7 +28,6 @@ import ( func TestCreateService(t *testing.T) { namespace := "test1" name := "mock-service" - internalVNFID := "1" testCases := []struct { label string input *utils.ResourceData @@ -47,7 +46,6 @@ func TestCreateService(t *testing.T) { { label: "Successfully create a service", input: &utils.ResourceData{ - VnfId: internalVNFID, YamlFilePath: "../../mock_files/mock_yamls/service.yaml", }, clientOutput: &coreV1.Service{ @@ -56,7 +54,7 @@ func TestCreateService(t *testing.T) { Namespace: namespace, }, }, - expectedResult: internalVNFID + "-" + name, + expectedResult: name, }, } |