Prevent formatting the kptfile during upgrades
Describe your problem
As discussed during the Nephio meetup in September 2025, we want to prevent formatting the kptfile during upgrades:
- Keep the original comments and formatting of kptfile
- In the new SDK there is a go package called kptfile. Using this go package will preserve most of the formatting.
- We need an issue to change the kpt to use the kptfile go package -> @lapentad
Hi @ciaranjohnston,
I noticed @lapentad was mentioned regarding the creation of this task. If they are not already actively working on the implementation, I would be glad to take ownership of this issue. My approach will be to locate the specific upgrade routines modifying the Kptfile and replace the current YAML rewriting logic with the new SDK's kptfile Go package. This will ensure we preserve the original formatting and user comments during the upgrade cycle.
Please let me know if I have the green light to take this on!
Hi @Jaisheesh-2006 , please feel free to pick up this issue.