MCPcopy Create free account
hub / github.com/SocketCluster/socketcluster / uploadTLSSecret

Function uploadTLSSecret

bin/actions/k8s.js:23–43  ·  view source on GitHub ↗
(
  secretName,
  privateKeyPath,
  certFilePath,
  errorLogger,
)

Source from the content-addressed store, hash-verified

21let tlsCertPath = null;
22
23const 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
45const removeTLSSecret = function (secretName, errorLogger) {
46 try {

Callers 2

performDeploymentFunction · 0.85
k8sAddSecretFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…