From 3e43b0f43537a8b40672627797d8a83911389a14 Mon Sep 17 00:00:00 2001 From: Fran Slot Date: Mon, 5 Feb 2024 13:19:59 +0100 Subject: [PATCH 1/5] Added image pull policy --- .../bootstrap/files/student-manifest-template.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/RAP4/customizations/bootstrap/files/student-manifest-template.yaml b/RAP4/customizations/bootstrap/files/student-manifest-template.yaml index 93692189..07895ad4 100644 --- a/RAP4/customizations/bootstrap/files/student-manifest-template.yaml +++ b/RAP4/customizations/bootstrap/files/student-manifest-template.yaml @@ -45,6 +45,7 @@ spec: - containerPort: 80 command: ["bash", "/run-student-prototype.sh"] args: [{{zipContent}},{{mainAdl}}] + imagePullPolicy: Always --- # student-prototype user service apiVersion: v1 From ebe4e29778909391585a245193b5ce7ec76fea94 Mon Sep 17 00:00:00 2001 From: hoeleboele Date: Tue, 6 Feb 2024 14:55:57 +0100 Subject: [PATCH 2/5] added getimagecommand --- .../bootstrap/files/ExecEngineFunctions.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/RAP4/customizations/bootstrap/files/ExecEngineFunctions.php b/RAP4/customizations/bootstrap/files/ExecEngineFunctions.php index 2fee6f68..73cc4f4f 100644 --- a/RAP4/customizations/bootstrap/files/ExecEngineFunctions.php +++ b/RAP4/customizations/bootstrap/files/ExecEngineFunctions.php @@ -360,7 +360,17 @@ */ $namespace=getenv('RAP_KUBERNETES_NAMESPACE'); - $containerImage=getenv('RAP_STUDENT_PROTO_IMAGE'); + + $getImageCommand = new Command( + "kubectl get deployment flags", + [ "-o=jsonpath='{$.spec.template.spec.containers[0].image}'" + ], + $ee->getLogger() + ); + + $getImageCommand->execute(); + + $containerImage=$getImageCommand->getResponse(); $hostname=getenv('RAP_HOST_NAME'); $hostname="{$userName}.{$hostname}"; From 5a92e835ba71f7f951d823f01fc919e3252ee620 Mon Sep 17 00:00:00 2001 From: Fran Slot Date: Tue, 6 Feb 2024 17:45:54 +0100 Subject: [PATCH 3/5] #354: Fixed the getImageCommand --- RAP4/customizations/bootstrap/files/ExecEngineFunctions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RAP4/customizations/bootstrap/files/ExecEngineFunctions.php b/RAP4/customizations/bootstrap/files/ExecEngineFunctions.php index 73cc4f4f..ab5fc544 100644 --- a/RAP4/customizations/bootstrap/files/ExecEngineFunctions.php +++ b/RAP4/customizations/bootstrap/files/ExecEngineFunctions.php @@ -362,7 +362,7 @@ $namespace=getenv('RAP_KUBERNETES_NAMESPACE'); $getImageCommand = new Command( - "kubectl get deployment flags", + "kubectl get deployment/student-prototype{$suffix} -n {$namespace}", [ "-o=jsonpath='{$.spec.template.spec.containers[0].image}'" ], $ee->getLogger() From 26876e974225c63eb301b052183d7ede3a061446 Mon Sep 17 00:00:00 2001 From: Fran Slot Date: Wed, 7 Feb 2024 11:37:25 +0100 Subject: [PATCH 4/5] #354: Reverted imagepullpolicy --- .../bootstrap/files/student-manifest-template.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/RAP4/customizations/bootstrap/files/student-manifest-template.yaml b/RAP4/customizations/bootstrap/files/student-manifest-template.yaml index 07895ad4..93692189 100644 --- a/RAP4/customizations/bootstrap/files/student-manifest-template.yaml +++ b/RAP4/customizations/bootstrap/files/student-manifest-template.yaml @@ -45,7 +45,6 @@ spec: - containerPort: 80 command: ["bash", "/run-student-prototype.sh"] args: [{{zipContent}},{{mainAdl}}] - imagePullPolicy: Always --- # student-prototype user service apiVersion: v1 From 785b324932ab6e9ffafa7f7bed6c36acb40a0a43 Mon Sep 17 00:00:00 2001 From: NewUser-Dot-JPG Date: Mon, 12 Feb 2024 14:58:37 +0100 Subject: [PATCH 5/5] Update ExecEngineFunctions.php --- RAP4/customizations/bootstrap/files/ExecEngineFunctions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RAP4/customizations/bootstrap/files/ExecEngineFunctions.php b/RAP4/customizations/bootstrap/files/ExecEngineFunctions.php index ab5fc544..6857eb2b 100644 --- a/RAP4/customizations/bootstrap/files/ExecEngineFunctions.php +++ b/RAP4/customizations/bootstrap/files/ExecEngineFunctions.php @@ -360,10 +360,11 @@ */ $namespace=getenv('RAP_KUBERNETES_NAMESPACE'); + $suffix=substr($namespace, 3); $getImageCommand = new Command( "kubectl get deployment/student-prototype{$suffix} -n {$namespace}", - [ "-o=jsonpath='{$.spec.template.spec.containers[0].image}'" + [ "-o=jsonpath='{\$.spec.template.spec.containers[0].image}'" ], $ee->getLogger() ); @@ -375,7 +376,6 @@ $hostname=getenv('RAP_HOST_NAME'); $hostname="{$userName}.{$hostname}"; - $suffix=substr($namespace, 3); $dbName="rap-db{$suffix}";