Skip to content

Commit e710f1b

Browse files
authored
add docs for kpt alpha rpkg update (#3747)
1 parent 07abd99 commit e710f1b

File tree

3 files changed

+117
-0
lines changed

3 files changed

+117
-0
lines changed

commands/alpha/rpkg/update/command.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"context"
1919
"fmt"
2020

21+
"github.com/GoogleContainerTools/kpt/internal/docs/generated/rpkgdocs"
2122
"github.com/GoogleContainerTools/kpt/internal/errors"
2223
"github.com/GoogleContainerTools/kpt/internal/util/porch"
2324
porchapi "github.com/GoogleContainerTools/kpt/porch/api/porch/v1alpha1"
@@ -46,6 +47,9 @@ func newRunner(ctx context.Context, rcg *genericclioptions.ConfigFlags) *runner
4647
Use: "update SOURCE_PACKAGE",
4748
PreRunE: r.preRunE,
4849
RunE: r.runE,
50+
Short: rpkgdocs.UpdateShort,
51+
Long: rpkgdocs.UpdateShort + "\n" + rpkgdocs.UpdateLong,
52+
Example: rpkgdocs.UpdateExamples,
4953
Hidden: porch.HidePorchCommands,
5054
}
5155
r.Command.Flags().StringVar(&r.revision, "revision", "", "Revision of the upstream package to update to.")

internal/docs/generated/rpkgdocs/docs.go

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
title: "`clone`"
3+
linkTitle: "clone"
4+
type: docs
5+
description: >
6+
Update a downstream package revision to a more recent revision of its upstream package.
7+
---
8+
9+
<!--mdtogo:Short
10+
Update a downstream package revision to a more recent revision of its upstream package.
11+
-->
12+
13+
`update` performs a kpt pkg update on an existing downstream package revision.
14+
15+
### Synopsis
16+
17+
<!--mdtogo:Long-->
18+
19+
```
20+
kpt alpha rpkg update PACKAGE_REV_NAME [flags]
21+
```
22+
23+
#### Args
24+
25+
```
26+
PACKAGE_REV_NAME:
27+
The target downstream package revision to be updated.
28+
29+
```
30+
31+
#### Flags
32+
33+
```
34+
--revision
35+
The revision number of the upstream kpt package that the target
36+
downstream package (PACKAGE_REV_NAME) should be updated to. With
37+
this flag, you can only specify one target downstream package.
38+
39+
--discover
40+
If set, list packages revisions that need updates rather than
41+
performing an update. Must be one of 'upstream' or 'downstream'. If
42+
set to 'upstream', this will list downstream package revisions that
43+
have upstream updates available. If set to 'downstream', this will list
44+
upstream package revisions whose downstream package revisions need
45+
to be updated. You can optionally pass in package revision names as arguments
46+
in order to just list updates for those package revisions, or you can
47+
pass in no arguments in order to list available updates for all package
48+
revisions.
49+
50+
```
51+
52+
<!--mdtogo-->
53+
54+
### Examples
55+
56+
<!--mdtogo:Examples-->
57+
58+
```shell
59+
# update deployment-e982b2196b35a4f5e81e92f49a430fe463aa9f1a package to v3 of its upstream
60+
$ kpt alpha rpkg update deployment-e982b2196b35a4f5e81e92f49a430fe463aa9f1a --revision=v3
61+
```
62+
63+
```shell
64+
# see available upstream updates for all your downstream packages
65+
$ kpt alpha rpkg update --discover=upstream
66+
```
67+
68+
```shell
69+
# see available updates for any downstream packages that were created from the upstream blueprints-e982b2196b35a4f5e81e92f49a430fe463aa9f1a package
70+
$ kpt alpha rpkg update --discover=downstream blueprints-e982b2196b35a4f5e81e92f49a430fe463aa9f1a
71+
```
72+
73+
<!--mdtogo-->

0 commit comments

Comments
 (0)