Creates the SSL Temp directory inside the Default SSL Directory

This commit is contained in:
Ricardo Pchevuzinske Katz 2017-01-24 10:32:00 -02:00
parent 74512c1276
commit c4307b8e78
3 changed files with 4 additions and 1 deletions

View file

@ -132,6 +132,8 @@ func NewIngressController(backend ingress.Controller) *GenericController {
}
os.MkdirAll(ingress.DefaultSSLDirectory, 0655)
// Creates a temp directory for Certificates, as 'rename' functions need to be in the same mount point as the Certificates
os.MkdirAll(ingress.TempSSLDirectory,0655)
config := &Configuration{
UpdateStatus: *updateStatus,

View file

@ -36,6 +36,7 @@ var (
// The name of each file is <namespace>-<secret name>.pem. The content is the concatenated
// certificate and key.
DefaultSSLDirectory = "/ingress-controller/ssl"
TempSSLDirectory = "/ingress-controller/ssl/temp"
)
// Controller holds the methods to handle an Ingress backend

View file

@ -36,7 +36,7 @@ func AddOrUpdateCertAndKey(name string, cert, key, ca []byte) (*ingress.SSLCert,
pemName := fmt.Sprintf("%v.pem", name)
pemFileName := fmt.Sprintf("%v/%v", ingress.DefaultSSLDirectory, pemName)
tempPemFile, err := ioutil.TempFile("", pemName)
tempPemFile, err := ioutil.TempFile(ingress.TempSSLDirectory, pemName)
if err != nil {
return nil, fmt.Errorf("could not create temp pem file %v: %v", tempPemFile.Name(), err)
}