@codiac.io/codiac-cli 1.3.180 → 1.3.182
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/apis/codiac-api/gen/client.d.ts +5 -1
- package/dist/apis/codiac-api/gen/client.js +12 -0
- package/dist/apis/codiac-api/gen/client.js.map +1 -1
- package/dist/apis/codiac-api/gen/contracts/types.gen.d.ts +25 -0
- package/dist/apis/codiac-api/gen/contracts/types.gen.js.map +1 -1
- package/dist/apis/codiac-api/i-client.d.ts +4 -0
- package/dist/apis/codiac-api-nats/gen/client.d.ts +4 -0
- package/dist/apis/codiac-api-nats/gen/client.js +17 -1
- package/dist/apis/codiac-api-nats/gen/client.js.map +1 -1
- package/dist/apis/codiac-api-nats/gen/contracts/types.gen.d.ts +25 -0
- package/dist/apis/codiac-api-nats/gen/contracts/types.gen.js.map +1 -1
- package/dist/apis/codiac-relay/gen/client.d.ts +16 -3
- package/dist/apis/codiac-relay/gen/client.js +58 -1
- package/dist/apis/codiac-relay/gen/client.js.map +1 -1
- package/dist/apis/codiac-relay/gen/contracts/types.gen.d.ts +173 -7
- package/dist/apis/codiac-relay/gen/contracts/types.gen.js.map +1 -1
- package/dist/apis/codiac-relay/i-client.d.ts +8 -0
- package/dist/apis/codiac-relay-nats/gen/client.d.ts +15 -7
- package/dist/apis/codiac-relay-nats/gen/client.js +86 -19
- package/dist/apis/codiac-relay-nats/gen/client.js.map +1 -1
- package/dist/apis/codiac-relay-nats/gen/contracts/types.gen.d.ts +151 -15
- package/dist/apis/codiac-relay-nats/gen/contracts/types.gen.js +4 -4
- package/dist/apis/codiac-relay-nats/gen/contracts/types.gen.js.map +1 -1
- package/dist/apis/codiac-relay-nats/gen/contracts.ng.d.ts +6 -0
- package/dist/apis/codiac-relay-nats/gen/contracts.ng.js +1 -0
- package/dist/apis/codiac-relay-nats/gen/contracts.ng.js.map +1 -1
- package/dist/bootstrapper-for-api-clients.js +14 -2
- package/dist/bootstrapper-for-api-clients.js.map +1 -1
- package/dist/cli-common/built-in-cli-user-input.d.ts +2 -1
- package/dist/cli-common/built-in-cli-user-input.js +52 -1
- package/dist/cli-common/built-in-cli-user-input.js.map +1 -1
- package/dist/cli-common/entities/prompt-choice.d.ts +2 -7
- package/dist/cli-common/mock-ui.d.ts +2 -1
- package/dist/cli-common/mock-ui.js +3 -0
- package/dist/cli-common/mock-ui.js.map +1 -1
- package/dist/codiac-constants.d.ts +3 -0
- package/dist/codiac-constants.js +3 -0
- package/dist/codiac-constants.js.map +1 -1
- package/dist/command-base-enterprise.d.ts +23 -2
- package/dist/command-base-enterprise.js +82 -26
- package/dist/command-base-enterprise.js.map +1 -1
- package/dist/command-base-exec.js +4 -2
- package/dist/command-base-exec.js.map +1 -1
- package/dist/commands/asset/deploy.d.ts +2 -1
- package/dist/commands/asset/deploy.js +3 -2
- package/dist/commands/asset/deploy.js.map +1 -1
- package/dist/commands/asset/list.d.ts +26 -7
- package/dist/commands/asset/list.js +127 -112
- package/dist/commands/asset/list.js.map +1 -1
- package/dist/commands/asset/probe/create.d.ts +26 -5
- package/dist/commands/asset/probe/create.js +182 -164
- package/dist/commands/asset/probe/create.js.map +1 -1
- package/dist/commands/asset/recycle.js +3 -4
- package/dist/commands/asset/recycle.js.map +1 -1
- package/dist/commands/asset/undeploy.d.ts +24 -9
- package/dist/commands/asset/undeploy.js +162 -161
- package/dist/commands/asset/undeploy.js.map +1 -1
- package/dist/commands/asset/view.js +1 -1
- package/dist/commands/asset/view.js.map +1 -1
- package/dist/commands/asset/volume/create.d.ts +25 -13
- package/dist/commands/asset/volume/create.js +177 -156
- package/dist/commands/asset/volume/create.js.map +1 -1
- package/dist/commands/asset/volume/delete.d.ts +23 -7
- package/dist/commands/asset/volume/delete.js +131 -98
- package/dist/commands/asset/volume/delete.js.map +1 -1
- package/dist/commands/asset/volume/list.d.ts +24 -8
- package/dist/commands/asset/volume/list.js +101 -54
- package/dist/commands/asset/volume/list.js.map +1 -1
- package/dist/commands/cabinet/cluster/attach.d.ts +32 -0
- package/dist/commands/cabinet/cluster/attach.js +144 -0
- package/dist/commands/cabinet/cluster/attach.js.map +1 -0
- package/dist/commands/cabinet/create.d.ts +1 -0
- package/dist/commands/cabinet/create.js +5 -1
- package/dist/commands/cabinet/create.js.map +1 -1
- package/dist/commands/cabinet/list.d.ts +27 -6
- package/dist/commands/cabinet/list.js +130 -121
- package/dist/commands/cabinet/list.js.map +1 -1
- package/dist/commands/cabinet/obliterate.d.ts +1 -0
- package/dist/commands/cabinet/obliterate.js +5 -1
- package/dist/commands/cabinet/obliterate.js.map +1 -1
- package/dist/commands/cabinet/restore.d.ts +36 -0
- package/dist/commands/cabinet/restore.js +186 -0
- package/dist/commands/cabinet/restore.js.map +1 -0
- package/dist/commands/cluster/agent/configure.d.ts +47 -0
- package/dist/commands/cluster/agent/configure.js +320 -0
- package/dist/commands/cluster/agent/configure.js.map +1 -0
- package/dist/commands/cluster/agent/install.d.ts +32 -0
- package/dist/commands/cluster/agent/install.js +152 -0
- package/dist/commands/cluster/agent/install.js.map +1 -0
- package/dist/commands/cluster/agent/uninstall.d.ts +29 -0
- package/dist/commands/cluster/agent/uninstall.js +130 -0
- package/dist/commands/cluster/agent/uninstall.js.map +1 -0
- package/dist/commands/cluster/bootstrap.d.ts +50 -0
- package/dist/commands/cluster/bootstrap.js +310 -0
- package/dist/commands/cluster/bootstrap.js.map +1 -0
- package/dist/commands/cluster/connect.d.ts +0 -5
- package/dist/commands/cluster/connect.js +1 -26
- package/dist/commands/cluster/connect.js.map +1 -1
- package/dist/commands/cluster/install.d.ts +45 -0
- package/dist/commands/cluster/install.js +224 -0
- package/dist/commands/cluster/install.js.map +1 -0
- package/dist/commands/cluster/stack/capture.js +0 -2
- package/dist/commands/cluster/stack/capture.js.map +1 -1
- package/dist/commands/cluster/stack/install.d.ts +40 -0
- package/dist/commands/cluster/stack/install.js +196 -0
- package/dist/commands/cluster/stack/install.js.map +1 -0
- package/dist/commands/cluster/start.d.ts +0 -5
- package/dist/commands/cluster/start.js +1 -27
- package/dist/commands/cluster/start.js.map +1 -1
- package/dist/commands/cluster/stop.d.ts +0 -5
- package/dist/commands/cluster/stop.js +1 -27
- package/dist/commands/cluster/stop.js.map +1 -1
- package/dist/commands/config/add.d.ts +9 -11
- package/dist/commands/config/add.js +59 -125
- package/dist/commands/config/add.js.map +1 -1
- package/dist/commands/config/delete.d.ts +22 -11
- package/dist/commands/config/delete.js +28 -83
- package/dist/commands/config/delete.js.map +1 -1
- package/dist/commands/config/deploy.d.ts +26 -8
- package/dist/commands/config/deploy.js +169 -198
- package/dist/commands/config/deploy.js.map +1 -1
- package/dist/commands/config/import.d.ts +27 -22
- package/dist/commands/config/import.js +222 -253
- package/dist/commands/config/import.js.map +1 -1
- package/dist/commands/config/settings/get.d.ts +25 -14
- package/dist/commands/config/settings/get.js +30 -123
- package/dist/commands/config/settings/get.js.map +1 -1
- package/dist/commands/config/view.d.ts +26 -6
- package/dist/commands/config/view.js +112 -95
- package/dist/commands/config/view.js.map +1 -1
- package/dist/commands/csp/logout.d.ts +23 -6
- package/dist/commands/csp/logout.js +86 -63
- package/dist/commands/csp/logout.js.map +1 -1
- package/dist/commands/deploy.d.ts +31 -14
- package/dist/commands/deploy.js +264 -385
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/enterprise/list.d.ts +22 -4
- package/dist/commands/enterprise/list.js +97 -67
- package/dist/commands/enterprise/list.js.map +1 -1
- package/dist/commands/env/add.d.ts +26 -7
- package/dist/commands/env/add.js +182 -179
- package/dist/commands/env/add.js.map +1 -1
- package/dist/commands/environment/cluster/attach.d.ts +1 -0
- package/dist/commands/environment/cluster/attach.js +5 -1
- package/dist/commands/environment/cluster/attach.js.map +1 -1
- package/dist/commands/environment/cluster/detach.d.ts +1 -0
- package/dist/commands/environment/cluster/detach.js +5 -1
- package/dist/commands/environment/cluster/detach.js.map +1 -1
- package/dist/commands/environment/create.d.ts +1 -0
- package/dist/commands/environment/create.js +5 -1
- package/dist/commands/environment/create.js.map +1 -1
- package/dist/commands/environment/delete.d.ts +39 -0
- package/dist/commands/environment/delete.js +135 -0
- package/dist/commands/environment/delete.js.map +1 -0
- package/dist/commands/environment/list.d.ts +28 -9
- package/dist/commands/environment/list.js +128 -167
- package/dist/commands/environment/list.js.map +1 -1
- package/dist/commands/host/map.d.ts +29 -19
- package/dist/commands/host/map.js +263 -324
- package/dist/commands/host/map.js.map +1 -1
- package/dist/commands/imageRegistry/capture.d.ts +12 -11
- package/dist/commands/imageRegistry/capture.js +49 -113
- package/dist/commands/imageRegistry/capture.js.map +1 -1
- package/dist/commands/imageRegistry/forget.d.ts +12 -11
- package/dist/commands/imageRegistry/forget.js +53 -114
- package/dist/commands/imageRegistry/forget.js.map +1 -1
- package/dist/commands/imageRegistry/pullSecret/set.d.ts +21 -11
- package/dist/commands/imageRegistry/pullSecret/set.js +184 -278
- package/dist/commands/imageRegistry/pullSecret/set.js.map +1 -1
- package/dist/commands/imageRegistry/pullSecret/unset.d.ts +19 -11
- package/dist/commands/imageRegistry/pullSecret/unset.js +117 -190
- package/dist/commands/imageRegistry/pullSecret/unset.js.map +1 -1
- package/dist/commands/images/add.d.ts +19 -6
- package/dist/commands/images/add.js +63 -53
- package/dist/commands/images/add.js.map +1 -1
- package/dist/commands/kit/create.d.ts +22 -10
- package/dist/commands/kit/create.js +119 -121
- package/dist/commands/kit/create.js.map +1 -1
- package/dist/commands/logout.d.ts +21 -5
- package/dist/commands/logout.js +44 -25
- package/dist/commands/logout.js.map +1 -1
- package/dist/commands/noc/cluster/create.js +22 -10
- package/dist/commands/noc/cluster/create.js.map +1 -1
- package/dist/commands/noc/cluster/credentials-set.d.ts +38 -0
- package/dist/commands/noc/cluster/credentials-set.js +174 -0
- package/dist/commands/noc/cluster/credentials-set.js.map +1 -0
- package/dist/commands/noc/cluster/define.d.ts +46 -0
- package/dist/commands/noc/cluster/define.js +305 -0
- package/dist/commands/noc/cluster/define.js.map +1 -0
- package/dist/commands/noc/cluster/deinit.d.ts +22 -5
- package/dist/commands/noc/cluster/deinit.js +99 -106
- package/dist/commands/noc/cluster/deinit.js.map +1 -1
- package/dist/commands/noc/cluster/forget.js +2 -4
- package/dist/commands/noc/cluster/forget.js.map +1 -1
- package/dist/commands/noc/cluster/grant.d.ts +20 -11
- package/dist/commands/noc/cluster/grant.js +94 -132
- package/dist/commands/noc/cluster/grant.js.map +1 -1
- package/dist/commands/noc/cluster/init.d.ts +25 -7
- package/dist/commands/noc/cluster/init.js +121 -133
- package/dist/commands/noc/cluster/init.js.map +1 -1
- package/dist/commands/noc/cluster/journal.d.ts +0 -5
- package/dist/commands/noc/cluster/journal.js +1 -26
- package/dist/commands/noc/cluster/journal.js.map +1 -1
- package/dist/commands/noc/cluster/list.d.ts +23 -5
- package/dist/commands/noc/cluster/list.js +107 -111
- package/dist/commands/noc/cluster/list.js.map +1 -1
- package/dist/commands/noc/cluster/restore.d.ts +36 -0
- package/dist/commands/noc/cluster/restore.js +196 -0
- package/dist/commands/noc/cluster/restore.js.map +1 -0
- package/dist/commands/portal.d.ts +21 -5
- package/dist/commands/portal.js +37 -36
- package/dist/commands/portal.js.map +1 -1
- package/dist/commands/secretStore/capture.d.ts +13 -11
- package/dist/commands/secretStore/capture.js +63 -123
- package/dist/commands/secretStore/capture.js.map +1 -1
- package/dist/commands/secretStore/forget.d.ts +13 -11
- package/dist/commands/secretStore/forget.js +55 -111
- package/dist/commands/secretStore/forget.js.map +1 -1
- package/dist/commands/shell/init.d.ts +15 -0
- package/dist/commands/shell/init.js +96 -0
- package/dist/commands/shell/init.js.map +1 -0
- package/dist/commands/snapshot/deploy.d.ts +22 -42
- package/dist/commands/snapshot/deploy.js +173 -269
- package/dist/commands/snapshot/deploy.js.map +1 -1
- package/dist/commands/snapshot/list.d.ts +26 -5
- package/dist/commands/snapshot/list.js +116 -109
- package/dist/commands/snapshot/list.js.map +1 -1
- package/dist/commands/tenant/create.d.ts +18 -13
- package/dist/commands/tenant/create.js +69 -69
- package/dist/commands/tenant/create.js.map +1 -1
- package/dist/commands/tenant/switch.d.ts +18 -12
- package/dist/commands/tenant/switch.js +65 -59
- package/dist/commands/tenant/switch.js.map +1 -1
- package/dist/commands/whereami.d.ts +18 -8
- package/dist/commands/whereami.js +67 -102
- package/dist/commands/whereami.js.map +1 -1
- package/dist/commands/whoami.d.ts +19 -3
- package/dist/commands/whoami.js +44 -13
- package/dist/commands/whoami.js.map +1 -1
- package/dist/ops/i-user-input-provider.d.ts +20 -1
- package/dist/ops/i-user-input-provider.js.map +1 -1
- package/dist/ops/test/mock-ui.d.ts +2 -1
- package/dist/ops/test/mock-ui.js +3 -0
- package/dist/ops/test/mock-ui.js.map +1 -1
- package/dist/ops/throwing-user-input-provider.d.ts +2 -1
- package/dist/ops/throwing-user-input-provider.js +3 -0
- package/dist/ops/throwing-user-input-provider.js.map +1 -1
- package/dist/relay/relay-container.js +1 -1
- package/dist/uilogic/lrp-watcher-predef.d.ts +2 -1
- package/dist/uilogic/lrp-watcher-predef.js +31 -17
- package/dist/uilogic/lrp-watcher-predef.js.map +1 -1
- package/dist/uilogic/lrp-watcher-utils.d.ts +2 -0
- package/dist/uilogic/lrp-watcher-utils.js +2 -0
- package/dist/uilogic/lrp-watcher-utils.js.map +1 -1
- package/dist/uilogic/rootmap-ui-utils.d.ts +18 -1
- package/dist/uilogic/rootmap-ui-utils.js +30 -0
- package/dist/uilogic/rootmap-ui-utils.js.map +1 -1
- package/dist/uilogic/tenant-contextualizer.js +11 -1
- package/dist/uilogic/tenant-contextualizer.js.map +1 -1
- package/dist/user-context-loader.d.ts +12 -7
- package/dist/user-context-loader.js +89 -43
- package/dist/user-context-loader.js.map +1 -1
- package/oclif.manifest.json +3991 -1444
- package/package.json +2 -2
- package/dist/commands/noc/cluster/recreate.d.ts +0 -28
- package/dist/commands/noc/cluster/recreate.js +0 -197
- package/dist/commands/noc/cluster/recreate.js.map +0 -1
|
@@ -1,24 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ImageRegistry, RootMap } from '../../../apis/codiac-api/contracts';
|
|
2
|
+
import { CommandBaseExecTenant } from '../../../command-base-exec-tenant';
|
|
2
3
|
import { ImageRegistryContextualizer } from '../../../uilogic/image-registry-contextualizer';
|
|
3
|
-
|
|
4
|
+
import { InteractionModes } from '../../../uilogic/config-ui-utils';
|
|
5
|
+
/** The user entry declaring a pull secret reference for an image registry. */
|
|
6
|
+
type PullSecretRemoveEntry = {
|
|
7
|
+
isPrimary: boolean;
|
|
8
|
+
regCode: string;
|
|
9
|
+
registry: ImageRegistry;
|
|
10
|
+
};
|
|
11
|
+
export default class ImageRegistryPullSecretUnset extends CommandBaseExecTenant<PullSecretRemoveEntry> {
|
|
4
12
|
static description: string;
|
|
5
13
|
static aliases: string[];
|
|
6
|
-
static dependsOn: string[];
|
|
7
14
|
static flags: {
|
|
15
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
8
16
|
registry: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
17
|
item: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
-
toScript: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
18
|
silent: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
-
|
|
19
|
+
echo: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
"to-script": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
21
|
};
|
|
14
22
|
static args: {};
|
|
15
23
|
protected bootstrap(): void;
|
|
16
24
|
protected get uiRegistry(): ImageRegistryContextualizer;
|
|
17
25
|
private _uiRegistry_backer;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
private buildScript;
|
|
26
|
+
captureArgs(): Promise<[Partial<PullSecretRemoveEntry>, InteractionModes | undefined, boolean]>;
|
|
27
|
+
buildCandidate_silently(partial: Partial<PullSecretRemoveEntry>, rootMap: RootMap): Promise<PullSecretRemoveEntry | undefined>;
|
|
28
|
+
buildCandidate_interactively(partial: Partial<PullSecretRemoveEntry>, takeDefaults: boolean, rootMap: RootMap): Promise<PullSecretRemoveEntry | undefined>;
|
|
29
|
+
buildCommandString(candidate: PullSecretRemoveEntry, cmd: string[]): string[];
|
|
30
|
+
executeTask(candidate: PullSecretRemoveEntry): Promise<void>;
|
|
24
31
|
}
|
|
32
|
+
export {};
|
|
@@ -4,13 +4,13 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
5
|
const contracts_1 = require("../../../apis/codiac-api/contracts");
|
|
6
6
|
const contracts_2 = require("@codiac.io/codiac-common/contracts");
|
|
7
|
-
const
|
|
7
|
+
const command_base_exec_tenant_1 = require("../../../command-base-exec-tenant");
|
|
8
8
|
const cloud_resource_configurator_factory_1 = require("../../../uilogic/cloud-resource-configurator-factory");
|
|
9
9
|
const cloud_provider_contextualizer_1 = require("../../../uilogic/cloud-provider-contextualizer");
|
|
10
10
|
const image_registry_contextualizer_1 = require("../../../uilogic/image-registry-contextualizer");
|
|
11
11
|
const image_contextualizer_1 = require("../../../uilogic/image-contextualizer");
|
|
12
|
-
|
|
13
|
-
class ImageRegistryPullSecretUnset extends
|
|
12
|
+
const config_ui_utils_1 = require("../../../uilogic/config-ui-utils");
|
|
13
|
+
class ImageRegistryPullSecretUnset extends command_base_exec_tenant_1.CommandBaseExecTenant {
|
|
14
14
|
bootstrap() {
|
|
15
15
|
super.bootstrap();
|
|
16
16
|
cloud_provider_contextualizer_1.CloudProviderContextualizer.bootstrap(this.ioc);
|
|
@@ -26,217 +26,144 @@ class ImageRegistryPullSecretUnset extends command_base_enterprise_1.CommandBase
|
|
|
26
26
|
return this._uiRegistry_backer;
|
|
27
27
|
}
|
|
28
28
|
// --------------------------------------------------------------------
|
|
29
|
-
|
|
29
|
+
captureArgs() {
|
|
30
|
+
var _a, _b;
|
|
30
31
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
this.bootstrap();
|
|
32
32
|
const { flags } = yield this.parse(ImageRegistryPullSecretUnset);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
let partial = {};
|
|
34
|
+
if (flags.registry)
|
|
35
|
+
partial.regCode = flags.registry;
|
|
36
|
+
partial.isPrimary = (flags.item !== "secondary");
|
|
37
|
+
const interactionMode = (this.pipedInput) ? config_ui_utils_1.InteractionModes.silent : (_b = (_a = undefined !== null && undefined !== void 0 ? undefined : (flags.echo ? config_ui_utils_1.InteractionModes.echo : undefined)) !== null && _a !== void 0 ? _a : (flags["to-script"] ? config_ui_utils_1.InteractionModes.toscript : undefined)) !== null && _b !== void 0 ? _b : (flags.silent ? config_ui_utils_1.InteractionModes.silent : undefined);
|
|
38
|
+
return [partial, interactionMode, false];
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
buildCandidate_silently(partial, rootMap) {
|
|
42
|
+
var _a;
|
|
43
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
if (!partial.regCode)
|
|
45
|
+
throw new Error("A registry code must be set");
|
|
46
|
+
let registries = yield this._codiacApi.ImageRegistry.readMany({ all: true }, { throwNotFound: false });
|
|
47
|
+
let registry = registries.find(r => r.code === partial.regCode);
|
|
48
|
+
if (!registry) {
|
|
49
|
+
throw new Error(`No ImageRegistry record currently exists with code: [${partial.regCode}]. You might need to check your spelling or capture your image registry.`);
|
|
50
|
+
}
|
|
51
|
+
return { isPrimary: (_a = partial.isPrimary) !== null && _a !== void 0 ? _a : true, regCode: partial.regCode, registry };
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
buildCandidate_interactively(partial, takeDefaults, rootMap) {
|
|
55
|
+
var _a, _b;
|
|
56
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
let registries = yield this._codiacApi.ImageRegistry.readMany({ all: true }, { throwNotFound: false });
|
|
58
|
+
if (registries.length === 0)
|
|
59
|
+
throw new Error(`Cannot set pull secrets: No image registries are defined yet.`);
|
|
60
|
+
cloud_resource_configurator_factory_1.RegistryConfiguratorFactory.bootstrap(this.ioc);
|
|
61
|
+
let p = {
|
|
62
|
+
isPrimary: (_a = partial.isPrimary) !== null && _a !== void 0 ? _a : true,
|
|
63
|
+
regCode: partial.regCode,
|
|
64
|
+
};
|
|
65
|
+
let candidate;
|
|
66
|
+
let confirmed;
|
|
67
|
+
while (!confirmed) {
|
|
68
|
+
console.clear();
|
|
69
|
+
// REGISTRY (we've already gated this method for registries.length > 0)
|
|
70
|
+
let keepRegistry = false;
|
|
71
|
+
let selectedRegistry;
|
|
72
|
+
while (keepRegistry === false) {
|
|
73
|
+
keepRegistry = (p.regCode === undefined) ? false : yield this._ui.promptConfirm("keepRegistry", `${this._styler.hilite(p.regCode)} pull secret`);
|
|
74
|
+
if (!keepRegistry) {
|
|
75
|
+
selectedRegistry = (yield this.uiRegistry.promptForExistingRegistry(contracts_1.PackageType.container, false, registries));
|
|
76
|
+
p.regCode = selectedRegistry.code;
|
|
77
|
+
keepRegistry = true;
|
|
42
78
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
79
|
+
// PRIMARY/SECONDARY
|
|
80
|
+
let choices = [];
|
|
81
|
+
if ((selectedRegistry === null || selectedRegistry === void 0 ? void 0 : selectedRegistry.pullSecret) !== undefined && (selectedRegistry === null || selectedRegistry === void 0 ? void 0 : selectedRegistry.pullSecret) !== null) {
|
|
82
|
+
choices.push({ name: "Primary", value: true });
|
|
46
83
|
}
|
|
47
|
-
|
|
48
|
-
|
|
84
|
+
if ((selectedRegistry === null || selectedRegistry === void 0 ? void 0 : selectedRegistry.pullSecretSecondary) !== undefined && (selectedRegistry === null || selectedRegistry === void 0 ? void 0 : selectedRegistry.pullSecretSecondary) !== null) {
|
|
85
|
+
choices.push({ name: "Secondary", value: false });
|
|
49
86
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
this._ui.
|
|
87
|
+
if (choices.length > 1) {
|
|
88
|
+
p.isPrimary = (_b = p.isPrimary) !== null && _b !== void 0 ? _b : true;
|
|
89
|
+
let keepPrimary = yield this._ui.promptConfirm("keepPrimary", `${this._styler.hilite(p.isPrimary ? "Primary" : "Secondary")} pull secret`);
|
|
90
|
+
if (!keepPrimary) {
|
|
91
|
+
p.isPrimary = (yield this._ui.promptSelect("isPrimary", "Which pull secret?: ", [{ name: "Primary", value: true }, { name: "Secondary", value: false }]));
|
|
55
92
|
}
|
|
56
|
-
|
|
57
|
-
|
|
93
|
+
}
|
|
94
|
+
else if (choices.length === 1) {
|
|
95
|
+
if (p.isPrimary && choices[0].name !== "Primary") {
|
|
96
|
+
this._ui.userMessage(this._styler.colorWarning(`The image registry [${selectedRegistry === null || selectedRegistry === void 0 ? void 0 : selectedRegistry.code}] has no primary pull secret set.`));
|
|
97
|
+
p.isPrimary = false; // switch to secondary
|
|
98
|
+
}
|
|
99
|
+
if (p.isPrimary === false && choices[0].name !== "Secondary") {
|
|
100
|
+
this._ui.userMessage(this._styler.colorWarning(`The image registry [${selectedRegistry === null || selectedRegistry === void 0 ? void 0 : selectedRegistry.code}] has no secondary pull secret set.`));
|
|
101
|
+
p.isPrimary = true; // switch to primary
|
|
58
102
|
}
|
|
59
103
|
}
|
|
60
|
-
else {
|
|
61
|
-
this.
|
|
62
|
-
|
|
104
|
+
else if (choices.length === 0) {
|
|
105
|
+
this._ui.userMessage(this._styler.colorWarning(`The ${selectedRegistry === null || selectedRegistry === void 0 ? void 0 : selectedRegistry.type} image registry [${selectedRegistry === null || selectedRegistry === void 0 ? void 0 : selectedRegistry.code}] has no pull secrets set.`));
|
|
106
|
+
if (registries.length > 1) {
|
|
107
|
+
this._ui.userMessage(`Choose another registry (or hit CTRL-C to cancel)...`);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
this.exit();
|
|
111
|
+
}
|
|
112
|
+
keepRegistry = false;
|
|
113
|
+
p.regCode = undefined;
|
|
63
114
|
}
|
|
64
115
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
116
|
+
let registry = registries.find(r => r.code === p.regCode);
|
|
117
|
+
candidate = { isPrimary: p.isPrimary, regCode: p.regCode, registry };
|
|
118
|
+
this._ui.userMessage(`You are about to remove the ${this._styler.hilite(candidate.isPrimary ? "primary" : "secondary")} pull secret for ${this._styler.bold(this._styler.hilite(candidate.regCode))} [Tenant: ${this._userCntx.currentTenantCode}].`);
|
|
119
|
+
confirmed = yield this._ui.promptConfirm("confirmPullSecret", "Continue?", false);
|
|
120
|
+
}
|
|
121
|
+
if (candidate === undefined)
|
|
122
|
+
throw new Error("No PullSecret was defined.");
|
|
123
|
+
return candidate;
|
|
73
124
|
});
|
|
74
125
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if (!
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
try {
|
|
83
|
-
// TODO: Validate existence of secretRef in the secretStore
|
|
84
|
-
return { isPrimary: isPrimary, regCode: regCode };
|
|
85
|
-
}
|
|
86
|
-
catch (err) {
|
|
87
|
-
throw err;
|
|
88
|
-
}
|
|
126
|
+
buildCommandString(candidate, cmd) {
|
|
127
|
+
cmd.push("--registry", candidate.regCode);
|
|
128
|
+
if (!candidate.isPrimary)
|
|
129
|
+
cmd.push("--item", "secondary");
|
|
130
|
+
cmd.push("--silent");
|
|
131
|
+
return cmd;
|
|
89
132
|
}
|
|
90
|
-
|
|
91
|
-
|
|
133
|
+
executeTask(candidate) {
|
|
134
|
+
var _a;
|
|
92
135
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
};
|
|
102
|
-
let regInput = {};
|
|
103
|
-
if (partial.regCode) {
|
|
104
|
-
let found = registries.find(r => r.code === partial.regCode);
|
|
105
|
-
if (found)
|
|
106
|
-
regInput = found;
|
|
107
|
-
}
|
|
108
|
-
let confirmed;
|
|
109
|
-
while (!confirmed) {
|
|
110
|
-
// NOTE: We are gating on "confirmed != undefined" because that means they asked to revise the values.
|
|
111
|
-
console.clear();
|
|
112
|
-
// REGISTRY (we've already gated this method for registries.length > 0)
|
|
113
|
-
let keepRegistry = false;
|
|
114
|
-
let selectedRegistry;
|
|
115
|
-
while (keepRegistry === false) {
|
|
116
|
-
keepRegistry = (partial.regCode === undefined) ? false : yield this._ui.promptConfirm("keepRegistry", `${this._styler.hilite(partial.regCode)} pull secret`);
|
|
117
|
-
if (!keepRegistry) {
|
|
118
|
-
selectedRegistry = (yield this.uiRegistry.promptForExistingRegistry(contracts_1.PackageType.container, false, registries));
|
|
119
|
-
partial.regCode = selectedRegistry.code;
|
|
120
|
-
keepRegistry = true;
|
|
121
|
-
}
|
|
122
|
-
// PRIMARY/SECONDARY
|
|
123
|
-
let choices = [];
|
|
124
|
-
if ((selectedRegistry === null || selectedRegistry === void 0 ? void 0 : selectedRegistry.pullSecret) !== undefined && (selectedRegistry === null || selectedRegistry === void 0 ? void 0 : selectedRegistry.pullSecret) !== null) {
|
|
125
|
-
choices.push({ name: "Primary", value: true });
|
|
126
|
-
}
|
|
127
|
-
if ((selectedRegistry === null || selectedRegistry === void 0 ? void 0 : selectedRegistry.pullSecretSecondary) !== undefined && (selectedRegistry === null || selectedRegistry === void 0 ? void 0 : selectedRegistry.pullSecretSecondary) !== null) {
|
|
128
|
-
choices.push({ name: "Secondary", value: false });
|
|
129
|
-
}
|
|
130
|
-
if (choices.length > 1) {
|
|
131
|
-
partial.isPrimary = (_a = partial.isPrimary) !== null && _a !== void 0 ? _a : true;
|
|
132
|
-
let keepPrimary = yield this._ui.promptConfirm("keepPrimary", `${this._styler.hilite(partial.isPrimary ? "Primary" : "Secondary")} pull secret`);
|
|
133
|
-
if (!keepPrimary) {
|
|
134
|
-
partial.isPrimary = (yield this._ui.promptSelect("isPrimary", "Which pull secret?: ", [{ name: "Primary", value: true }, { name: "Secondary", value: false }]));
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
else if (choices.length === 1) {
|
|
138
|
-
if (partial.isPrimary && choices[0].name !== "Primary") {
|
|
139
|
-
this._ui.userMessage(this._styler.colorWarning(`The image registry [${selectedRegistry === null || selectedRegistry === void 0 ? void 0 : selectedRegistry.code}] has no primary pull secret set.`));
|
|
140
|
-
partial.isPrimary = false; // switch to secondary
|
|
141
|
-
}
|
|
142
|
-
if (partial.isPrimary === false && choices[0].name !== "Secondary") {
|
|
143
|
-
this._ui.userMessage(this._styler.colorWarning(`The image registry [${selectedRegistry === null || selectedRegistry === void 0 ? void 0 : selectedRegistry.code}] has no secondary pull secret set.`));
|
|
144
|
-
partial.isPrimary = true; // switch to primary
|
|
145
|
-
}
|
|
146
|
-
// this._ui.userMessage(`Remove ${this._styler.hilite(partial.isPrimary ? "Primary" : "Secondary")} pull secret`);
|
|
147
|
-
}
|
|
148
|
-
else if (choices.length === 0) {
|
|
149
|
-
this._ui.userMessage(this._styler.colorWarning(`The ${selectedRegistry === null || selectedRegistry === void 0 ? void 0 : selectedRegistry.type} image registry [${selectedRegistry === null || selectedRegistry === void 0 ? void 0 : selectedRegistry.code}] has no pull secrets set.`));
|
|
150
|
-
if (registries.length > 1) {
|
|
151
|
-
this._ui.userMessage(`Choose another registry (or hit CTRL-C to cancel)...`);
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
this.exit();
|
|
155
|
-
}
|
|
156
|
-
keepRegistry = false;
|
|
157
|
-
partial.regCode = undefined;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
candidate = {
|
|
161
|
-
isPrimary: partial.isPrimary,
|
|
162
|
-
regCode: partial.regCode
|
|
163
|
-
};
|
|
164
|
-
// this.logger.notice(prettify(candidate));
|
|
165
|
-
this._ui.userMessage(`You are about to remove the ${this._styler.hilite(candidate.isPrimary ? "primary" : "secondary")} pull secret for ${this._styler.bold(this._styler.hilite(candidate.regCode))} [Tenant: ${this._userCntx.currentTenantCode}].`);
|
|
166
|
-
confirmed = yield this._ui.promptConfirm("confirmPullSecret", "Continue?", false);
|
|
136
|
+
let pullSecretField = candidate.isPrimary ? "pullSecret" : "pullSecretSecondary";
|
|
137
|
+
let patchSpec = {
|
|
138
|
+
id: candidate.registry.id,
|
|
139
|
+
operations: [
|
|
140
|
+
{
|
|
141
|
+
op: contracts_2.patchOperationType.replace,
|
|
142
|
+
path: pullSecretField,
|
|
143
|
+
value: undefined
|
|
167
144
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
// this.logger.error(`${err.name ?? ''} ${err.message ?? ''}`, err.stack);
|
|
174
|
-
reject(err);
|
|
175
|
-
}
|
|
176
|
-
}));
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
removePullSecret(isPrimary, registry) {
|
|
180
|
-
return new Promise((resolve) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
181
|
-
var _a;
|
|
182
|
-
try {
|
|
183
|
-
let pullSecretField = isPrimary ? "pullSecret" : "pullSecretSecondary";
|
|
184
|
-
let patchSpec = {
|
|
185
|
-
id: registry.id,
|
|
186
|
-
operations: [
|
|
187
|
-
{
|
|
188
|
-
op: contracts_2.patchOperationType.replace,
|
|
189
|
-
path: pullSecretField,
|
|
190
|
-
value: undefined
|
|
191
|
-
}
|
|
192
|
-
]
|
|
193
|
-
};
|
|
194
|
-
let result = yield this._codiacApi.ImageRegistry.tryPatch(patchSpec);
|
|
195
|
-
if (result.success) {
|
|
196
|
-
this._ui.userMessage(`Successfully removed ${this._styler.hilite(isPrimary ? "primary" : "secondary")} pull secret on ${registry.type} image registry [${this._styler.hilite(registry.code)}]`);
|
|
197
|
-
}
|
|
198
|
-
else if (result.error) {
|
|
199
|
-
this._ui.userMessage(`${this._styler.colorCritical("Error")} removing ${isPrimary ? "primary" : "secondary"} pull secret on ${registry.type} image registry [${registry.code}]: ${result.error.name} ${(_a = result.error.message) !== null && _a !== void 0 ? _a : result.error.stack}`);
|
|
200
|
-
}
|
|
201
|
-
resolve();
|
|
145
|
+
]
|
|
146
|
+
};
|
|
147
|
+
let result = yield this._codiacApi.ImageRegistry.tryPatch(patchSpec);
|
|
148
|
+
if (result.success) {
|
|
149
|
+
this._ui.userMessage(`Successfully removed ${this._styler.hilite(candidate.isPrimary ? "primary" : "secondary")} pull secret on ${candidate.registry.type} image registry [${this._styler.hilite(candidate.registry.code)}]`);
|
|
202
150
|
}
|
|
203
|
-
|
|
204
|
-
this.
|
|
205
|
-
resolve();
|
|
206
|
-
// reject(err);
|
|
151
|
+
else if (result.error) {
|
|
152
|
+
this._ui.userMessage(`${this._styler.colorCritical("Error")} removing ${candidate.isPrimary ? "primary" : "secondary"} pull secret on ${candidate.registry.type} image registry [${candidate.registry.code}]: ${result.error.name} ${(_a = result.error.message) !== null && _a !== void 0 ? _a : result.error.stack}`);
|
|
207
153
|
}
|
|
208
|
-
})
|
|
209
|
-
}
|
|
210
|
-
buildScript(candidate) {
|
|
211
|
-
let output;
|
|
212
|
-
try {
|
|
213
|
-
output = `codiac imageRegistry:pullSecret:unset --silent`;
|
|
214
|
-
let flags = {};
|
|
215
|
-
flags.registry = candidate.regCode;
|
|
216
|
-
if (candidate.isPrimary !== true)
|
|
217
|
-
flags.item = "secondary";
|
|
218
|
-
Object.keys(flags).forEach(k => output = output.concat(" ", `--${k}=${flags[k]}`));
|
|
219
|
-
return output;
|
|
220
|
-
}
|
|
221
|
-
catch (err) {
|
|
222
|
-
throw err;
|
|
223
|
-
}
|
|
154
|
+
});
|
|
224
155
|
}
|
|
225
156
|
}
|
|
226
157
|
exports.default = ImageRegistryPullSecretUnset;
|
|
227
158
|
ImageRegistryPullSecretUnset.description = 'Removes the primary or secondary pull secret reference for the given container registry.';
|
|
228
159
|
ImageRegistryPullSecretUnset.aliases = ['pullsecret:unset'];
|
|
229
|
-
ImageRegistryPullSecretUnset.dependsOn = ["registry", "storeType", "storeName", "name"];
|
|
230
160
|
ImageRegistryPullSecretUnset.flags = {
|
|
231
|
-
|
|
161
|
+
help: core_1.Flags.help({ char: 'h' }),
|
|
232
162
|
registry: core_1.Flags.string({ char: 'r', required: false, exclusive: ["kit"], description: "The container registry in which the image exists (defaults to docker hub)." }),
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
toScript: core_1.Flags.boolean({ char: 'z', required: false, description: `Outputs an assembled command string, NO execution` }),
|
|
238
|
-
silent: core_1.Flags.boolean({ char: 'y', dependsOn: ImageRegistryPullSecretUnset.dependsOn, required: false, description: `(Optional: defaults to false) Prevents confirmations of user-values that are remembered from prior runs. Requires: ${ImageRegistryPullSecretUnset.dependsOn}` }),
|
|
239
|
-
help: core_1.Flags.help({ char: 'h' })
|
|
163
|
+
item: core_1.Flags.string({ char: 'f', options: ["primary", "secondary"], required: false, default: "primary", description: "Applies the command to either the primary (default) or secondary secret for the image registry." }),
|
|
164
|
+
silent: core_1.Flags.boolean({ exclusive: ["echo", "to-script"], description: 'Executes without any user interaction; fails on missing or invalid arguments.' }),
|
|
165
|
+
echo: core_1.Flags.boolean({ exclusive: ["to-script", "silent"], description: 'Renders the equivalent non-interactive command for future use before executing.' }),
|
|
166
|
+
"to-script": core_1.Flags.boolean({ exclusive: ["echo", "silent"], description: 'Renders the equivalent non-interactive command without executing it.' }),
|
|
240
167
|
};
|
|
241
168
|
ImageRegistryPullSecretUnset.args = {};
|
|
242
169
|
//# sourceMappingURL=unset.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unset.js","sourceRoot":"","sources":["../../../../src/commands/imageRegistry/pullSecret/unset.ts"],"names":[],"mappings":";;;AAAA,sCAAoC;AAEpC,
|
|
1
|
+
{"version":3,"file":"unset.js","sourceRoot":"","sources":["../../../../src/commands/imageRegistry/pullSecret/unset.ts"],"names":[],"mappings":";;;AAAA,sCAAoC;AAEpC,kEAA4G;AAC5G,kEAAyF;AAEzF,gFAA0E;AAC1E,8GAAmG;AACnG,kGAA6F;AAC7F,kGAA6F;AAC7F,gFAA4E;AAC5E,sEAAoE;AAOpE,MAAqB,4BAA6B,SAAQ,gDAA4C;IAiB1F,SAAS;QACjB,KAAK,CAAC,SAAS,EAAE,CAAC;QAClB,2DAA2B,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,2DAA2B,CAAC,CAAC,MAAM,EAAE,CAAC;QACpD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,0CAAmB,CAAC,CAAC,MAAM,EAAE,CAAC;IAC9C,CAAC;IAGD,uEAAuE;IACvE,yBAAyB;IAEzB,IAAc,UAAU;QACtB,IAAI,IAAI,CAAC,kBAAkB,KAAK,SAAS,EAAE;YACzC,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,2DAA2B,CAAC,CAAC;SACrE;QACD,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IAGD,uEAAuE;IAG1D,WAAW;;;YACtB,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;YAEjE,IAAI,OAAO,GAAmC,EAAE,CAAC;YACjD,IAAI,KAAK,CAAC,QAAQ;gBAAE,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC;YACrD,OAAO,CAAC,SAAS,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC;YAEjD,MAAM,eAA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,IAAI,EAAE,GAAG,EAAE,CAAC;IAC/B,QAAQ,EAAE,YAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,WAAW,EAAE,4EAA4E,EAAE,CAAC;IACrK,IAAI,EAAE,YAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,iGAAiG,EAAE,CAAC;IAEzN,MAAM,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,WAAW,EAAE,+EAA+E,EAAE,CAAC;IACzJ,IAAI,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,iFAAiF,EAAE,CAAC;IAC3J,WAAW,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,sEAAsE,EAAE,CAAC;CACnJ,CAAC;AAEK,iCAAI,GAAG,EAAE,CAAC"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
import { ImageExport } from '@codiac.io/codiac-relay-contracts';
|
|
3
|
+
import { CommandBaseExecTenant } from '../../command-base-exec-tenant';
|
|
4
|
+
import { RootMap } from '../../apis/codiac-api/contracts';
|
|
5
|
+
import { InteractionModes } from '../../uilogic/config-ui-utils';
|
|
6
|
+
type ImagesAddRequest = {
|
|
7
|
+
img: ImageExport;
|
|
8
|
+
};
|
|
9
|
+
export default class ImagesAdd extends CommandBaseExecTenant<ImagesAddRequest> {
|
|
3
10
|
static description: string;
|
|
4
11
|
static aliases: string[];
|
|
5
|
-
/** Registry defaults to Docker Hub */
|
|
6
12
|
static readonly DEFAULT_REGISTRY_URL = "https://index.docker.io/v1";
|
|
7
|
-
static dependsOn: string[];
|
|
8
13
|
static flags: {
|
|
9
14
|
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
10
15
|
port: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
@@ -14,12 +19,20 @@ export default class ImagesAdd extends CommandBaseEnterprise {
|
|
|
14
19
|
environment: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
15
20
|
username: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
16
21
|
password: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
17
|
-
silent: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
18
22
|
buildParams: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
23
|
+
silent: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
24
|
+
echo: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
25
|
+
"to-script": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
19
26
|
};
|
|
20
27
|
static args: {
|
|
21
28
|
imageName: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
|
|
22
29
|
};
|
|
30
|
+
static examples: Command.Example[];
|
|
23
31
|
protected bootstrap(): void;
|
|
24
|
-
|
|
32
|
+
captureArgs(): Promise<[Partial<ImagesAddRequest>, InteractionModes | undefined, boolean]>;
|
|
33
|
+
buildCandidate_silently(_partial: Partial<ImagesAddRequest>, _rootMap: RootMap): Promise<ImagesAddRequest | undefined>;
|
|
34
|
+
buildCandidate_interactively(_partial: Partial<ImagesAddRequest>, _takeDefaults: boolean, _rootMap: RootMap): Promise<ImagesAddRequest | undefined>;
|
|
35
|
+
buildCommandString(candidate: ImagesAddRequest, cmd: string[]): string[];
|
|
36
|
+
executeTask(candidate: ImagesAddRequest): Promise<void>;
|
|
25
37
|
}
|
|
38
|
+
export {};
|