diff --git a/x-pack/plugins/fleet/common/experimental_features.ts b/x-pack/plugins/fleet/common/experimental_features.ts index bb28867d3bf05..37acc7b056917 100644 --- a/x-pack/plugins/fleet/common/experimental_features.ts +++ b/x-pack/plugins/fleet/common/experimental_features.ts @@ -19,6 +19,7 @@ export const allowedExperimentalValues = Object.freeze({ experimentalDataStreamSettings: false, displayAgentMetrics: true, showIntegrationsSubcategories: false, + agentFqdnMode: true, }); type ExperimentalConfigKeys = Array; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/index.tsx index 396478451d6ee..033359ff8f414 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/index.tsx @@ -39,7 +39,7 @@ import { AgentPolicyPackageBadge } from '../../../../components'; import { AgentPolicyDeleteProvider } from '../agent_policy_delete_provider'; import type { ValidationResults } from '../agent_policy_validation'; -import { policyHasFleetServer } from '../../../../services'; +import { ExperimentalFeaturesService, policyHasFleetServer } from '../../../../services'; import { useOutputOptions, @@ -67,6 +67,7 @@ export const AgentPolicyAdvancedOptionsContent: React.FunctionComponent = isEditing = false, onDelete = () => {}, }) => { + const { agentFqdnMode: agentFqdnModeEnabled } = ExperimentalFeaturesService.get(); const { docLinks } = useStartServices(); const [touchedFields, setTouchedFields] = useState<{ [key: string]: boolean }>({}); const { @@ -521,36 +522,64 @@ export const AgentPolicyAdvancedOptionsContent: React.FunctionComponent = /> - + {agentFqdnModeEnabled && ( + + + + } + description={ - - } - description={ - - } - > - - + } + > + + + + + + + + + + + + + + + + + + + ), + }, + { + id: 'fqdn', + label: ( @@ -558,52 +587,26 @@ export const AgentPolicyAdvancedOptionsContent: React.FunctionComponent = - - - ), - }, - { - id: 'fqdn', - label: ( - - - - - - - - - - - - - - - ), - }, - ]} - idSelected={agentPolicy.agent_features?.length ? 'fqdn' : 'hostname'} - onChange={(id: string) => { - updateAgentPolicy({ - agent_features: id === 'hostname' ? [] : [{ name: 'fqdn', enabled: true }], - }); - }} - name="radio group" - /> - - + ), + }, + ]} + idSelected={agentPolicy.agent_features?.length ? 'fqdn' : 'hostname'} + onChange={(id: string) => { + updateAgentPolicy({ + agent_features: id === 'hostname' ? [] : [{ name: 'fqdn', enabled: true }], + }); + }} + name="radio group" + /> + + + )} {isEditing && 'id' in agentPolicy && !agentPolicy.is_managed ? (