Fix: kustomize write target starts failing after indeterminate period at time #583
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes at least one of the causes of the image kustomize write back with git failing as documented in this issue: #240
Our Argo CD Image Updater deployment started having the same issue after switching to use Kustomize from Helm. After troubleshooting the issue with our setup, the process chdir that is happening in the write kustomization func didn't always chdir back to the original dir. Then subsequent
os.Getwd()
calls would fail withgetwd: no such file or directory
because the process working directory was still set to a previous temp dir that no longer exists. After reviewing the implementation details and testing, the chdir code doesn't appear to be needed anyway so it has been removed in the PR fixing the issue.Note:
make test
,make test-race
andmake lint
targets are all still passing after the changes.Also during testing, I noticed that zombie git processes are building up in the running container after each periodic image updater run. The Argo CD project had a similar issue: argoproj/argo-cd#3611. I will be opening another PR with a similar fix as well