Creates the SSL Temp directory inside the Default SSL Directory
This commit is contained in:
parent
74512c1276
commit
c4307b8e78
3 changed files with 4 additions and 1 deletions
|
@ -132,6 +132,8 @@ func NewIngressController(backend ingress.Controller) *GenericController {
|
||||||
}
|
}
|
||||||
|
|
||||||
os.MkdirAll(ingress.DefaultSSLDirectory, 0655)
|
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{
|
config := &Configuration{
|
||||||
UpdateStatus: *updateStatus,
|
UpdateStatus: *updateStatus,
|
||||||
|
|
|
@ -36,6 +36,7 @@ var (
|
||||||
// The name of each file is <namespace>-<secret name>.pem. The content is the concatenated
|
// The name of each file is <namespace>-<secret name>.pem. The content is the concatenated
|
||||||
// certificate and key.
|
// certificate and key.
|
||||||
DefaultSSLDirectory = "/ingress-controller/ssl"
|
DefaultSSLDirectory = "/ingress-controller/ssl"
|
||||||
|
TempSSLDirectory = "/ingress-controller/ssl/temp"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Controller holds the methods to handle an Ingress backend
|
// Controller holds the methods to handle an Ingress backend
|
||||||
|
|
|
@ -36,7 +36,7 @@ func AddOrUpdateCertAndKey(name string, cert, key, ca []byte) (*ingress.SSLCert,
|
||||||
pemName := fmt.Sprintf("%v.pem", name)
|
pemName := fmt.Sprintf("%v.pem", name)
|
||||||
pemFileName := fmt.Sprintf("%v/%v", ingress.DefaultSSLDirectory, pemName)
|
pemFileName := fmt.Sprintf("%v/%v", ingress.DefaultSSLDirectory, pemName)
|
||||||
|
|
||||||
tempPemFile, err := ioutil.TempFile("", pemName)
|
tempPemFile, err := ioutil.TempFile(ingress.TempSSLDirectory, pemName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("could not create temp pem file %v: %v", tempPemFile.Name(), err)
|
return nil, fmt.Errorf("could not create temp pem file %v: %v", tempPemFile.Name(), err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue