diff --git a/.nvmrc b/.nvmrc index cc5875fab..a3a1f3cad 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v10.15.3 +v10.23.0 diff --git a/lib/interface/cli/commands/context/create/secret-store/types/hashicorp-vault.cmd.js b/lib/interface/cli/commands/context/create/secret-store/types/hashicorp-vault.cmd.js index 8a7fd32d7..55633929a 100644 --- a/lib/interface/cli/commands/context/create/secret-store/types/hashicorp-vault.cmd.js +++ b/lib/interface/cli/commands/context/create/secret-store/types/hashicorp-vault.cmd.js @@ -3,22 +3,25 @@ const CFError = require('cf-errors'); const cmd = require('../base.cmd'); const { sdk } = require('../../../../../../../logic'); -function buildAuthObject({ token, username, password, roleId, secretId, loginPath, gcpRole, kubernetesRole, kubernetesJwt }) { - const mountPoint = loginPath ? { mount_point: loginPath } : {}; +function buildAuthObject({ loginPath, namespace, token, username, password, roleId, secretId, gcpRole, kubernetesRole, kubernetesJwt }) { + const baseAuth = { + ...(loginPath && { mount_point: loginPath }), + ...(namespace && { namespace }), + }; if (token) { - return { type: 'token', token, ...mountPoint }; + return { type: 'token', token, ...baseAuth }; } if (username && password) { - return { type: 'userpass', username, password, ...mountPoint }; + return { type: 'userpass', username, password, ...baseAuth }; } if (roleId && secretId) { - return { type: 'approle', role_id: roleId, secret_id: secretId, ...mountPoint }; + return { type: 'approle', role_id: roleId, secret_id: secretId, ...baseAuth }; } if (gcpRole) { - return { type: 'gcp', roleType: 'gce', role: gcpRole, ...mountPoint }; + return { type: 'gcp', roleType: 'gce', role: gcpRole, ...baseAuth }; } if (kubernetesRole) { @@ -26,7 +29,7 @@ function buildAuthObject({ token, username, password, roleId, secretId, loginPat type: 'kubernetes', role: kubernetesRole, ...(kubernetesJwt && { jwt: kubernetesJwt }), - ...mountPoint, + ...baseAuth, }; } @@ -61,6 +64,11 @@ const command = new Command({ describe: 'Path for given auth method. Leave out to use the default path for the type.', type: 'string', }) + .option('namespace', { + alias: 'n', + describe: 'Namespace is only valid for Vault Enterprise instances', + type: 'string', + }) .option('token', { alias: 't', describe: 'Token', diff --git a/package.json b/package.json index 94b880e34..a8c182265 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codefresh", - "version": "0.75.12", + "version": "0.75.13", "description": "Codefresh command line utility", "main": "index.js", "preferGlobal": true,