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

Function k8sAddSecret

bin/actions/k8s.js:478–501  ·  view source on GitHub ↗
(arg, options)

Source from the content-addressed store, hash-verified

476};
477
478const k8sAddSecret = async function (arg, options) {
479 let secretName = options.s || DEFAULT_TLS_SECRET_NAME;
480 let privateKeyPath = options.k;
481 let certFilePath = options.c;
482
483 if (privateKeyPath == null || certFilePath == null) {
484 this.errorLog(
485 `Failed to upload secret. Both a key file path (-k) and a certificate file path (-c) must be provided.`,
486 );
487 } else {
488 let success = uploadTLSSecret(
489 secretName,
490 privateKeyPath,
491 certFilePath,
492 this.errorLog,
493 );
494 if (success) {
495 this.successLog(
496 `The private key and cert pair were added to your cluster under the secret name "${secretName}".`,
497 );
498 }
499 }
500 process.exit();
501};
502
503const k8sRemoveSecret = async function (arg, options) {
504 const secretName = options.s || DEFAULT_TLS_SECRET_NAME;

Callers

nothing calls this directly

Calls 1

uploadTLSSecretFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…