Skip to content

Commit

Permalink
[Fleet] Fix get one agent when feature flag disabled (elastic#188953)
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet authored Jul 23, 2024
1 parent aa67c80 commit ebdc6be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions x-pack/plugins/fleet/server/routes/agent/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ import { defaultFleetErrorHandler, FleetNotFoundError } from '../../errors';
import * as AgentService from '../../services/agents';
import { fetchAndAssignAgentMetrics } from '../../services/agents/agent_metrics';
import { getAgentStatusForAgentPolicy } from '../../services/agents';
import { appContextService } from '../../services';

export function verifyNamespace(agent: Agent, currentNamespace?: string) {
if (!appContextService.getExperimentalFeatures().useSpaceAwareness) {
return;
}
const isInNamespace =
(currentNamespace && agent.namespaces?.includes(currentNamespace)) ||
(!currentNamespace &&
Expand Down

0 comments on commit ebdc6be

Please sign in to comment.