Validate provided external certificates during tenant creation (#1245)

Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>

Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
This commit is contained in:
Lenin Alevski
2021-11-19 16:37:34 -08:00
committed by GitHub
parent 0bbd4f0282
commit 3f60df9071
2 changed files with 8 additions and 4 deletions

View File

@@ -19,6 +19,7 @@ package operatorapi
import (
"context"
"crypto"
"crypto/tls"
"encoding/base64"
"encoding/hex"
"fmt"
@@ -307,6 +308,10 @@ func createOrReplaceExternalCertSecrets(ctx context.Context, clientSet K8sClient
if err != nil {
return nil, err
}
// check if the key pair is valid
if _, err = tls.X509KeyPair(tlsCrt, tlsKey); err != nil {
return nil, err
}
externalTLSCertificateSecret := &corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: keyPairSecretName,

View File

@@ -312,7 +312,8 @@ const STResults = ({ classes, results, start, autotune }: ISTResults) => {
{clnMetrics.length <= 1 && (
<Grid container>
<Grid item xs={12} className={classes.initialResults}>
Please wait while we get {autotune? "the initial" : "the system"} results...
Please wait while we get {autotune ? "the initial" : "the system"}{" "}
results...
</Grid>
</Grid>
)}
@@ -391,9 +392,7 @@ const STResults = ({ classes, results, start, autotune }: ISTResults) => {
<Grid container>
<Grid item xs={12} md={6} className={classes.descriptorLabel}>
{start ? (
<Fragment>
Preliminar Results:
</Fragment>
<Fragment>Preliminar Results:</Fragment>
) : (
<Fragment>
{jsonView ? "JSON Results:" : "Detailed Results:"}