Skip to content

Commit

Permalink
add flag to feel endpoint and rename schema flag to flett migration
Browse files Browse the repository at this point in the history
  • Loading branch information
MiriamAparicio committed Jun 6, 2023
1 parent dcd7633 commit 87d15bf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions x-pack/plugins/apm/common/apm_feature_flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export enum ApmFeatureFlagName {
MigrationToFleetAvailable = 'migrationToFleetAvailable',
SourcemapApiAvailable = 'sourcemapApiAvailable',
SpacesAvailable = 'spacesAvailable',
SchemaAvailable = 'schemaAvailable',
FleetMigrationAvailable = 'fleetMigrationAvailable',
StorageExplorerAvailable = 'storageExplorerAvailable',
}

Expand Down Expand Up @@ -49,7 +49,7 @@ const apmFeatureFlagMap = {
default: true,
type: t.boolean,
},
[ApmFeatureFlagName.SchemaAvailable]: {
[ApmFeatureFlagName.FleetMigrationAvailable]: {
default: true,
type: t.boolean,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export function SettingsTemplate({ children, selectedTab }: Props) {
const agentConfigurationAvailable = useApmFeatureFlag(
ApmFeatureFlagName.AgentConfigurationAvailable
);
const schemaAvailable = useApmFeatureFlag(ApmFeatureFlagName.SchemaAvailable);
const schemaAvailable = useApmFeatureFlag(
ApmFeatureFlagName.FleetMigrationAvailable
);
const indicesAvailable = useApmFeatureFlag(
ApmFeatureFlagName.ConfigurableIndicesAvailable
);
Expand Down
3 changes: 2 additions & 1 deletion x-pack/plugins/apm/server/routes/fleet/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
function throwNotFoundIfApmSchemaNotAvailable(
featureFlags: ApmFeatureFlags
): void {
if (!featureFlags.schemaAvailable) {
if (!featureFlags.fleetMigrationAvailable) {
throw Boom.notFound();
}
}
Expand Down Expand Up @@ -140,6 +140,7 @@ const createCloudApmPackagePolicyRoute = createApmServerRoute({
): Promise<{
cloudApmPackagePolicy: PackagePolicy;
}> => {
throwNotFoundIfApmSchemaNotAvailable(resources.featureFlags);
const { plugins, context, config, request, logger } = resources;
const cloudApmMigrationEnabled = config.agent.migrations.enabled;

Expand Down

0 comments on commit 87d15bf

Please sign in to comment.