Add enabled local routing rules and gateway version reporting
All checks were successful
Build and Deploy Gateway / build-and-push (push) Successful in 14s
Build and Deploy Gateway / deploy (push) Successful in 13s

This commit is contained in:
2026-07-11 22:14:43 +03:00
parent a0c66edb02
commit 1304a22f1f
22 changed files with 585 additions and 188 deletions

View File

@@ -1,7 +1,7 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { buildVersionInfo } from '../../src/server/version.js';
import { buildGatewayVersionInfo, buildVersionInfo } from '../../src/server/version.js';
import { HARBOR_VERSIONS, versionCompatibility } from '../../src/shared/versions.js';
test('component versions enforce one Harbor major and one Gateway major.minor', () => {
@@ -22,6 +22,24 @@ test('component versions enforce one Harbor major and one Gateway major.minor',
}).compatible, false);
});
test('gateway reports control backend and deployed dataplane separately', () => {
const control = {
apiVersion: 1,
location: 'gateway',
components: { gatewayBackend: '0.4.0' },
runtime: { singBox: '1.12.13' },
};
assert.deepEqual(buildGatewayVersionInfo(control, {
gatewayBackendVersion: '0.3.0',
singBoxVersion: '1.12.13',
}), {
apiVersion: 1,
location: 'gateway',
components: { gatewayBackend: '0.4.0' },
runtime: { dataplaneVersion: '0.3.0', singBox: '1.12.13' },
});
});
test('runtime version info reports the installed sing-box binary', () => {
const run = () => ({ stdout: 'sing-box version 1.12.13\n', stderr: '' });
assert.deepEqual(buildVersionInfo('gateway', run), {