Skip to content

Commit 1982904

Browse files
committed
fixing test cases to add kernal fallback back
1 parent 5f5752b commit 1982904

File tree

1 file changed

+7
-3
lines changed
  • packages/core/src/shared/vscode

1 file changed

+7
-3
lines changed

packages/core/src/shared/vscode/env.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { onceChanged } from '../utilities/functionUtils'
1111
import { ChildProcess } from '../utilities/processUtils'
1212
import globals, { isWeb } from '../extensionGlobals'
1313
import * as devConfig from '../../dev/config'
14+
import * as os from 'os'
1415

1516
/**
1617
* Returns true if the current build is running on CI (build server).
@@ -245,9 +246,12 @@ export function isAmazonLinux2() {
245246
getLogger().error(`Checking os-release files failed: ${e}`)
246247
}
247248

248-
// If no os-release files found or all failed to parse, assume not AL2
249-
// We do NOT fall back to kernel version as it reflects host OS, not container OS
250-
return false
249+
// Fall back to kernel version check if os-release files are unavailable or failed
250+
// This is needed for environments where os-release might not be accessible
251+
const kernelRelease = os.release()
252+
const hasAL2Kernel = kernelRelease.includes('.amzn2int.') || kernelRelease.includes('.amzn2.')
253+
254+
return hasAL2Kernel
251255
}
252256

253257
/**

0 commit comments

Comments
 (0)