Skip to content

Commit

Permalink
hide enablement command
Browse files Browse the repository at this point in the history
  • Loading branch information
rlindner81 committed Mar 1, 2024
1 parent 829972b commit 9ddaef2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 23 deletions.
2 changes: 0 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
uaasu --uaa-service-user SERVICE USERNAME PASSWORD [TENANT] obtain service token for username password
```

- hdi: new `--hdi-enable-native` command to enable HANA native tenant capabilities. (fixes #58 by @andre68723)

### Fixed

- uaa: fix error with recommended passcode url when credential-type x509 is used. (fixes #59)
Expand Down
16 changes: 0 additions & 16 deletions docs/hana-management/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ Commands for this area are:
hdirt --hdi-rebind-tenant TENANT_ID [PARAMS] rebind tenant hdi container instances
hdira --hdi-rebind-all [PARAMS] rebind all hdi container instances
--hdi-repair-bindings [PARAMS] create missing and delete ambiguous bindings
--hdi-enable-native [TENANT_ID] enable hana native tenants
* --hdi-delete-tenant TENANT_ID delete hdi container instance and bindings for tenant
* --hdi-delete-all delete all hdi container instances and bindings
... [TENANT_ID] filter for tenant id
Expand Down Expand Up @@ -148,21 +147,6 @@ manager. In other words, `mtx hdirt <tenant_id> '{"special":true}'` corresponds
cf bind-service <service-manager> <hdi-shared service-instance of tenant_id> -c '{"special":true}'
```

## HDI Enable Native

The enablement command `mtx --hdi-enable-native` is a convenience functionality for enabling HANA native tenant
capabilities for all tenants or, if used with a TENANT_ID filter, for a single tenant.

On HANA side, this enablement is split into two parts. The first part happens synchronously and in it the database is
actually set up to support these new capabilities. The second part happens asynchronously and in it the tenant data is
(re-)encrypted in the background. In other words, during the first part the tenant data is not accessible and during
the second part the database can be used normally.

The enablement command will temporarily remove the relevant bindings, to protect the database from application accesses
during the first part of the enablement. When the command finishes, only the first part of the enablement process is
finished. The second part will still happen in the background for a while, depending on how many tenants and data the
database needs to process. The temporarily removed bindings will be restored automatically.

## HDI Delete

The deletion commands are only sensible for cleanup after some mocking/testing purposes.
Expand Down
1 change: 0 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ commands:
hdirt --hdi-rebind-tenant TENANT_ID [PARAMS] rebind tenant hdi container instances
hdira --hdi-rebind-all [PARAMS] rebind all hdi container instances
--hdi-repair-bindings [PARAMS] create missing and delete ambiguous bindings
--hdi-enable-native [TENANT_ID] enable hana native tenants
* --hdi-delete-tenant TENANT_ID delete hdi container instance and bindings for tenant
* --hdi-delete-all delete all hdi container instances and bindings
... [TENANT_ID] filter for tenant id
Expand Down
1 change: 0 additions & 1 deletion src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ commands:
hdirt --hdi-rebind-tenant TENANT_ID [PARAMS] rebind tenant hdi container instances
hdira --hdi-rebind-all [PARAMS] rebind all hdi container instances
--hdi-repair-bindings [PARAMS] create missing and delete ambiguous bindings
--hdi-enable-native [TENANT_ID] enable hana native tenants
* --hdi-delete-tenant TENANT_ID delete hdi container instance and bindings for tenant
* --hdi-delete-all delete all hdi container instances and bindings
... [TENANT_ID] filter for tenant id
Expand Down
9 changes: 6 additions & 3 deletions test/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ const { join } = require("path");

const { USAGE, GENERIC_CLI_OPTIONS } = require("../src/cli");

const appCliOptions = require("../src/cliOptions");
const HIDDEN_COMMANDS = ["--hdi-enable-native"];
const appCliOptions = Object.values(require("../src/cliOptions")).filter((option) =>
option.commandVariants.every((command) => !HIDDEN_COMMANDS.includes(command))
);

/*
NOTE: Just internal consistency tests for now.
Expand Down Expand Up @@ -70,7 +73,7 @@ describe("cli tests", () => {
};

test("programmatic options/ cli usage consistency check", async () => {
const cliOptions = [].concat(Object.values(GENERIC_CLI_OPTIONS), Object.values(appCliOptions));
const cliOptions = [].concat(Object.values(GENERIC_CLI_OPTIONS), appCliOptions);
const usageOptionsArea = /[\s\S]*commands:\s*\n([\s\S]+\S)/.exec(USAGE)[1];
_validateOptions(cliOptions, usageOptionsArea, expect);
});
Expand All @@ -96,7 +99,7 @@ describe("cli tests", () => {
];

for (const { commandPrefix, readmePath } of areas) {
const cliOptions = Object.values(appCliOptions).filter(
const cliOptions = appCliOptions.filter(
({ commandVariants }) =>
commandVariants[0].startsWith(commandPrefix) || commandVariants[0].startsWith(`--${commandPrefix}`)
);
Expand Down

0 comments on commit 9ddaef2

Please sign in to comment.