Skip to content

Commit

Permalink
Merge pull request #220 from lstocchi/i203_1
Browse files Browse the repository at this point in the history
fix: remove provider lifecyle
  • Loading branch information
lstocchi authored May 22, 2024
2 parents d11c356 + 048f9d8 commit 12bba3d
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ async function _activate(extensionContext: extensionApi.ExtensionContext): Promi
});
extensionContext.subscriptions.push(provider);

if (status !== 'not-installed') {
registerProviderLifecycle(provider, extensionContext, telemetryLogger);
}

if (crcStatus.getProviderStatus() === 'installed' || crcStatus.status.CrcStatus === 'No Cluster') {
registerProviderConnectionFactory(provider, extensionContext, telemetryLogger);
}
Expand Down Expand Up @@ -162,7 +158,6 @@ async function _activate(extensionContext: extensionApi.ExtensionContext): Promi
if (!setupResult) {
return;
}
registerProviderLifecycle(provider, extensionContext, telemetryLogger);
registerProviderConnectionFactory(provider, extensionContext, telemetryLogger);
await connectToCrc();
addCommands(telemetryLogger);
Expand Down Expand Up @@ -213,28 +208,6 @@ async function registerCrcUpdate(
}
}

function registerProviderLifecycle(
provider: extensionApi.Provider,
extensionContext: extensionApi.ExtensionContext,
telemetryLogger: extensionApi.TelemetryLogger,
): void {
const providerLifecycle: extensionApi.ProviderLifecycle = {
status: () => {
return crcStatus.getProviderStatus();
},
start: async context => {
provider.updateStatus('starting');
await startCrc(provider, context.log, telemetryLogger);
},
stop: () => {
provider.updateStatus('stopping');
return stopCrc(telemetryLogger);
},
};

extensionContext.subscriptions.push(provider.registerLifecycle(providerLifecycle));
}

function registerProviderConnectionFactory(
provider: extensionApi.Provider,
extensionContext: extensionApi.ExtensionContext,
Expand Down

0 comments on commit 12bba3d

Please sign in to comment.