diff --git a/tools/devworkspace-handler/src/devfile/dev-container-component-updater.ts b/tools/devworkspace-handler/src/devfile/dev-container-component-updater.ts index f047bfebc..7ccdd099e 100644 --- a/tools/devworkspace-handler/src/devfile/dev-container-component-updater.ts +++ b/tools/devworkspace-handler/src/devfile/dev-container-component-updater.ts @@ -92,7 +92,8 @@ export class DevContainerComponentUpdater { }); // need to tweak the entrypoint to call the ${PLUGIN_REMOTE_ENDPOINT_EXECUTABLE} - devContainer.args = ['sh', '-c', '${PLUGIN_REMOTE_ENDPOINT_EXECUTABLE}']; + devContainer.command = ['sh', '-c']; + devContainer.args = ['${PLUGIN_REMOTE_ENDPOINT_EXECUTABLE}']; // now, need to add the common stuff this.containerPluginRemoteUpdater.update(devContainerComponent.name, devContainer); diff --git a/tools/devworkspace-handler/tests/devfile/dev-container-component-updater.spec.ts b/tools/devworkspace-handler/tests/devfile/dev-container-component-updater.spec.ts index 90170f4e2..65d0a32d9 100644 --- a/tools/devworkspace-handler/tests/devfile/dev-container-component-updater.spec.ts +++ b/tools/devworkspace-handler/tests/devfile/dev-container-component-updater.spec.ts @@ -78,6 +78,7 @@ describe('Test DevContainerComponentUpdater', () => { path: '/existing', }, ], + command: ['tail'], }, }; devContainerComponentFinderFindMethod.mockResolvedValue(devContainerComponent); @@ -137,7 +138,8 @@ describe('Test DevContainerComponentUpdater', () => { }, ]); // args updated - expect(devContainerComponent?.container?.args).toStrictEqual(['sh', '-c', '${PLUGIN_REMOTE_ENDPOINT_EXECUTABLE}']); + expect(devContainerComponent?.container?.command).toStrictEqual(['sh', '-c']); + expect(devContainerComponent?.container?.args).toStrictEqual(['${PLUGIN_REMOTE_ENDPOINT_EXECUTABLE}']); // check we have a new volume added const components = devfileContext.devWorkspace.spec?.template?.components || []; @@ -169,7 +171,8 @@ describe('Test DevContainerComponentUpdater', () => { expect(devContainerComponent?.container?.endpoints).toBeUndefined(); expect(devContainerComponent?.container?.volumeMounts).toBeUndefined(); // args updated - expect(devContainerComponent?.container?.args).toStrictEqual(['sh', '-c', '${PLUGIN_REMOTE_ENDPOINT_EXECUTABLE}']); + expect(devContainerComponent?.container?.command).toStrictEqual(['sh', '-c']); + expect(devContainerComponent?.container?.args).toStrictEqual(['${PLUGIN_REMOTE_ENDPOINT_EXECUTABLE}']); }); test('not a dev container', async () => {