Skip to content

Commit

Permalink
Ensure setup mode work in a ccs environment
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisronline committed Jan 9, 2020
1 parent 459cad5 commit 56fdcc2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import {
INDEX_ALERTS,
} from '../../../common/constants';

export function getIndexPatterns(server, additionalPatterns = {}) {
// wildcard means to search _all_ clusters
const ccs = '*';
export function getIndexPatterns(server, additionalPatterns = {}, ccs = '*') {
const config = server.config();
const esIndexPattern = prefixIndexPattern(config, INDEX_PATTERN_ELASTICSEARCH, ccs);
const kbnIndexPattern = prefixIndexPattern(config, INDEX_PATTERN_KIBANA, ccs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export function clusterSetupStatusRoute(server) {
skipLiveData: Joi.boolean().default(false),
}),
payload: Joi.object({
ccs: Joi.string().optional(),
timeRange: Joi.object({
min: Joi.date().required(),
max: Joi.date().required(),
Expand All @@ -49,7 +50,7 @@ export function clusterSetupStatusRoute(server) {
// the monitoring data. `try/catch` makes it a little more explicit.
try {
await verifyMonitoringAuth(req);
const indexPatterns = getIndexPatterns(server);
const indexPatterns = getIndexPatterns(server, {}, req.payload.ccs);
status = await getCollectionStatus(
req,
indexPatterns,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export function nodeSetupStatusRoute(server) {
skipLiveData: Joi.boolean().default(false),
}),
payload: Joi.object({
ccs: Joi.string().optional(),
timeRange: Joi.object({
min: Joi.date().required(),
max: Joi.date().required(),
Expand All @@ -49,7 +50,7 @@ export function nodeSetupStatusRoute(server) {
// the monitoring data. `try/catch` makes it a little more explicit.
try {
await verifyMonitoringAuth(req);
const indexPatterns = getIndexPatterns(server);
const indexPatterns = getIndexPatterns(server, {}, req.payload.ccs);
status = await getCollectionStatus(
req,
indexPatterns,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ export default function({ loadTestFile }) {
loadTestFile(require.resolve('./detect_logstash_management'));
loadTestFile(require.resolve('./detect_apm'));
loadTestFile(require.resolve('./security'));
loadTestFile(require.resolve('./ccs'));
});
}

0 comments on commit 56fdcc2

Please sign in to comment.