diff --git a/assets/translations/en-us.yaml b/assets/translations/en-us.yaml index acdc3e7ccb..4c26fb3ada 100644 --- a/assets/translations/en-us.yaml +++ b/assets/translations/en-us.yaml @@ -1306,6 +1306,7 @@ validation: flowOutput: both: Requires "Output" or "Cluster Output" to be selected. global: Requires "Cluster Output" to be selected. + invalidCron: Invalid cron schedule k8s: identifier: emptyLabel: '"{key}" cannot have an empty key' diff --git a/utils/validators/container-images.js b/utils/validators/container-images.js index c6b17bbea6..adfbad50ed 100644 --- a/utils/validators/container-images.js +++ b/utils/validators/container-images.js @@ -3,13 +3,13 @@ export function containerImages(spec, getters, errors) { if (spec.jobTemplate) { // cronjob pod template is nested slightly different than other types - const { jobTemplate: { spec: { template: { spec: { containers } } } } } = spec; + const { jobTemplate: { spec: { template: { spec: { containers = [] } } } } } = spec; - container = containers[0]; + container = containers[0] || {}; } else { - const { template:{ spec:{ containers } } } = spec; + const { template:{ spec:{ containers = [] } } } = spec; - container = containers[0]; + container = containers[0] || {}; } if (!container.image) { diff --git a/utils/validators/cron-schedule.js b/utils/validators/cron-schedule.js index 6116527cfa..d726f6644c 100644 --- a/utils/validators/cron-schedule.js +++ b/utils/validators/cron-schedule.js @@ -4,6 +4,6 @@ export function cronSchedule(schedule = '', getters, errors) { try { cronstrue.toString(schedule); } catch (e) { - errors.push('Invalid cron schedule'); + errors.push(getters['i18n/t']('validation.invalidCron')); } }