File tree Expand file tree Collapse file tree 9 files changed +27
-15
lines changed Expand file tree Collapse file tree 9 files changed +27
-15
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog:
2
2
3
- * Added cluster commands
3
+ * Fixed cluster-add script
Original file line number Diff line number Diff line change 1
- VERSION =v0.0.287
1
+ VERSION =v0.0.288
2
2
3
3
OUT_DIR =dist
4
4
YEAR? =$(shell date +"% Y")
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ cf version
23
23
24
24
``` bash
25
25
# download and extract the binary
26
- curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.287 /cf-linux-amd64.tar.gz | tar zx
26
+ curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.288 /cf-linux-amd64.tar.gz | tar zx
27
27
28
28
# move the binary to your $PATH
29
29
mv ./cf-linux-amd64 /usr/local/bin/cf
@@ -36,7 +36,7 @@ cf version
36
36
37
37
``` bash
38
38
# download and extract the binary
39
- curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.287 /cf-darwin-amd64.tar.gz | tar zx
39
+ curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.288 /cf-darwin-amd64.tar.gz | tar zx
40
40
41
41
# move the binary to your $PATH
42
42
mv ./cf-darwin-amd64 /usr/local/bin/cf
Original file line number Diff line number Diff line change 4
4
# INGRESS_URL (cm)
5
5
# CONTEXT_NAME (cm)
6
6
# SERVER (cm)
7
+ # CSDP_TOKEN_SECRET
7
8
8
9
echo " ServiceAccount: ${SERVICE_ACCOUNT_NAME} "
9
10
echo " Ingress URL: ${INGRESS_URL} "
@@ -31,18 +32,18 @@ kubectl config set-credentials ${SERVICE_ACCOUNT_NAME} --token ${BEARER_TOKEN}
31
32
kubectl config set-context ${CONTEXT_NAME} --cluster=${CLUSTER_NAME} --user=${SERVICE_ACCOUNT_NAME}
32
33
KUBE_CONFIG_B64=$( kubectl config view --minify --flatten --output json --context=${CONTEXT_NAME} | base64 -w 0)
33
34
34
- RESPONSE =$( curl -X POST ${INGRESS_URL} /app-proxy/api/clusters \
35
+ STATUS_CODE =$( curl -X POST ${INGRESS_URL} /app-proxy/api/clusters \
35
36
-H ' Content-Type: application/json' \
36
37
-H ' Authorization: ' ${CSDP_TOKEN} ' ' \
37
- -d ' { "name": "' ${CONTEXT_NAME} ' ", "kubeConfig": "' ${KUBE_CONFIG_B64} ' " }' )
38
- echo $RESPONSE
39
-
40
- STATUS_CODE= $( echo $RESPONSE | jq .statusCode )
38
+ -d ' { "name": "' ${CONTEXT_NAME} ' ", "kubeConfig": "' ${KUBE_CONFIG_B64} ' " }' \
39
+ -s -o response -w " %{http_code} " )
40
+ cat response
41
+ echo " STATUS_CODE: ${STATUS_CODE} "
41
42
42
43
if [ $STATUS_CODE -ge 300 ]; then
43
44
echo " error creating cluster in runtime"
44
45
exit $STATUS_CODE
45
46
fi
46
47
47
- echo " deleting token secret ${SECRET_NAME } "
48
- kubectl delete secret ${SECRET_NAME } -n ${NAMESPACE}
48
+ echo " deleting token secret ${CSDP_TOKEN_SECRET } "
49
+ kubectl delete secret ${CSDP_TOKEN_SECRET } -n ${NAMESPACE}
Original file line number Diff line number Diff line change @@ -4,6 +4,6 @@ description: This helm chart adds a remote cluster to an existing Codefresh runt
4
4
5
5
type : application
6
6
7
- version : 0.1 .0
7
+ version : 0.2 .0
8
8
9
- appVersion : 0.1 .0
9
+ appVersion : 0.2 .0
Original file line number Diff line number Diff line change 46
46
configMapKeyRef :
47
47
name : {{ include "csdp-add-cluster.fullname" . }}-cm
48
48
key : server
49
+ - name : CSDP_TOKEN_SECRET
50
+ value : {{ include "csdp-add-cluster.fullname" . }}-secret
49
51
resources :
50
52
limits :
51
53
memory : 512Mi
Original file line number Diff line number Diff line change 43
43
configMapKeyRef :
44
44
name : csdp-add-cluster-cm
45
45
key : server
46
+ - name : CSDP_TOKEN_SECRET
47
+ value : $(CSDP_ADD_CLUSTER_SECRET)
46
48
resources :
47
49
limits :
48
50
memory : 512Mi
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ namespace: kube-system
4
4
5
5
images :
6
6
- name : quay.io/codefresh/csdp-add-cluster
7
- newTag : 0.1 .0
7
+ newTag : 0.2 .0
8
8
9
9
resources :
10
10
- configmap.yaml
@@ -13,3 +13,10 @@ resources:
13
13
- job.yaml
14
14
- secret.yaml
15
15
- serviceaccount.yaml
16
+
17
+ vars :
18
+ - name : CSDP_ADD_CLUSTER_SECRET
19
+ objref :
20
+ apiVersion : v1
21
+ kind : Secret
22
+ name : csdp-add-cluster-secret
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ metadata:
5
5
namespace : " {{ namespace }}"
6
6
spec :
7
7
defVersion : 1.0.1
8
- version : 0.0.287
8
+ version : 0.0.288
9
9
bootstrapSpecifier : github.com/codefresh-io/cli-v2/manifests/argo-cd
10
10
components :
11
11
- name : events
You can’t perform that action at this time.
0 commit comments