( secretName, privateKeyPath, certFilePath, errorLogger, )
| 21 | let tlsCertPath = null; |
| 22 | |
| 23 | const uploadTLSSecret = function ( |
| 24 | secretName, |
| 25 | privateKeyPath, |
| 26 | certFilePath, |
| 27 | errorLogger, |
| 28 | ) { |
| 29 | try { |
| 30 | execSync( |
| 31 | `kubectl create secret tls ${secretName} --key ${privateKeyPath} --cert ${certFilePath}`, |
| 32 | { stdio: 'inherit' }, |
| 33 | ); |
| 34 | } catch (err) { |
| 35 | errorLogger( |
| 36 | 'Failed to upload TLS key and certificate pair to Kubernetes. ' + |
| 37 | 'You can try using the following command to upload them manually: ' + |
| 38 | `kubectl create secret tls ${secretName} --key ${privateKeyPath} --cert ${certFilePath}`, |
| 39 | ); |
| 40 | return false; |
| 41 | } |
| 42 | return true; |
| 43 | }; |
| 44 | |
| 45 | const removeTLSSecret = function (secretName, errorLogger) { |
| 46 | try { |
no outgoing calls
no test coverage detected
searching dependent graphs…