mirror of
https://github.com/tale/headplane.git
synced 2026-08-20 18:02:17 +00:00
chore(TALE-29): remove acl from integration/context
This commit is contained in:
@@ -88,36 +88,6 @@ export default createIntegration<Context>({
|
||||
return context.client !== undefined
|
||||
},
|
||||
|
||||
onAclChange: async (context) => {
|
||||
if (!context.client || !context.container) {
|
||||
return
|
||||
}
|
||||
|
||||
log.info('INTG', 'Sending SIGHUP to Headscale via Docker')
|
||||
|
||||
let attempts = 0
|
||||
while (attempts <= context.maxAttempts) {
|
||||
const response = await context.client.request({
|
||||
method: 'POST',
|
||||
path: `/v1.30/containers/${context.container}/kill?signal=SIGHUP`,
|
||||
})
|
||||
|
||||
if (response.statusCode !== 204) {
|
||||
if (attempts < context.maxAttempts) {
|
||||
attempts++
|
||||
await setTimeout(1000)
|
||||
continue
|
||||
}
|
||||
|
||||
const stringCode = response.statusCode.toString()
|
||||
const body = await response.body.text()
|
||||
throw new Error(`API request failed: ${stringCode} ${body}`)
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
},
|
||||
|
||||
onConfigChange: async (context) => {
|
||||
if (!context.client || !context.container) {
|
||||
return
|
||||
|
||||
@@ -3,7 +3,6 @@ export interface IntegrationFactory<T = any> {
|
||||
name: string
|
||||
context: T
|
||||
isAvailable: (context: T) => Promise<boolean> | boolean
|
||||
onAclChange?: (context: T) => Promise<void> | void
|
||||
onConfigChange?: (context: T) => Promise<void> | void
|
||||
}
|
||||
|
||||
|
||||
@@ -177,15 +177,6 @@ export default createIntegration<Context>({
|
||||
}
|
||||
},
|
||||
|
||||
onAclChange: (context) => {
|
||||
if (!context.pid) {
|
||||
return
|
||||
}
|
||||
|
||||
log.info('INTG', 'Sending SIGHUP to Headscale')
|
||||
kill(context.pid, 'SIGHUP')
|
||||
},
|
||||
|
||||
onConfigChange: (context) => {
|
||||
if (!context.pid) {
|
||||
return
|
||||
|
||||
+1
-10
@@ -70,14 +70,5 @@ export default createIntegration<Context>({
|
||||
log.error('INTG', 'Failed to read /proc')
|
||||
return false
|
||||
}
|
||||
},
|
||||
|
||||
onAclChange: (context) => {
|
||||
if (!context.pid) {
|
||||
return
|
||||
}
|
||||
|
||||
log.info('INTG', 'Sending SIGHUP to Headscale')
|
||||
kill(context.pid, 'SIGHUP')
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user