From dc2c6495126ee229b6b1240b35b0c7f6f9505989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Cie=C5=9Blak?= Date: Mon, 3 Jun 2024 17:29:11 +0200 Subject: [PATCH] Remove feature flag for VNet, unhide `tsh vnet` (#42304) --- tool/tsh/common/vnet_darwin.go | 3 +-- web/packages/teleterm/src/mainProcess/fixtures/mocks.ts | 1 - .../teleterm/src/services/config/appConfigSchema.ts | 1 - .../src/ui/DocumentCluster/ActionButtons.story.tsx | 1 - .../src/ui/TopBar/Connections/Connections.story.tsx | 1 - web/packages/teleterm/src/ui/Vnet/vnetContext.tsx | 8 +++----- 6 files changed, 4 insertions(+), 11 deletions(-) diff --git a/tool/tsh/common/vnet_darwin.go b/tool/tsh/common/vnet_darwin.go index c31fccb363ab7..8a396fabdc585 100644 --- a/tool/tsh/common/vnet_darwin.go +++ b/tool/tsh/common/vnet_darwin.go @@ -33,8 +33,7 @@ type vnetCommand struct { func newVnetCommand(app *kingpin.Application) *vnetCommand { cmd := &vnetCommand{ - // TODO(nklaassen): unhide this when ready to ship. - CmdClause: app.Command("vnet", "Start Teleport VNet, a virtual network for TCP application access.").Hidden(), + CmdClause: app.Command("vnet", "Start Teleport VNet, a virtual network for TCP application access."), } return cmd } diff --git a/web/packages/teleterm/src/mainProcess/fixtures/mocks.ts b/web/packages/teleterm/src/mainProcess/fixtures/mocks.ts index 6c73d183273b4..22bb9d3e007ec 100644 --- a/web/packages/teleterm/src/mainProcess/fixtures/mocks.ts +++ b/web/packages/teleterm/src/mainProcess/fixtures/mocks.ts @@ -33,7 +33,6 @@ export class MockMainProcessClient implements MainProcessClient { jsonSchemaFile: createMockFileStorage(), platform: this.getRuntimeSettings().platform, }); - this.configService.set('feature.vnet', true); } subscribeToNativeThemeUpdate() { diff --git a/web/packages/teleterm/src/services/config/appConfigSchema.ts b/web/packages/teleterm/src/services/config/appConfigSchema.ts index b8da5a431fe55..af64f60d22d88 100644 --- a/web/packages/teleterm/src/services/config/appConfigSchema.ts +++ b/web/packages/teleterm/src/services/config/appConfigSchema.ts @@ -122,7 +122,6 @@ export const createAppConfigSchema = (platform: Platform) => { .boolean() .default(false) .describe('Disables SSH connection resumption.'), - 'feature.vnet': z.boolean().default(false).describe('Shows UI for VNet.'), }); }; diff --git a/web/packages/teleterm/src/ui/DocumentCluster/ActionButtons.story.tsx b/web/packages/teleterm/src/ui/DocumentCluster/ActionButtons.story.tsx index e7dd7acb4eaa5..3b397d9b6093f 100644 --- a/web/packages/teleterm/src/ui/DocumentCluster/ActionButtons.story.tsx +++ b/web/packages/teleterm/src/ui/DocumentCluster/ActionButtons.story.tsx @@ -44,7 +44,6 @@ export default { export function ActionButtons() { const appContext = new MockAppContext(); - appContext.configService.set('feature.vnet', true); prepareAppContext(appContext); return ( diff --git a/web/packages/teleterm/src/ui/TopBar/Connections/Connections.story.tsx b/web/packages/teleterm/src/ui/TopBar/Connections/Connections.story.tsx index 4fc9ee8cccbed..47fe727ab873f 100644 --- a/web/packages/teleterm/src/ui/TopBar/Connections/Connections.story.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Connections/Connections.story.tsx @@ -265,7 +265,6 @@ const prepareAppContext = (appContext: MockAppContext) => { appContext.connectionTracker.disconnectItem = async () => {}; appContext.connectionTracker.removeItem = async () => {}; appContext.connectionTracker.useState = () => null; - appContext.configService.set('feature.vnet', true); }; const useOpenConnections = () => { diff --git a/web/packages/teleterm/src/ui/Vnet/vnetContext.tsx b/web/packages/teleterm/src/ui/Vnet/vnetContext.tsx index d7a3b71605f16..32898fd197553 100644 --- a/web/packages/teleterm/src/ui/Vnet/vnetContext.tsx +++ b/web/packages/teleterm/src/ui/Vnet/vnetContext.tsx @@ -55,7 +55,7 @@ export const VnetContext = createContext(null); export const VnetContextProvider: FC = props => { const [status, setStatus] = useState('stopped'); - const { vnet, mainProcessClient, configService } = useAppContext(); + const { vnet, mainProcessClient } = useAppContext(); const isWorkspaceStateInitialized = useStoreSelector( 'workspacesService', useCallback(state => state.isInitialized, []) @@ -65,10 +65,8 @@ export const VnetContextProvider: FC = props => { }); const isSupported = useMemo( - () => - mainProcessClient.getRuntimeSettings().platform === 'darwin' && - configService.get('feature.vnet').value, - [mainProcessClient, configService] + () => mainProcessClient.getRuntimeSettings().platform === 'darwin', + [mainProcessClient] ); const [startAttempt, start] = useAsync(