From c62645d59c30ca4c709f9758f56288dd4ea538c6 Mon Sep 17 00:00:00 2001 From: rcarrata Date: Fri, 27 Sep 2024 20:45:29 +0200 Subject: [PATCH] fix script --- bootstrap/ic-shared-llm/job-enable-modelcar.yaml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/bootstrap/ic-shared-llm/job-enable-modelcar.yaml b/bootstrap/ic-shared-llm/job-enable-modelcar.yaml index 270ff667..390f129e 100644 --- a/bootstrap/ic-shared-llm/job-enable-modelcar.yaml +++ b/bootstrap/ic-shared-llm/job-enable-modelcar.yaml @@ -28,20 +28,12 @@ spec: # Fetch current storageInitializer config config=$(oc get configmap inferenceservice-config -n redhat-ods-applications -o jsonpath='{.data.storageInitializer}') - # Modify the config to enable modelcar (without jq, using sed) + # Modify the config to enable modelcar using sed newValue=$(echo "$config" | sed 's/"enableModelcar": false/"enableModelcar": true/') + newValueEscaped=$(echo "$newValue" | sed 's/\"/\\\"/g') - # Create a patch using the updated config - cat < patch.txt - [{ - "op": "replace", - "path": "/data/storageInitializer", - "value": "$newValue" - }] - EOT - - # Apply the patch to the ConfigMap - oc patch configmap inferenceservice-config -n redhat-ods-applications --type=json --patch-file=patch.txt + # Patch the configmap with the new value + oc patch configmap inferenceservice-config -n redhat-ods-applications --type='json' -p "[{\"op\": \"replace\", \"path\": \"/data/storageInitializer\", \"value\": \"$newValueEscaped\"}]" # Restart the KServe controller to apply changes oc delete pod -n redhat-ods-applications -l control-plane=kserve-controller-manager