k8s-deploy
k8s-deploy copied to clipboard
Error handling in substituteImageNameInSpecFile
Discussed in https://github.com/Azure/k8s-deploy/discussions/185
Originally posted by anarian May 3, 2022 I was adding a new set of Kustomize overlays and had my CronJob's container name mismatched between the base and overlay. When running v1.3, it gave me a specific error:
Error: Error: The CronJob "NAME" is invalid:
* spec.jobTemplate.spec.template.spec.containers[0].image: Required value
* spec.jobTemplate.spec.template.spec.containers[1].volumeMounts[0].name: Not found: "secrets"
But running v1.5, the error was much more obscure
Error: TypeError: Cannot read property 'trim' of undefined
I think I traced it to this https://github.com/Azure/k8s-deploy/blob/main/src/utilities/manifestUpdateUtils.ts#L126 it may be good to throw an error here if image name can not be found.
This issue is idle because it has been open for 14 days with no activity.
To ensure you have a valid manifest run the k8s-list action first.
https://github.com/Azure/k8s-lint