fix: docker compose pids location + clear stale update banner
- Move pids limit from service-level `pids_limit` to `deploy.resources.limits.pids` for Compose v5+ compatibility. Some Compose versions normalize both into the same field, causing "can't set distinct values" errors. - Clear OpenClaw update banner when `/api/openclaw/version` reports `updateAvailable: false`. Previously the banner could persist after a successful update because only the `true` path was handled. Closes #353, closes #351
This commit is contained in:
parent
ae39b9b190
commit
065d9f4082
|
|
@ -30,12 +30,12 @@ services:
|
||||||
- NET_BIND_SERVICE
|
- NET_BIND_SERVICE
|
||||||
security_opt:
|
security_opt:
|
||||||
- no-new-privileges:true
|
- no-new-privileges:true
|
||||||
pids_limit: 256
|
|
||||||
deploy:
|
deploy:
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
memory: 512M
|
memory: 512M
|
||||||
cpus: '1.0'
|
cpus: '1.0'
|
||||||
|
pids: 256
|
||||||
networks:
|
networks:
|
||||||
- mc-net
|
- mc-net
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
|
||||||
|
|
@ -254,6 +254,8 @@ export default function Home() {
|
||||||
releaseNotes: data.releaseNotes,
|
releaseNotes: data.releaseNotes,
|
||||||
updateCommand: data.updateCommand,
|
updateCommand: data.updateCommand,
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
setOpenclawUpdate(null)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,13 @@ const ROOT = resolve(__dirname, '../../..')
|
||||||
describe('docker-compose.yml schema', () => {
|
describe('docker-compose.yml schema', () => {
|
||||||
const content = readFileSync(resolve(ROOT, 'docker-compose.yml'), 'utf-8')
|
const content = readFileSync(resolve(ROOT, 'docker-compose.yml'), 'utf-8')
|
||||||
|
|
||||||
it('uses service-level pids_limit instead of deploy.resources.limits.pids', () => {
|
it('uses deploy.resources.limits.pids (not service-level pids_limit)', () => {
|
||||||
// pids_limit should be at service level (not nested inside deploy)
|
// pids limit must be inside deploy.resources.limits for Compose v5+ compatibility.
|
||||||
expect(content).toContain('pids_limit:')
|
// Service-level pids_limit causes "can't set distinct values" errors on some versions.
|
||||||
|
expect(content).not.toContain('pids_limit:')
|
||||||
|
|
||||||
// Should NOT have pids inside deploy.resources.limits
|
|
||||||
const deployBlock = content.match(/deploy:[\s\S]*?(?=\n\s{4}\w|\nvolumes:|\nnetworks:)/)?.[0] ?? ''
|
const deployBlock = content.match(/deploy:[\s\S]*?(?=\n\s{4}\w|\nvolumes:|\nnetworks:)/)?.[0] ?? ''
|
||||||
expect(deployBlock).not.toContain('pids:')
|
expect(deployBlock).toContain('pids:')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('still has memory and cpus in deploy.resources.limits', () => {
|
it('still has memory and cpus in deploy.resources.limits', () => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue