Skip to content

Commit

Permalink
fix script
Browse files Browse the repository at this point in the history
  • Loading branch information
rcarrata committed Sep 27, 2024
1 parent c8fae53 commit c62645d
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions bootstrap/ic-shared-llm/job-enable-modelcar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOT > 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
Expand Down

0 comments on commit c62645d

Please sign in to comment.