mirror of
https://github.com/actions/runner-container-hooks.git
synced 2025-12-17 10:16:44 +00:00
added permission check for secrets (#14)
* added permission check for secrets * typo in subresource * moved auth check to the command receiver
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { pruneSecrets, prunePods } from '../k8s'
|
||||
import { prunePods, pruneSecrets } from '../k8s'
|
||||
|
||||
export async function cleanupJob(): Promise<void> {
|
||||
await prunePods()
|
||||
await pruneSecrets()
|
||||
await Promise.all([prunePods(), pruneSecrets()])
|
||||
}
|
||||
|
||||
@@ -6,11 +6,8 @@ import path from 'path'
|
||||
import {
|
||||
containerPorts,
|
||||
createPod,
|
||||
isAuthPermissionsOK,
|
||||
isPodContainerAlpine,
|
||||
namespace,
|
||||
prunePods,
|
||||
requiredPermissions,
|
||||
waitForPodPhases
|
||||
} from '../k8s'
|
||||
import {
|
||||
@@ -30,13 +27,6 @@ export async function prepareJob(
|
||||
}
|
||||
|
||||
await prunePods()
|
||||
if (!(await isAuthPermissionsOK())) {
|
||||
throw new Error(
|
||||
`The Service account needs the following permissions ${JSON.stringify(
|
||||
requiredPermissions
|
||||
)} on the pod resource in the '${namespace}' namespace. Please contact your self hosted runner administrator.`
|
||||
)
|
||||
}
|
||||
await copyExternalsToRoot()
|
||||
let container: k8s.V1Container | undefined = undefined
|
||||
if (args.container?.image) {
|
||||
|
||||
Reference in New Issue
Block a user