@@ -20,33 +20,30 @@ func NewUpdateCommand() *cobra.Command {
20
20
updateCmd := & cobra.Command {
21
21
Use : "update" ,
22
22
Short : "Update a Kubebuilder project to a newer version" ,
23
- Long : `Update a Kubebuilder project to a newer version using a three -way merge strategy.
23
+ Long : `This command upgrades your Kubebuilder project to the latest scaffold layout using a 3 -way merge strategy.
24
24
25
- This command helps you upgrade your Kubebuilder project by :
26
- 1. Creating a clean ancestor branch with the old version's scaffolding
27
- 2. Creating a current branch with your project's current state
28
- 3. Creating an upgrade branch with the new version's scaffolding
29
- 4. Attempting to merge the changes automatically
25
+ It performs the following steps :
26
+ 1. Creates an ' ancestor' branch from the version originally used to scaffold the project
27
+ 2. Creates a ' current' branch with your project's current state
28
+ 3. Creates an ' upgrade' branch using the new version's scaffolding
29
+ 4. Attempts a 3-way merge into a 'merge' branch
30
30
31
- The process creates several Git branches to help you manage the upgrade :
32
- - ancestor: Clean scaffolding from the original version
33
- - current: Your project's current state
34
- - upgrade: Clean scaffolding from the new version
35
- - merge: Attempted automatic merge of upgrade into current
31
+ The process uses Git branches:
32
+ - ancestor: clean scaffold from the original version
33
+ - current: your existing project state
34
+ - upgrade: scaffold from the target version
35
+ - merge: result of the 3-way merge
36
36
37
- If conflicts occur during the merge, you'll need to resolve them manually.
37
+ If conflicts occur during the merge, resolve them manually in the 'merge' branch.
38
+ Once resolved, commit and push it as a pull request. This branch will contain the
39
+ final upgraded project with the latest Kubebuilder layout and your custom code.
38
40
39
41
Examples:
40
42
# Update using the version specified in PROJECT file
41
43
kubebuilder alpha update
42
44
43
45
# Update from a specific version
44
- kubebuilder alpha update --from-version v3.0.0
45
-
46
- Requirements:
47
- - Must be run from the root of a Kubebuilder project
48
- - Git repository must be clean (no uncommitted changes)
49
- - PROJECT file must exist and contain a valid layout version` ,
46
+ kubebuilder alpha update --from-version v3.0.0` ,
50
47
51
48
// TODO: Add validation to ensure we're in a Kubebuilder project and Git repo is clean
52
49
// PreRunE: func(_ *cobra.Command, _ []string) error {
@@ -62,7 +59,7 @@ Requirements:
62
59
63
60
// Flag to override the version specified in the PROJECT file
64
61
updateCmd .Flags ().StringVar (& opts .FromVersion , "from-version" , "" ,
65
- "Override the CLI version from PROJECT file. Specify the Kubebuilder version to upgrade from (e.g., 'v3.0.0' or '3.0.0')" )
62
+ "Kubebuilder binary release version to upgrade from (e.g., 'v3.0.0'). Defaults to cliVersion in PROJECT file. Should match the version used to init the project."
66
63
67
64
return updateCmd
68
65
}
0 commit comments