Skip to content
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

doc: add documentation on naming functions in a Kptfile #4010

Merged
merged 2 commits into from
Aug 14, 2023

Conversation

michaelvl
Copy link
Contributor

@michaelvl michaelvl commented Jul 22, 2023

This PR documents/clarifies that using name on functions in a Kptfile is important when updating packages with kpt pkg update. The issue was discussed in Slack here: https://kubernetes.slack.com/archives/C0155NSPJSZ/p1689926397556699

The name field was not mentioned in the current version of the book, and since function lists are merged as associative lists, the effect of not specifying a name may result in unpredictable ordering of the function lists.

Specifically, the PR updates section 4.1 of the kpt book on "Declarative Function Execution"

A few considerations for reviewers:

  • This document https://github.com/GoogleContainerTools/kpt/pull/2623/files deliberately avoids function names with spaces and resorts to names-with-hyphens instead. This PR use an example with spaces in names.
  • The same document also describe cases where it is possible to do function identification based on the value of image. This PR does not describe this situation since there are multiple requirements for this to be possible. Also, I'm suspecting that this functionality may no longer be active since the example shown in the Slack thread should have merged the updated function list if it had used image as identifier.

@michaelvl michaelvl requested a review from a team as a code owner July 22, 2023 08:55
@michaelvl michaelvl requested a review from mortent July 22, 2023 08:55
@google-cla
Copy link

google-cla bot commented Jul 22, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@natasha41575 natasha41575 self-assigned this Jul 24, 2023
Copy link
Contributor

@natasha41575 natasha41575 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good. Some small wording suggestions.

@natasha41575
Copy link
Contributor

Thanks! Will merge this once the tests finish.

@natasha41575 natasha41575 merged commit 30272c9 into kptdev:main Aug 14, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants