Skip to content

Commit

Permalink
InjectTokens.K8>InjectTokens.K0001
Browse files Browse the repository at this point in the history
Signed-off-by: Jeromy Cannon <[email protected]>
  • Loading branch information
jeromy-cannon committed Feb 11, 2025
1 parent 9566a57 commit 46f69ed
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions src/core/account_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ export class AccountManager {

constructor(
@inject(InjectTokens.SoloLogger) private readonly logger?: SoloLogger,
@inject(InjectTokens.K8Factory) private readonly k8Factory?: K8Factory,
@inject(InjectTokens.K0001Factory) private readonly k8Factory?: K8Factory,
) {
this.logger = patchInject(logger, InjectTokens.SoloLogger, this.constructor.name);
this.k8Factory = patchInject(k8Factory, InjectTokens.K8Factory, this.constructor.name);
this.k8Factory = patchInject(k8Factory, InjectTokens.K0001Factory, this.constructor.name);

this._portForwards = [];
this._nodeClient = null;
Expand Down
4 changes: 2 additions & 2 deletions src/core/certificate_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import {InjectTokens} from './dependency_injection/inject_tokens.js';
@injectable()
export class CertificateManager {
constructor(
@inject(InjectTokens.K8) private readonly k8?: K8,
@inject(InjectTokens.K0001) private readonly k8?: K8,
@inject(InjectTokens.SoloLogger) private readonly logger?: SoloLogger,
@inject(InjectTokens.ConfigManager) private readonly configManager?: ConfigManager,
) {
this.k8 = patchInject(k8, InjectTokens.K8, this.constructor.name);
this.k8 = patchInject(k8, InjectTokens.K0001, this.constructor.name);
this.logger = patchInject(logger, InjectTokens.SoloLogger, this.constructor.name);
this.configManager = patchInject(configManager, InjectTokens.ConfigManager, this.constructor.name);
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/cluster_checks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import {InjectTokens} from './dependency_injection/inject_tokens.js';
export class ClusterChecks {
constructor(
@inject(InjectTokens.SoloLogger) private readonly logger?: SoloLogger,
@inject(InjectTokens.K8) private readonly k8?: K8,
@inject(InjectTokens.K0001) private readonly k8?: K8,
) {
this.logger = patchInject(logger, InjectTokens.SoloLogger, this.constructor.name);
this.k8 = patchInject(k8, InjectTokens.K8, this.constructor.name);
this.k8 = patchInject(k8, InjectTokens.K0001, this.constructor.name);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/core/config/remote/remote_config_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ export class RemoteConfigManager {
* @param configManager - Manager to retrieve application flags and settings.
*/
public constructor(
@inject(InjectTokens.K8) private readonly k8?: K8,
@inject(InjectTokens.K0001) private readonly k8?: K8,
@inject(InjectTokens.SoloLogger) private readonly logger?: SoloLogger,
@inject(InjectTokens.LocalConfig) private readonly localConfig?: LocalConfig,
@inject(InjectTokens.ConfigManager) private readonly configManager?: ConfigManager,
) {
this.k8 = patchInject(k8, InjectTokens.K8, this.constructor.name);
this.k8 = patchInject(k8, InjectTokens.K0001, this.constructor.name);
this.logger = patchInject(logger, InjectTokens.SoloLogger, this.constructor.name);
this.localConfig = patchInject(localConfig, InjectTokens.LocalConfig, this.constructor.name);
this.configManager = patchInject(configManager, InjectTokens.ConfigManager, this.constructor.name);
Expand Down
4 changes: 2 additions & 2 deletions src/core/dependency_injection/container_init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ export class Container {

container.register(InjectTokens.ChartManager, {useClass: ChartManager}, {lifecycle: Lifecycle.Singleton});
container.register(InjectTokens.ConfigManager, {useClass: ConfigManager}, {lifecycle: Lifecycle.Singleton});
container.register(InjectTokens.K8, {useClass: K8Client}, {lifecycle: Lifecycle.Singleton}); // TODO remove
container.register(InjectTokens.K8Factory, {useClass: K8ClientFactory}, {lifecycle: Lifecycle.Singleton});
container.register(InjectTokens.K0001, {useClass: K8Client}, {lifecycle: Lifecycle.Singleton}); // TODO remove
container.register(InjectTokens.K0001Factory, {useClass: K8ClientFactory}, {lifecycle: Lifecycle.Singleton});
container.register(InjectTokens.AccountManager, {useClass: AccountManager}, {lifecycle: Lifecycle.Singleton});
container.register(InjectTokens.PlatformInstaller, {useClass: PlatformInstaller}, {lifecycle: Lifecycle.Singleton});
container.register(InjectTokens.KeyManager, {useClass: KeyManager}, {lifecycle: Lifecycle.Singleton});
Expand Down
4 changes: 2 additions & 2 deletions src/core/lease/lease_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ export class LeaseManager {
constructor(
@inject(InjectTokens.LeaseRenewalService) private readonly _renewalService?: LeaseRenewalService,
@inject(InjectTokens.SoloLogger) private readonly _logger?: SoloLogger,
@inject(InjectTokens.K8) private readonly k8?: K8,
@inject(InjectTokens.K0001) private readonly k8?: K8,
@inject(InjectTokens.ConfigManager) private readonly configManager?: ConfigManager,
) {
this._renewalService = patchInject(_renewalService, InjectTokens.LeaseRenewalService, this.constructor.name);
this._logger = patchInject(_logger, InjectTokens.SoloLogger, this.constructor.name);
this.k8 = patchInject(k8, InjectTokens.K8, this.constructor.name);
this.k8 = patchInject(k8, InjectTokens.K0001, this.constructor.name);
this.configManager = patchInject(configManager, InjectTokens.ConfigManager, this.constructor.name);
}

Expand Down
4 changes: 2 additions & 2 deletions src/core/network_nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import {InjectTokens} from './dependency_injection/inject_tokens.js';
export class NetworkNodes {
constructor(
@inject(InjectTokens.SoloLogger) private readonly logger?: SoloLogger,
@inject(InjectTokens.K8) private readonly k8?: K8,
@inject(InjectTokens.K0001) private readonly k8?: K8,
) {
this.logger = patchInject(logger, InjectTokens.SoloLogger, this.constructor.name);
this.k8 = patchInject(k8, InjectTokens.K8, this.constructor.name);
this.k8 = patchInject(k8, InjectTokens.K0001, this.constructor.name);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/core/platform_installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ import {InjectTokens} from './dependency_injection/inject_tokens.js';
export class PlatformInstaller {
constructor(
@inject(InjectTokens.SoloLogger) private logger?: SoloLogger,
@inject(InjectTokens.K8) private k8?: K8,
@inject(InjectTokens.K0001) private k8?: K8,
@inject(InjectTokens.ConfigManager) private configManager?: ConfigManager,
) {
this.logger = patchInject(logger, InjectTokens.SoloLogger, this.constructor.name);
this.k8 = patchInject(k8, InjectTokens.K8, this.constructor.name);
this.k8 = patchInject(k8, InjectTokens.K0001, this.constructor.name);
this.configManager = patchInject(configManager, InjectTokens.ConfigManager, this.constructor.name);
}

Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function main(argv: any) {
const helm: Helm = container.resolve(InjectTokens.Helm);
const chartManager: ChartManager = container.resolve(InjectTokens.ChartManager);
const configManager: ConfigManager = container.resolve(InjectTokens.ConfigManager);
const k8: K8 = container.resolve(InjectTokens.K8);
const k8: K8 = container.resolve(InjectTokens.K0001);
const accountManager: AccountManager = container.resolve(InjectTokens.AccountManager);
const platformInstaller: PlatformInstaller = container.resolve(InjectTokens.PlatformInstaller);
const keyManager: KeyManager = container.resolve(InjectTokens.KeyManager);
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/integration/commands/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('InitCommand', () => {
before(() => {
sandbox = sinon.createSandbox();
sandbox.stub(K8Client.prototype, 'init').callsFake(() => this);
k8 = container.resolve(InjectTokens.K8);
k8 = container.resolve(InjectTokens.K0001);
localConfig = new LocalConfig(path.join(BASE_TEST_DIR, 'local-config.yaml'));
remoteConfigManager = container.resolve(InjectTokens.RemoteConfigManager);
leaseManager = container.resolve(InjectTokens.LeaseManager);
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/integration/core/k8_e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async function createPod(podRef: PodRef, containerName: ContainerName, podLabelV
describe('K8', () => {
const testLogger = logging.NewLogger('debug', true);
const configManager: ConfigManager = container.resolve(InjectTokens.ConfigManager);
const k8: K8 = container.resolve(InjectTokens.K8);
const k8: K8 = container.resolve(InjectTokens.K0001);
const testNamespace = NamespaceName.of('k8-e2e');
const argv = [];
const podName = PodName.of(`test-pod-${uuid4()}`);
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/integration/core/lease.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const leaseDuration = 4;
describe('Lease', async () => {
const testLogger = logging.NewLogger('debug', true);
const configManager: ConfigManager = container.resolve(InjectTokens.ConfigManager);
const k8: K8 = container.resolve(InjectTokens.K8);
const k8: K8 = container.resolve(InjectTokens.K0001);
const testNamespace = NamespaceName.of('lease-e2e');
const renewalService = new NoopLeaseRenewalService();

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/integration/core/lease_renewal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const leaseDuration = 4;
describe('LeaseRenewalService', async () => {
const testLogger = logging.NewLogger('debug', true);
const configManager: ConfigManager = container.resolve(InjectTokens.ConfigManager);
const k8: K8 = container.resolve(InjectTokens.K8) as K8;
const k8: K8 = container.resolve(InjectTokens.K0001) as K8;
const renewalService: LeaseRenewalService = container.resolve(InjectTokens.LeaseRenewalService);
const testNamespace = NamespaceName.of('lease-renewal-e2e');

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/integration/core/remote_config_validator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('RemoteConfigValidator', () => {
before(async () => {
configManager = container.resolve(InjectTokens.ConfigManager);
configManager.update({[flags.namespace.name]: namespace});
k8 = container.resolve(InjectTokens.K8);
k8 = container.resolve(InjectTokens.K0001);
await k8.namespaces().create(namespace);
});

Expand Down
2 changes: 1 addition & 1 deletion test/test_util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export function bootstrapTestVariables(
const helm: Helm = container.resolve(InjectTokens.Helm);
const chartManager: ChartManager = container.resolve(InjectTokens.ChartManager);
const keyManager: KeyManager = container.resolve(InjectTokens.KeyManager);
const k8: K8 = k8Arg || container.resolve(InjectTokens.K8);
const k8: K8 = k8Arg || container.resolve(InjectTokens.K0001);
const accountManager: AccountManager = container.resolve(InjectTokens.AccountManager);
const platformInstaller: PlatformInstaller = container.resolve(InjectTokens.PlatformInstaller);
const profileManager: ProfileManager = container.resolve(InjectTokens.ProfileManager);
Expand Down
2 changes: 1 addition & 1 deletion test/unit/commands/base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('BaseCommand', () => {

sandbox = sinon.createSandbox();
sandbox.stub(K8Client.prototype, 'init').callsFake(() => this);
const k8 = container.resolve(InjectTokens.K8);
const k8 = container.resolve(InjectTokens.K0001);

// @ts-ignore
baseCmd = new BaseCommand({
Expand Down
2 changes: 1 addition & 1 deletion test/unit/commands/network.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe('NetworkCommand unit tests', () => {
container.registerInstance(InjectTokens.ClusterChecks, clusterChecksStub);

opts.k8.logger = opts.logger;
container.registerInstance(InjectTokens.K8, opts.k8);
container.registerInstance(InjectTokens.K0001, opts.k8);

opts.depManager = sinon.stub() as unknown as DependencyManager;
container.registerInstance<DependencyManager>(InjectTokens.DependencyManager, opts.depManager);
Expand Down

0 comments on commit 46f69ed

Please sign in to comment.