1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-07 14:55:27 +02:00

fix(docker/networks): load containers from target node [EE-5446] (#8928)

This commit is contained in:
Chaim Lev-Ari 2023-05-18 12:53:34 +07:00 committed by GitHub
parent 14fa60f6e6
commit 881fa01eb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 97 additions and 73 deletions

View file

@ -27,6 +27,8 @@ axios.interceptors.request.use(async (config) => {
return newConfig;
});
export const agentTargetHeader = 'X-PortainerAgent-Target';
export function agentInterceptor(config: AxiosRequestConfig) {
if (!config.url || !config.url.includes('/docker/')) {
return config;
@ -35,7 +37,7 @@ export function agentInterceptor(config: AxiosRequestConfig) {
const newConfig = { headers: config.headers || {}, ...config };
const target = portainerAgentTargetHeader();
if (target) {
newConfig.headers['X-PortainerAgent-Target'] = target;
newConfig.headers[agentTargetHeader] = target;
}
if (portainerAgentManagerOperation()) {