-
Notifications
You must be signed in to change notification settings - Fork 231
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
Add KptFileGVK to expose typed GVK information for Kptfile #3584
Conversation
87b6cae
to
fd3435c
Compare
@@ -20,17 +20,35 @@ package v1 | |||
import ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's our long term plan about the Kptfile schema @mortent @droot? I think kpt should import the Kptfile schema from kpt-functions-sdk, so as users and other tools which use the Kptfile schema do not need to import it from Kpt, and this can avoid expected Kpt exposure and dependent loop problems. For example, the go SDK also needs to use the Kptfile schema and it imports from the kpt-functions-sdk/go/api. This change could potentially make the go sdk incompatible with the kpt fn
.
This is not a blocker for this PR. I can pull the change to the kpt-functions-sdk this time. But I'm a little bit worried that the go sdk and kpt could be out of sync if we only make the change on the kpt side and not converge the Kptfile schema.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yuwenma Why does the kpt-functions-sdk have a copy of the Kptfile type? It seems like the kpt repo would be the natural place have it and the sdk would import it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know the exact legacy reasons, but I think it makes sense for 2 reasons
- Users who need to use the Kptfile type (i.e. to write their own kptfile relevant functions), they can import from go-sdk and do not need to import the entire kpt pkg.
- kpt, as a CLI, is not designed for importing purpose so it should not worry too much about supporting its dependants.
It seems like the kpt repo would be the natural place have it and the sdk would import it.
I see kpt/porch has imported go/fn in several places. e.g. porch function wrapper main.go, porch builtin function runtime, which is aligned with the library dependencies I described above. And because of that, I don't think sdk can then import kpt/porch.
fd3435c
to
7db2cee
Compare
15cc8cf
to
70237dd
Compare
More ergonomic than a set of strings. Also do the same for ResultList and FunctionResultList
70237dd
to
020bdef
Compare
More ergonomic than a set of strings.