-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display helpful error when encountering old Kptfile format #2161
Conversation
Just commenting on the PR description for now:
To be future proof, how do you want to handle
|
98fa9e8
to
6d410c6
Compare
Updated the PR to handle this better. We now have a list of deprecated versions that will result in an error message asking users to upgrade the package. It also introduces a custom error message used whenever the GVK in the Kptfile doesn't match what we expect or is one of the known old formats.
Fixed |
6d410c6
to
1f7745c
Compare
35affdd
to
3b04ccf
Compare
Adds verification that the Kptfile is using the
v1alpha2
format. If a file with the legacyv1alpha1
version is found, an error message is shown to the user.If the legacy version if found in a file that is already in the local fork, we display an error that includes the path to the package on the local filesystem. If a Kptfile with the legacy version is found when fetching/updating a package from an upstream repo, we display an error message that includes the git reference (instead of the path to some temporary directory).
To make sure we only have to do this check in one place, this PR removes the
ReadFile
function from thekptfileutil
package and updates all code to read Kptfiles using the function in thepkg
package. It also makes sure we pass around the Kptfile struct as a pointer rather than a value. Both are valid, but this makes sure we are consistent.Error message when running
kpt fn render
on an old package:Error message when using
kpt pkg get
to fetch an old package:Error message when running
kpt fn render
on a package where the Kptfile has an unknown GVK: