Skip to content

Commit

Permalink
Fix admin alterConfigs validation
Browse files Browse the repository at this point in the history
It should validate against the new ConfigResourceType
  • Loading branch information
tulios committed Sep 30, 2020
1 parent 30128e6 commit 900c60a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/admin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const InstrumentationEventEmitter = require('../instrumentation/emitter')
const { events, wrap: wrapEvent, unwrap: unwrapEvent } = require('./instrumentationEvents')
const { LEVELS } = require('../loggers')
const { KafkaJSNonRetriableError, KafkaJSDeleteGroupsError } = require('../errors')
const RESOURCE_TYPES = require('../protocol/resourceTypes')
const CONFIG_RESOURCE_TYPES = require('../protocol/configResourceTypes')
const { EARLIEST_OFFSET, LATEST_OFFSET } = require('../constants')

Expand Down Expand Up @@ -630,7 +629,7 @@ module.exports = ({
throw new KafkaJSNonRetriableError('Resources array cannot be empty')
}

const validResourceTypes = Object.values(RESOURCE_TYPES)
const validResourceTypes = Object.values(CONFIG_RESOURCE_TYPES)
const invalidType = resources.find(r => !validResourceTypes.includes(r.type))

if (invalidType) {
Expand Down

0 comments on commit 900c60a

Please sign in to comment.