diff options
author | Rajamohan Raj <rajamohan.raj@intel.com> | 2020-05-26 20:08:58 +0000 |
---|---|---|
committer | Rajamohan Raj <rajamohan.raj@intel.com> | 2020-06-01 18:45:54 +0000 |
commit | c257a136355a794f5bf778f670c041e8958c3608 (patch) | |
tree | e642dae19b2dd8fade13de9342a9dee76d884589 /kud/tests | |
parent | 7959bd4c6fd403cf4ba58bf572b1259267b3c76d (diff) |
Adding cluster meta data and saving in etcd
As part of this patch, we assign groupNumbers
for the set of clusters which are under anyOf, or
in other words are optional for deployement of
app.
Also refactored the instantiation flow by separating
out the etcd interactions
Issue-ID: MULTICLOUD-1064
Signed-off-by: Rajamohan Raj <rajamohan.raj@intel.com>
Change-Id: I21ece189daf6e6b3a7cfdba5df22d57b3d33ca78
Diffstat (limited to 'kud/tests')
-rwxr-xr-x | kud/tests/plugin_ncm_v2.sh | 61 |
1 files changed, 60 insertions, 1 deletions
diff --git a/kud/tests/plugin_ncm_v2.sh b/kud/tests/plugin_ncm_v2.sh index b7d791f3..579fda31 100755 --- a/kud/tests/plugin_ncm_v2.sh +++ b/kud/tests/plugin_ncm_v2.sh @@ -44,6 +44,10 @@ clusterName3="clusterName3" cluster_desc3="cluster_desc3" clusterName4="clusterName4" cluster_desc4="cluster_desc4" +clusterName5="clusterName5" +cluster_desc5="cluster_desc5" +clusterName6="clusterName6" +cluster_desc6="cluster_desc6" clusterLabel1="clusterLabel1" clusterLabel2="clusterLabel2" @@ -54,6 +58,8 @@ clusterLabel2="clusterLabel2" print_msg "Deleting the clusterLabel1 and clusterLabel2, if they were existing" delete_resource "${base_url}/cluster-providers/${cluster_provider_name1}/clusters/${clusterName3}/labels/${clusterLabel1}" delete_resource "${base_url}/cluster-providers/${cluster_provider_name2}/clusters/${clusterName4}/labels/${clusterLabel2}" +delete_resource "${base_url}/cluster-providers/${cluster_provider_name1}/clusters/${clusterName5}/labels/${clusterLabel1}" +delete_resource "${base_url}/cluster-providers/${cluster_provider_name2}/clusters/${clusterName6}/labels/${clusterLabel2}" # Above statements delete the clusterLabel1 and clusterLabel2 which are linked to cluster3 and cluster4 print_msg "Deleting the cluster1, cluster2, cluster3, cluster4 if they were existing" @@ -61,6 +67,8 @@ delete_resource "${base_url}/cluster-providers/${cluster_provider_name1}/cluster delete_resource "${base_url}/cluster-providers/${cluster_provider_name2}/clusters/${clusterName2}" delete_resource "${base_url}/cluster-providers/${cluster_provider_name1}/clusters/${clusterName3}" delete_resource "${base_url}/cluster-providers/${cluster_provider_name2}/clusters/${clusterName4}" +delete_resource "${base_url}/cluster-providers/${cluster_provider_name1}/clusters/${clusterName5}" +delete_resource "${base_url}/cluster-providers/${cluster_provider_name2}/clusters/${clusterName6}" print_msg "Deleting the cluster-providers, if they were existing" delete_resource "${base_url}/cluster-providers/${cluster_provider_name1}" @@ -172,6 +180,39 @@ call_api -F "metadata=$payload" \ -F "file=@$kubeconfig_path" \ "${base_url}/cluster-providers/${cluster_provider_name2}/clusters" >/dev/null #massive output +print_msg "Registering cluster5" +payload="$(cat <<EOF +{ + "metadata": { + "name": "${clusterName5}", + "description": "${cluster_desc5}", + "userData1": "${userData1}", + "userData2": "${userData2}" + } +} +EOF +)" +call_api -F "metadata=$payload" \ + -F "file=@$kubeconfig_path" \ + "${base_url}/cluster-providers/${cluster_provider_name1}/clusters" >/dev/null #massive output + + +print_msg "Registering cluster6" +payload="$(cat <<EOF +{ + "metadata": { + "name": "${clusterName6}", + "description": "${cluster_desc6}", + "userData1": "${userData1}", + "userData2": "${userData2}" + } +} +EOF +)" +call_api -F "metadata=$payload" \ + -F "file=@$kubeconfig_path" \ + "${base_url}/cluster-providers/${cluster_provider_name2}/clusters" >/dev/null #massive output + # END : Register cluster1, cluster2, cluster3 and cluster4 @@ -185,7 +226,7 @@ EOF )" call_api -d "${payload}" "${base_url}/cluster-providers/${cluster_provider_name1}/clusters/${clusterName3}/labels" -print_msg "Adding label to cluster2" +print_msg "Adding label to cluster4" payload="$(cat <<EOF { "label-name" : "${clusterLabel2}" @@ -194,3 +235,21 @@ EOF )" call_api -d "${payload}" "${base_url}/cluster-providers/${cluster_provider_name2}/clusters/${clusterName4}/labels" +# BEGIN: adding labels to cluster5 and cluster6. Cluster5 to label1 and cluster6 to label2 +print_msg "Adding label to cluster5" +payload="$(cat <<EOF +{ + "label-name" : "${clusterLabel1}" +} +EOF +)" +call_api -d "${payload}" "${base_url}/cluster-providers/${cluster_provider_name1}/clusters/${clusterName5}/labels" + +print_msg "Adding label to cluster6" +payload="$(cat <<EOF +{ + "label-name" : "${clusterLabel2}" +} +EOF +)" +call_api -d "${payload}" "${base_url}/cluster-providers/${cluster_provider_name2}/clusters/${clusterName6}/labels"
\ No newline at end of file |