-
Notifications
You must be signed in to change notification settings - Fork 423
Particularize Initializers and Provide Sample Code #3412
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
base: main
Are you sure you want to change the base?
Particularize Initializers and Provide Sample Code #3412
Conversation
|
Skipping CI for Draft Pull Request. |
14d5d6b to
fe0fc0d
Compare
fe0fc0d to
880a48d
Compare
|
Regarding (1): Maybe it makes sense to focus on the code parts that are relevant to building such a controller instead of a fully working example that includes standard stuff like setting up a manager, generating a rest config, etc? Regarding (2): I'm not quite sure, but I suspect the following is happening: When you patch the But @mjudeikis should comment on this too, it's just a hunch at this point. |
|
/ok-to-test |
880a48d to
da31636
Compare
|
|
/label kind/documentation |
|
@SimonTheLeg: The label(s) In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/retest |
|
/retest |
|
I think we need to start collecting extensive examples somewhere in the repo (monorepo style), so we can point users to working e2e examples. We know we have edgecases and missing machinery for how to run this things in an easy way. Docs examples are tend to get out of date super fast so +1 to have them incode and link |
|
@embik @SimonTheLeg I would be huge +1 to move examples into code and link it from docs. Else they will be out of date as soon as next rebase. Otherwise - good to merge if we do this as follow-up |
|
We could directly link to https://github.com/kcp-dev/multicluster-provider/tree/main/examples/initializingworkspaces from the kcp docs and extend it with the changes (?) that @SimonTheLeg made in the example code in this PR. |
I dislike having examples in comments or doc files. IMHO they give a false sense of security that it is documented but in reality they never are tested on changes and quickly forgotten. I started executable examples in the contrib repo: https://github.com/kcp-dev/contrib/tree/main/examples If a build fails off of main the pipeline failure is reported. That can also work for Go code for e.g. controllers. In contrib it won't be build as part of the test suites but at least it will run at least every night and we will get notified if the examples break. Alternatively we could copy that workflow to this repository and then make parts of the documentation testable, e.g. for this case the code could be written to a file: And to reiterate - I like more examples but the examples should be tested and regularly run. If we just plug that into docs somewhere it will be outdated. |
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.
Overall LGTM, thanks for extending this doc
+1 for keeping example in a file
On-behalf-of: SAP <[email protected]> Signed-off-by: Simon Bein <[email protected]>
On-behalf-of: SAP <[email protected]> Signed-off-by: Simon Bein <[email protected]>
On-behalf-of: SAP <[email protected]> Signed-off-by: Simon Bein <[email protected]>
On-behalf-of: SAP <[email protected]> Signed-off-by: Simon Bein <[email protected]>
da31636 to
fb0b655
Compare
…ocumentation On-behalf-of: SAP <[email protected]> Signed-off-by: Simon Bein <[email protected]>
149ae90 to
c85829d
Compare
|
this is also ready for review again |
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.
/lgtm
/approve
|
LGTM label has been added. Git tree hash: 1108795ef0edba396423577292cd031e61dd11f7
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mjudeikis The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@SimonTheLeg: The following tests failed, say
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Summary
Before starting with a detailed review of the content: Two open questions from my side
For now I have put the code into mkdocs tabs to directly live in the documentation. As the example is rather complex, I am thinking it would be better to place this somewhere into our repo and link from to docs to it. Do you agree? If yes, where would be the best place to put the example?
The code works and initializes the workspaces correctly. However it still logs errors like this one. Do you have any ideas what this could be? Since it logs them constantly, I am not feeling quite happy with the code, but I cannot figure out how to fix it. I have tried setting
lc.Name = req.Name, but this runs into the same issueWhat Type of PR Is This?
/kind documentation
/kind documentation
Related Issue(s)
Fixes: making kcp docs a better place :)
Release Notes