Removes wrong secret enqueing and improve the Fake Cert generation

This commit is contained in:
Ricardo Pchevuzinske Katz 2017-03-06 16:29:33 -03:00
parent 6c1b45a663
commit 51235a38e8
3 changed files with 11 additions and 28 deletions

View file

@ -78,6 +78,7 @@ func AddOrUpdateCertAndKey(name string, cert, key, ca []byte) (*ingress.SSLCert,
// If the file does not start with 'BEGIN CERTIFICATE' it's invalid and must not be used.
if pemBlock.Type != "CERTIFICATE" {
_ = os.Remove(tempPemFile.Name())
return nil, fmt.Errorf("Certificate %v contains invalid data, and must be created with 'kubectl create secret tls'", name)
}