Tool to rebuild/reconcile Kptfile based on ref annotation in the config
When adding a new setter, there are 2+ places need to touch: one is the OpenAPI definition in the Kptfile, others are the actual config which ref to the setter definition.
As time moves: some definition can become out-dated, no referrence at all; while some other with references, but no definition (mainly caused by copy & update).
Can we have a tool like kpt rebuild Kptfile to regenerate Kptfile (mainly the OpenAPI definitions) based on existing references? To remove orphan definitions and also add definition when there is references.
Thanks for filing the issue. This would be a useful feature with UX impact. However, there are things to consider here
- Remove orphan definitions => doable and easy
- Definition when there is references => Can be done for setters and not substitutions. There would be cases where two fields might have different filed value but point to same setter reference. We need to dig deeper and look at the possibility.
- Other option which is not mentioned in the issue => remove setter references if there are no definitions(which is inverse to 2).
@cydu-cloud This issue is no longer relevant with kpt v1 as setters are just a function and there is no need to have setter definitions/openapi section in Kptfile. Closing this issue. Please reopen the issue if you have any concerns. https://catalog.kpt.dev/apply-setters/v0.1/