diff --git a/lib/modules/manager/kubernetes/extract.ts b/lib/modules/manager/kubernetes/extract.ts index 9ac56edc663fe42cfc009c7d20b5e150d6c5ddf3..5bae891c57fb7aa5578aea715ee080d230e922a9 100644 --- a/lib/modules/manager/kubernetes/extract.ts +++ b/lib/modules/manager/kubernetes/extract.ts @@ -1,3 +1,4 @@ +import is from '@sindresorhus/is'; import { loadAll } from 'js-yaml'; import { logger } from '../../../logger'; import { newlineRegex, regEx } from '../../../util/regex'; @@ -56,8 +57,15 @@ function extractApis(content: string): PackageDependency[] { return []; } - return doc.map((configuration) => ({ - depName: configuration.kind, - currentValue: configuration.apiVersion, - })); + return doc + .filter(is.truthy) + .filter( + (m) => + is.nonEmptyStringAndNotWhitespace(m.kind) && + is.nonEmptyStringAndNotWhitespace(m.apiVersion) + ) + .map((configuration) => ({ + depName: configuration.kind, + currentValue: configuration.apiVersion, + })); }