Removed hard-coded table name

This commit is contained in:
2024-11-11 06:28:53 +08:00
parent 80ec3e8691
commit a7037ab76d
2 changed files with 22 additions and 21 deletions

View File

@@ -54,7 +54,7 @@ function _kcontext-k8s {
local _NAME _CONF
case $1 in
list)
kstore query -list "SELECT SUBSTR( prop, 5 ) FROM store WHERE key = 'kcontext' AND prop LIKE 'k8s.%'"
kstore query -list "SELECT SUBSTR( prop, 5 ) FROM $_KSTORE_TABLE WHERE key = 'kcontext' AND prop LIKE 'k8s.%'"
return $?
;;
save)
@@ -118,7 +118,7 @@ function _kcontext-k8s {
if [ "$_CONFIRM" != "y" ]; then
return 0
fi
kstore query "DELETE FROM store WHERE key = 'kcontext' AND prop = 'k8s.$_NAME'"
kstore query "DELETE FROM $_KSTORE_TABLE WHERE key = 'kcontext' AND prop = 'k8s.$_NAME'"
return $?
else
echo "No such context: $_NAME" >&2
@@ -138,7 +138,7 @@ function _kcontext-s3-arch {
local _NAME _CONFIRM _URL _AUTH
case $1 in
list)
kstore query -list "SELECT SUBSTR( prop, 16 ) FROM store WHERE key = 'kcontext' AND prop LIKE 's3-arch.bucket.%'"
kstore query -list "SELECT SUBSTR( prop, 16 ) FROM $_KSTORE_TABLE WHERE key = 'kcontext' AND prop LIKE 's3-arch.bucket.%'"
return $?
;;
save)
@@ -199,8 +199,8 @@ function _kcontext-s3-arch {
if [ "$_CONFIRM" != "y" ]; then
return 0
fi
kstore query "DELETE FROM store WHERE key = 'kcontext' AND prop = 's3-arch.bucket.$_NAME'"
kstore query "DELETE FROM store WHERE key = 'kcontext' AND prop = 's3-arch.auth.$_NAME'"
kstore query "DELETE FROM $_KSTORE_TABLE WHERE key = 'kcontext' AND prop = 's3-arch.bucket.$_NAME'"
kstore query "DELETE FROM $_KSTORE_TABLE WHERE key = 'kcontext' AND prop = 's3-arch.auth.$_NAME'"
return $?
else
echo "No such context: $_NAME" >&2