-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
📖 improve docs of rescaffold #4479
Draft
Sijoma
wants to merge
1
commit into
kubernetes-sigs:master
Choose a base branch
from
Sijoma:improve-command-docs-alpha-generate
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ Currently, it supports two optional params, `input-dir` and `output-dir`. | |
|
||
`input-dir` is the path to the existing project that you want to re-scaffold. Default is the current working directory. | ||
|
||
`output-dir` is the path to the directory where you want to generate the new project. Default is a subdirectory in the current working directory. | ||
`output-dir` is the path to the directory where you want to generate the new project. Default is a directory named "output-dir" in the current working directory. | ||
|
||
```sh | ||
kubebuilder alpha generate --input-dir=/path/to/existing/project --output-dir=/path/to/new/project | ||
|
@@ -39,7 +39,7 @@ kubebuilder alpha generate --input-dir=/path/to/existing/project --output-dir=/p | |
<h1>Regarding `input-dir` and `output-dir`:</h1> | ||
|
||
If neither `input-dir` nor `output-dir` are specified, the project will be regenerated in the current directory. | ||
This approach facilitates comparison between your current local branch and the version stored upstream (e.g., GitHub main branch). | ||
This approach facilitates comparison between your code and regenerated files in `output-dir`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
This way, you can easily overlay your project's code changes atop the new scaffold. | ||
|
||
</aside> | ||
|
@@ -50,4 +50,4 @@ This way, you can easily overlay your project's code changes atop the new scaffo | |
- See the [desing proposal documentation](../../../../designs/helper_to_upgrade_projects_by_rescaffolding.md) | ||
|
||
[example]: ./../../../../testdata/project-v4-with-plugins/PROJECT | ||
[more-info]: ./../reference/project-config.md | ||
[more-info]: ./../reference/project-config.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
If we not inform the
output-dir
it should be == $pwd , the current directory.Are you facing a different behaviour?
Does it create a directory called
output-dir
and scaffold the project inside of 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.
So that's the part that confused me.
The flag itself defaults to "" -> pkg/cli/alpha/command.go:59
The struct itself has a default then later here -> pkg/cli/alpha/internal/generate.go:46
It then sets it when this path is "" here as a default. -> pkg/cli/alpha/internal/generate.go:246
At least this is how I understand it and I get a
output-dir
folder.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.
OH we need to fix that.
It is a bug. By default it should be current dir == PWD
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.
Just to get this right: So instead of appending
output-dir
to the PWD it should be just the PWD right?I can make a PR for this & maybe this then also removes the need to change the docs.
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.
So something like this?
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.
We need to do a little more than that.
Also, we need to ensure it via the tests.
See: #4500