From 84cd63700ca54a9c62c3ab2454556a3a5d9ef679 Mon Sep 17 00:00:00 2001
From: Lluis Gifre <lluis.gifre@cttc.es>
Date: Tue, 26 Jul 2022 15:32:30 +0000
Subject: [PATCH] Fixed
 L3_AttackMitigator/L3_CentralizedAttackDetector/L3_DistributedAttackDetector

- Arranged requirement versions of L3 CentralizedAttackDetector
- Fixed object names in L3_* manifest files
- Corrected error with log file name generated for deploy stages during TFS deployment.
---
 deploy_in_kubernetes.sh                            |  2 +-
 manifests/l3_attackmitigatorservice.yaml           | 10 +++++-----
 manifests/l3_centralizedattackdetectorservice.yaml | 10 +++++-----
 manifests/l3_distributedattackdetectorservice.yaml | 10 +++++-----
 src/l3_centralizedattackdetector/requirements.in   |  4 ++--
 5 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/deploy_in_kubernetes.sh b/deploy_in_kubernetes.sh
index a1b4551dd..c81bfc5f1 100755
--- a/deploy_in_kubernetes.sh
+++ b/deploy_in_kubernetes.sh
@@ -110,7 +110,7 @@ for COMPONENT in $COMPONENTS; do
     fi
 
     echo "  Deploying '$COMPONENT' component to Kubernetes..."
-    DEPLOY_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}.log"
+    DEPLOY_LOG="$TMP_LOGS_FOLDER/deploy_${COMPONENT}.log"
     kubectl --namespace $K8S_NAMESPACE apply -f "$MANIFEST" > "$DEPLOY_LOG"
     kubectl --namespace $K8S_NAMESPACE scale deployment --replicas=0 ${COMPONENT}service >> "$DEPLOY_LOG"
     kubectl --namespace $K8S_NAMESPACE scale deployment --replicas=1 ${COMPONENT}service >> "$DEPLOY_LOG"
diff --git a/manifests/l3_attackmitigatorservice.yaml b/manifests/l3_attackmitigatorservice.yaml
index 2240776eb..a0d1b3295 100644
--- a/manifests/l3_attackmitigatorservice.yaml
+++ b/manifests/l3_attackmitigatorservice.yaml
@@ -15,15 +15,15 @@
 apiVersion: apps/v1
 kind: Deployment
 metadata:
-  name: l3-attackmitigatorservice
+  name: l3_attackmitigatorservice
 spec:
   selector:
     matchLabels:
-      app: l3-attackmitigatorservice
+      app: l3_attackmitigatorservice
   template:
     metadata:
       labels:
-        app: l3-attackmitigatorservice
+        app: l3_attackmitigatorservice
     spec:
       terminationGracePeriodSeconds: 5
       containers:
@@ -52,11 +52,11 @@ spec:
 apiVersion: v1
 kind: Service
 metadata:
-  name: l3-attackmitigatorservice
+  name: l3_attackmitigatorservice
 spec:
   type: ClusterIP
   selector:
-    app: l3-attackmitigatorservice
+    app: l3_attackmitigatorservice
   ports:
   - name: grpc
     port: 10002
diff --git a/manifests/l3_centralizedattackdetectorservice.yaml b/manifests/l3_centralizedattackdetectorservice.yaml
index fa7ee9dcc..a41e76f2b 100644
--- a/manifests/l3_centralizedattackdetectorservice.yaml
+++ b/manifests/l3_centralizedattackdetectorservice.yaml
@@ -15,15 +15,15 @@
 apiVersion: apps/v1
 kind: Deployment
 metadata:
-  name: l3-centralizedattackdetectorservice
+  name: l3_centralizedattackdetectorservice
 spec:
   selector:
     matchLabels:
-      app: l3-centralizedattackdetectorservice
+      app: l3_centralizedattackdetectorservice
   template:
     metadata:
       labels:
-        app: l3-centralizedattackdetectorservice
+        app: l3_centralizedattackdetectorservice
     spec:
       terminationGracePeriodSeconds: 5
       containers:
@@ -52,11 +52,11 @@ spec:
 apiVersion: v1
 kind: Service
 metadata:
-  name: l3-centralizedattackdetectorservice
+  name: l3_centralizedattackdetectorservice
 spec:
   type: ClusterIP
   selector:
-    app: l3-centralizedattackdetectorservice
+    app: l3_centralizedattackdetectorservice
   ports:
   - name: grpc
     port: 10001
diff --git a/manifests/l3_distributedattackdetectorservice.yaml b/manifests/l3_distributedattackdetectorservice.yaml
index 6b28f68dd..537915a39 100644
--- a/manifests/l3_distributedattackdetectorservice.yaml
+++ b/manifests/l3_distributedattackdetectorservice.yaml
@@ -15,15 +15,15 @@
 apiVersion: apps/v1
 kind: Deployment
 metadata:
-  name: l3-distributedattackdetectorservice
+  name: l3_distributedattackdetectorservice
 spec:
   selector:
     matchLabels:
-      app: l3-distributedattackdetectorservice
+      app: l3_distributedattackdetectorservice
   template:
     metadata:
       labels:
-        app: l3-distributedattackdetectorservice
+        app: l3_distributedattackdetectorservice
     spec:
       terminationGracePeriodSeconds: 5
       containers:
@@ -52,11 +52,11 @@ spec:
 apiVersion: v1
 kind: Service
 metadata:
-  name: l3-distributedattackdetectorservice
+  name: l3_distributedattackdetectorservice
 spec:
   type: ClusterIP
   selector:
-    app: l3-distributedattackdetectorservice
+    app: l3_distributedattackdetectorservice
   ports:
   - name: grpc
     port: 10000
diff --git a/src/l3_centralizedattackdetector/requirements.in b/src/l3_centralizedattackdetector/requirements.in
index 9a1a05518..9e25a1c28 100644
--- a/src/l3_centralizedattackdetector/requirements.in
+++ b/src/l3_centralizedattackdetector/requirements.in
@@ -1,3 +1,3 @@
 numpy==1.23.*
-scikit-learn==1.12.*
-onnxruntime==1.1.*
+onnxruntime==1.12.*
+scikit-learn==1.1.*
-- 
GitLab