summaryrefslogtreecommitdiffstats
path: root/src/dcm/pkg/module
diff options
context:
space:
mode:
authorIgor D.C <igor.duarte.cardoso@intel.com>2020-10-02 01:40:09 +0000
committerIgor D.C <igor.duarte.cardoso@intel.com>2020-10-02 23:24:52 +0000
commite70a776fd2d16d7d386af0354afd3e086068ef00 (patch)
tree9bfc8337356052c9fa3d856ab632b13234219e92 /src/dcm/pkg/module
parent8eceef201a6252aeab9a5c2410423642b3726910 (diff)
DCM E2E testing fixes
A set of small fixes after discovery during DCM's end-to-end testing: - properly detect that a cert hasn't been issued yet (don't crash) - in Monitor, don't pass namespace when querying for CSRs - fixed incorrect /kubeconfig file encoding from yaml to json Issue-ID: MULTICLOUD-1143 Change-Id: Ie813e377070b0751f0bfdabac8da50e3288090de Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
Diffstat (limited to 'src/dcm/pkg/module')
-rw-r--r--src/dcm/pkg/module/cluster.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dcm/pkg/module/cluster.go b/src/dcm/pkg/module/cluster.go
index 253b37a3..33de7acf 100644
--- a/src/dcm/pkg/module/cluster.go
+++ b/src/dcm/pkg/module/cluster.go
@@ -315,6 +315,10 @@ func (v *ClusterClient) GetClusterConfig(project, logicalCloud, clusterReference
return "", pkgerrors.Wrap(err, "An error occurred while parsing the cluster status.")
}
+ if len(rbstatus.CsrStatuses) == 0 {
+ return "", pkgerrors.New("The certificate for this cluster hasn't been issued yet. Please try later.")
+ }
+
// validate that we indeed obtained a certificate before persisting it in the database:
approved := false
for _, c := range rbstatus.CsrStatuses[0].Status.Conditions {