Skip to content

Commit

Permalink
chore: clean
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo committed Jun 6, 2024
1 parent 09768dc commit 12f4bea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/contrib/patches/81-oblik-cap-limits.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ module.exports = async function oblikCapLimits(manifests, _options, _context) {

containers.forEach((container) => {
const containerName = container.name
container.resources ||= {}
const { limits = {} } = container.resources
const { limits = {} } = container.resources || {}

annotationsToCheck.forEach((annotation) => {
const defaultAnnotationValue = annotations[annotation]
Expand Down Expand Up @@ -111,7 +110,8 @@ module.exports = async function oblikCapLimits(manifests, _options, _context) {
(annotation.includes("max") && resourceValue > annotationValue)
) {
limits[key] = annotationValue
container.resources.limits = limits
container.resources ||= {}
container.resources.limits ||= limits
}
}
})
Expand Down

0 comments on commit 12f4bea

Please sign in to comment.