Commit 44c9466 1 parent d4ecf97 commit 44c9466 Copy full SHA for 44c9466
File tree 3 files changed +8
-8
lines changed
3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ suite('signin command telemetry reports', () => {
117
117
} ,
118
118
) ;
119
119
vi . spyOn ( subscription , 'isRedHatRegistryConfigured' ) . mockResolvedValue ( true ) ;
120
- vi . spyOn ( podmanCli , 'getRunningPodmanMachineName ' ) . mockReturnValue ( undefined ) ;
120
+ vi . spyOn ( podmanCli , 'getConnectionForRunningPodmanMachine ' ) . mockReturnValue ( undefined ) ;
121
121
await extension . activate ( createExtContext ( ) ) ;
122
122
expect ( commandFunctionCopy ! ) . toBeDefined ( ) ;
123
123
await commandFunctionCopy ! ( ) ;
@@ -180,7 +180,7 @@ suite('signin command telemetry reports', () => {
180
180
} ,
181
181
) ;
182
182
vi . spyOn ( subscription , 'isRedHatRegistryConfigured' ) . mockReturnValue ( true ) ;
183
- vi . spyOn ( podmanCli , 'getRunningPodmanMachineName ' ) . mockReturnValue ( 'machine1' ) ;
183
+ vi . spyOn ( podmanCli , 'getConnectionForRunningPodmanMachine ' ) . mockReturnValue ( 'machine1' ) ;
184
184
vi . spyOn ( OrganizationService . prototype , 'checkOrgScaCapability' ) . mockResolvedValue ( { body : { } } ) ;
185
185
await extension . activate ( createExtContext ( ) ) ;
186
186
expect ( commandFunctionCopy ! ) . toBeDefined ( ) ;
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ import { SubscriptionManagerClient } from '@redhat-developer/rhsm-client';
27
27
import { onDidChangeSessions , RedHatAuthenticationService } from './authentication-service' ;
28
28
import { getAuthConfig } from './configuration' ;
29
29
import {
30
- getRunningPodmanMachineName ,
30
+ getConnectionForRunningPodmanMachine ,
31
31
runCreateFactsFile ,
32
32
runRpmInstallSubscriptionManager ,
33
33
runStartPodmanMachine ,
@@ -191,7 +191,7 @@ async function isPodmanVmSubscriptionActivated(connection: extensionApi.Provider
191
191
}
192
192
193
193
async function removeSession ( sessionId : string ) : Promise < void > {
194
- const connection = getRunningPodmanMachineName ( ) ;
194
+ const connection = getConnectionForRunningPodmanMachine ( ) ;
195
195
if ( connection ) {
196
196
runSubscriptionManagerUnregister ( connection ) . catch ( console . error ) ; // ignore error in case vm subscription activation failed on login
197
197
}
@@ -255,7 +255,7 @@ async function configureRegistryAndActivateSubscription(): Promise<void> {
255
255
title : 'Activating Red Hat Subscription' ,
256
256
} ,
257
257
async ( ) => {
258
- const runningConnection = getRunningPodmanMachineName ( ) ;
258
+ const runningConnection = getConnectionForRunningPodmanMachine ( ) ;
259
259
if ( ! runningConnection ) {
260
260
if ( isLinux ( ) ) {
261
261
await extensionApi . window . showInformationMessage (
Original file line number Diff line number Diff line change @@ -199,13 +199,13 @@ export async function runStartPodmanMachine(
199
199
) ;
200
200
}
201
201
202
- export function getRunningPodmanMachineName ( ) : podmanDesktopAPI . ProviderContainerConnection | undefined {
202
+ export function getConnectionForRunningPodmanMachine ( ) : podmanDesktopAPI . ProviderContainerConnection | undefined {
203
203
const conns = podmanDesktopAPI . provider . getContainerConnections ( ) ;
204
- const startedVms = conns . filter (
204
+ const connToRunningVms = conns . filter (
205
205
conn =>
206
206
conn . providerId === 'podman' &&
207
207
conn . connection . status ( ) === 'started' &&
208
208
! conn . connection . endpoint . socketPath . startsWith ( '/run/user/' ) ,
209
209
) ;
210
- return startedVms . length >= 1 ? startedVms [ 0 ] : undefined ;
210
+ return connToRunningVms . length >= 1 ? connToRunningVms [ 0 ] : undefined ;
211
211
}
You can’t perform that action at this time.
0 commit comments