wso2 / k8s-api-operator

API Operator for Kubernetes
Apache License 2.0
115 stars 48 forks source link

keytool not found error - microgateway toolkit 3.2.0 #586

Closed renuka-fernando closed 3 years ago

renuka-fernando commented 3 years ago

Description: Error from Kaniko, MG toolkit

Running: [/bin/sh -c echo yes | /home/ballerina/wso2/lib/jdk8*/bin/keytool -import  -storepass ballerina -keystore /home/ballerina/wso2/runtime/bre/security/ballerinaTruststore.p12 -alias "wso2am320-secret-security" -file /usr/wso2/certs/wso2am320-secret/server.pem]
/bin/sh: /home/ballerina/wso2/lib/jdk8*/bin/keytool: not found

Tested with pulling latest wso2am/wso2micro-gw-toolkit:3.2.0 as on 20/04/2021

docker run -d wso2am/wso2micro-gw-toolkit:3.2.0 sleep 36000
docker exec -it 49a8c84cef52 sh
/ # cd /home/ballerina/
/home/ballerina # ls
wso2am-micro-gw-toolkit-linux-3.2.0

Just keytool without any location worked

keytool --help
Key and Certificate Management Tool

Commands:

 -certreq            Generates a certificate request
 -changealias        Changes an entry's alias
 -delete             Deletes an entry
 -exportcert         Exports certificate
 -genkeypair         Generates a key pair
 -genseckey          Generates a secret key
 -gencert            Generates certificate from a certificate request
 -importcert         Imports a certificate or a certificate chain
 -importpass         Imports a password
 -importkeystore     Imports one or all entries from another keystore
 -keypasswd          Changes the key password of an entry
 -list               Lists entries in a keystore
 -printcert          Prints the content of a certificate
 -printcertreq       Prints the content of a certificate request
 -printcrl           Prints the content of a CRL file
 -storepasswd        Changes the store password of a keystore

Affected Product Version: 1.2.2

renuka-fernando commented 3 years ago

importing certs are done through the keytool of MG runtime image, not the MG toolkit. closing the issue, since it is not a bug