fekitibi commented on code in PR #12484:
URL: https://github.com/apache/apisix/pull/12484#discussion_r2282793701


##########
.github/workflows/source-install.yml:
##########
@@ -89,10 +89,24 @@ jobs:
         run: |
           wget 
https://github.com/mikefarah/yq/releases/download/3.4.1/yq_linux_amd64 -O 
/usr/bin/yq && sudo chmod +x /usr/bin/yq
           get_admin_key() {
+              # First try to get the key from config.yaml
               local admin_key=$(yq '.deployment.admin.admin_key[0].key' 
conf/config.yaml)
+              # If the key is empty (auto-generated), extract it from logs
+              if [ -z "$admin_key" ] || [ "$admin_key" = "''" ] || [ 
"$admin_key" = "null" ]; then

Review Comment:
   Done



##########
.github/workflows/source-install.yml:
##########
@@ -89,10 +89,24 @@ jobs:
         run: |
           wget 
https://github.com/mikefarah/yq/releases/download/3.4.1/yq_linux_amd64 -O 
/usr/bin/yq && sudo chmod +x /usr/bin/yq
           get_admin_key() {
+              # First try to get the key from config.yaml
               local admin_key=$(yq '.deployment.admin.admin_key[0].key' 
conf/config.yaml)
+              # If the key is empty (auto-generated), extract it from logs
+              if [ -z "$admin_key" ] || [ "$admin_key" = "''" ] || [ 
"$admin_key" = "null" ]; then
+                  admin_key=$(grep -A 10 "Generated admin keys for this 
session:" logs/error.log | grep -E "^  [A-Za-z0-9]{32}$" | head -1 | sed 's/^  
//')
+              fi
               echo "$admin_key"
           }
           export admin_key=$(get_admin_key); echo $admin_key
+          # Validate that we have a valid admin key
+          if [ -z "$admin_key" ] || [ "$admin_key" = "null" ]; then
+              echo "ERROR: Could not obtain valid admin key"
+              echo "Config file content:"
+              cat conf/config.yaml
+              echo "Error log content:"
+              cat logs/error.log

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to