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:
@@ -19,6 +19,7 @@ package operatorapi
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"crypto"
|
"crypto"
|
||||||
|
"crypto/tls"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
@@ -307,6 +308,10 @@ func createOrReplaceExternalCertSecrets(ctx context.Context, clientSet K8sClient
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
// check if the key pair is valid
|
||||||
|
if _, err = tls.X509KeyPair(tlsCrt, tlsKey); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
externalTLSCertificateSecret := &corev1.Secret{
|
externalTLSCertificateSecret := &corev1.Secret{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: keyPairSecretName,
|
Name: keyPairSecretName,
|
||||||
|
|||||||
@@ -312,7 +312,8 @@ const STResults = ({ classes, results, start, autotune }: ISTResults) => {
|
|||||||
{clnMetrics.length <= 1 && (
|
{clnMetrics.length <= 1 && (
|
||||||
<Grid container>
|
<Grid container>
|
||||||
<Grid item xs={12} className={classes.initialResults}>
|
<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>
|
||||||
</Grid>
|
</Grid>
|
||||||
)}
|
)}
|
||||||
@@ -391,9 +392,7 @@ const STResults = ({ classes, results, start, autotune }: ISTResults) => {
|
|||||||
<Grid container>
|
<Grid container>
|
||||||
<Grid item xs={12} md={6} className={classes.descriptorLabel}>
|
<Grid item xs={12} md={6} className={classes.descriptorLabel}>
|
||||||
{start ? (
|
{start ? (
|
||||||
<Fragment>
|
<Fragment>Preliminar Results:</Fragment>
|
||||||
Preliminar Results:
|
|
||||||
</Fragment>
|
|
||||||
) : (
|
) : (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
{jsonView ? "JSON Results:" : "Detailed Results:"}
|
{jsonView ? "JSON Results:" : "Detailed Results:"}
|
||||||
|
|||||||
Reference in New Issue
Block a user