kpt icon indicating copy to clipboard operation
kpt copied to clipboard

Prevent formatting the kptfile during upgrades

Open ciaranjohnston opened this issue 1 year ago • 2 comments

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

ciaranjohnston avatar Oct 29 '25 13:10 ciaranjohnston

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!

Jaisheesh-2006 avatar Feb 24 '26 06:02 Jaisheesh-2006

Hi @Jaisheesh-2006 , please feel free to pick up this issue.

liamfallon avatar Feb 25 '26 08:02 liamfallon