k8s-deploy icon indicating copy to clipboard operation
k8s-deploy copied to clipboard

Error handling in substituteImageNameInSpecFile

Open OliverMKing opened this issue 2 years ago • 1 comments

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.

OliverMKing avatar Aug 04 '22 20:08 OliverMKing

This issue is idle because it has been open for 14 days with no activity.

github-actions[bot] avatar Aug 18 '22 21:08 github-actions[bot]

To ensure you have a valid manifest run the k8s-list action first.

https://github.com/Azure/k8s-lint

OliverMKing avatar Oct 03 '22 17:10 OliverMKing