Commit aa2faac 1 parent 6e1b138 commit aa2faac Copy full SHA for aa2faac
File tree 2 files changed +75
-0
lines changed
2 files changed +75
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ FILE=$1 .json
4
+ TARGET=$1
5
+ CLIENT_TOKEN=$2
6
+ curl --insecure --silent --header " Authorization: Bearer $CLIENT_TOKEN " ' https://oran-o2ims.apps.hub0.inbound-int.se-lab.eng.rdu2.dc.redhat.com/o2ims-infrastructureInventory/v1/deploymentManagers/' ${TARGET} | jq > ${FILE}
7
+
8
+ user=$( cat $FILE | jq .extensions.profileData.admin_user)
9
+ cluster_ca_cert=$( cat $FILE | jq .extensions.profileData.cluster_ca_cert)
10
+ cluster_api_endpoint=$( cat $FILE | jq .extensions.profileData.cluster_api_endpoint)
11
+ admin_client_cert=$( cat $FILE | jq .extensions.profileData.admin_client_cert)
12
+ admin_client_key=$( cat $FILE | jq .extensions.profileData.admin_client_key)
13
+ rm -f $FILE
14
+
15
+ echo -n "
16
+ apiVersion: v1
17
+ clusters:
18
+ - cluster:
19
+ certificate-authority-data: $cluster_ca_cert
20
+ server: $cluster_api_endpoint
21
+ name: cluster
22
+ contexts:
23
+ - context:
24
+ cluster: cluster
25
+ namespace: default
26
+ user: admin
27
+ name: admin
28
+ current-context: $user
29
+ kind: Config
30
+ preferences: {}
31
+ users:
32
+ - name: admin
33
+ user:
34
+ client-certificate-data: $admin_client_cert
35
+ client-key-data: $admin_client_key
36
+ " > ${TARGET} .kubeconfig
Original file line number Diff line number Diff line change
1
+ apiVersion : oran.openshift.io/v1alpha1
2
+ kind : ORANO2IMS
3
+ metadata :
4
+ annotations :
5
+ labels :
6
+ app.kubernetes.io/created-by : oran-o2ims
7
+ app.kubernetes.io/instance : orano2ims-sample
8
+ app.kubernetes.io/managed-by : kustomize
9
+ app.kubernetes.io/name : orano2ims
10
+ app.kubernetes.io/part-of : oran-o2ims
11
+ name : sample
12
+ namespace : oran-o2ims
13
+ spec :
14
+ alarmSubscriptionServerConfig :
15
+ enabled : false
16
+ cloudId : c0332915-6bff-4d8d-8628-0ab3cc2c7e5e
17
+ deploymentManagerServerConfig :
18
+ backendToken : $BACKEND_TOKEN
19
+ backendType : regular-hub
20
+ enabled : true
21
+ extensions :
22
+ - ' {"hardware": {cpu: .status.capacity.cpu, memory: .status.capacity.memory, k8s_version: .status.version.kubernetes}}'
23
+ - ' {"claims": {cluster_product: .status.clusterClaims[]|select(.name =="product.open-cluster-management.io").value,
24
+ cluster_version: .status.clusterClaims[]| select(.name == "version.openshift.io").value,
25
+ cluster_topology: .status.clusterClaims[]|select(.name =="controlplanetopology.openshift.io").value}}'
26
+ - |
27
+ .metadata.labels["name"] as $name |
28
+ {
29
+ name: $name,
30
+ alias: $name
31
+ }
32
+ image : quay.io/imihai/oran-o2ims:4.16.0
33
+ ingressHost : oran-o2ims.apps.hub0.inbound-int.se-lab.eng.rdu2.dc.redhat.com
34
+ metadataServerConfig :
35
+ enabled : true
36
+ resourceServerConfig :
37
+ backendToken : $BACKEND_TOKEN_RS
38
+ backendURL : https://search-api-open-cluster-management.apps.hub0.inbound-int.se-lab.eng.rdu2.dc.redhat.com
39
+ enabled : true
You can’t perform that action at this time.
0 commit comments