Skip to content

Commit a245e02

Browse files
support http (#36)
1 parent e06d051 commit a245e02

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

cloudshell/amd64/kubecube-chroot.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ fi
5858
wget -d "${headers[@]}" https://kubecube:7443/api/v1/cube/user/kubeconfigs -O $DIR/tmp/$TMP_CONFIG_NAME-base64 --no-check-certificate &> /dev/null
5959
# check whether kubeconfig download success
6060
if [ $? -ne 0 ]; then
61+
wget -d "${headers[@]}" http://kubecube:7443/api/v1/cube/user/kubeconfigs -O $DIR/tmp/$TMP_CONFIG_NAME-base64 --no-check-certificate &> /dev/null
62+
if [ $? -ne 0 ]; then
6163
exit 1
64+
fi
6265
fi
6366

6467
CONFIG_BASE64=$(cat $DIR/tmp/$TMP_CONFIG_NAME-base64)

cloudshell/arm64/kubecube-chroot.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ fi
5858
wget -d "${headers[@]}" https://kubecube:7443/api/v1/cube/user/kubeconfigs -O $DIR/tmp/$TMP_CONFIG_NAME-base64 --no-check-certificate &> /dev/null
5959
# check whether kubeconfig download success
6060
if [ $? -ne 0 ]; then
61+
wget -d "${headers[@]}" http://kubecube:7443/api/v1/cube/user/kubeconfigs -O $DIR/tmp/$TMP_CONFIG_NAME-base64 --no-check-certificate &> /dev/null
62+
if [ $? -ne 0 ]; then
6163
exit 1
64+
fi
6265
fi
6366

6467
CONFIG_BASE64=$(cat $DIR/tmp/$TMP_CONFIG_NAME-base64)

handler/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func isAuthValid(request *restful.Request) bool {
9696
Transport: &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}},
9797
Timeout: 5 * time.Second,
9898
}
99-
resp, err := c.Post("https://"+utils.GetKubeCubeSvc()+"/api/v1/cube/authorization/access",
99+
resp, err := c.Post(utils.GetKubeCubeSvc()+"/api/v1/cube/authorization/access",
100100
"application/json", strings.NewReader(string(bytesData)))
101101
if err != nil {
102102
clog.Error(err.Error())

utils/env.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func GetKubeCubeSvc() string {
2323
if svc != "" {
2424
return svc
2525
}
26-
return "kubecube-nodeport:7443"
26+
return "https://kubecube-nodeport:7443"
2727
}
2828

2929
func getJwtSecret() string {

0 commit comments

Comments
 (0)