ScaledJob: Support metadata annotations for ephemeral volume claims #6259
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.
Add
x-kubernetes-preserve-unknown-fields
to ScaledJob CRD in order to support metadata in ephemeral volume claimsBased on #1311
Previously, ArgoCD used to see a diff, bypassed the error but kept the application "OutOfSync":
![image](https://private-user-images.githubusercontent.com/1255977/378883597-2bd97cdd-f151-42c8-82f0-57ec97ed5d7b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3NDQxMzIsIm5iZiI6MTczOTc0MzgzMiwicGF0aCI6Ii8xMjU1OTc3LzM3ODg4MzU5Ny0yYmQ5N2NkZC1mMTUxLTQyYzgtODJmMC01N2VjOTdlZDVkN2IucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTZUMjIxMDMyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ODM5OGJmMzBjMDZmODdiMGIxNzNiZjFiOGUwMTVjYjM0YzlhY2I0OTUwMjQwMDNjZWI5Y2FjMTY2YTVjNDkyZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.IuuaC4r_BtfXe0MVK4QttgTvNcesd9gXb1i1UTxIn3Q)
Yet a warning was triggered:
unknown field "spec.jobTargetRef.template.spec.volumes[5].ephemeral.volumeClaimTemplate.metadata.annotations"
Now the change is applied, the desired block is part of the "live manifest" and the application is "Synced":
![image](https://private-user-images.githubusercontent.com/1255977/378884149-97425e10-5630-46b7-a448-6a5ae198a0cd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3NDQxMzIsIm5iZiI6MTczOTc0MzgzMiwicGF0aCI6Ii8xMjU1OTc3LzM3ODg4NDE0OS05NzQyNWUxMC01NjMwLTQ2YjctYTQ0OC02YTVhZTE5OGEwY2QucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTZUMjIxMDMyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZmVjNTcwMDk5OWE2MDhiMTAwMzYxZTJmYWM4N2E2MmE5MTk2MmJlNmViNzM0YjZjZGY4ZWJjYjBiYjZmOGUzMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.Wi8HpVdjCqf5419syxGI95IHu_Qy_7yk-w3fFUtGGfE)
Checklist
Fixes #6254