Skip to content

Commit

Permalink
add docs for kpt alpha rpkg update (#3747)
Browse files Browse the repository at this point in the history
  • Loading branch information
natasha41575 committed Jan 26, 2023
1 parent 07abd99 commit e710f1b
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 0 deletions.
4 changes: 4 additions & 0 deletions commands/alpha/rpkg/update/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"fmt"

"github.com/GoogleContainerTools/kpt/internal/docs/generated/rpkgdocs"
"github.com/GoogleContainerTools/kpt/internal/errors"
"github.com/GoogleContainerTools/kpt/internal/util/porch"
porchapi "github.com/GoogleContainerTools/kpt/porch/api/porch/v1alpha1"
Expand Down Expand Up @@ -46,6 +47,9 @@ func newRunner(ctx context.Context, rcg *genericclioptions.ConfigFlags) *runner
Use: "update SOURCE_PACKAGE",
PreRunE: r.preRunE,
RunE: r.runE,
Short: rpkgdocs.UpdateShort,
Long: rpkgdocs.UpdateShort + "\n" + rpkgdocs.UpdateLong,
Example: rpkgdocs.UpdateExamples,
Hidden: porch.HidePorchCommands,
}
r.Command.Flags().StringVar(&r.revision, "revision", "", "Revision of the upstream package to update to.")
Expand Down
40 changes: 40 additions & 0 deletions internal/docs/generated/rpkgdocs/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 73 additions & 0 deletions site/reference/cli/alpha/rpkg/update/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: "`clone`"
linkTitle: "clone"
type: docs
description: >
Update a downstream package revision to a more recent revision of its upstream package.
---

<!--mdtogo:Short
Update a downstream package revision to a more recent revision of its upstream package.
-->

`update` performs a kpt pkg update on an existing downstream package revision.

### Synopsis

<!--mdtogo:Long-->

```
kpt alpha rpkg update PACKAGE_REV_NAME [flags]
```

#### Args

```
PACKAGE_REV_NAME:
The target downstream package revision to be updated.
```

#### Flags

```
--revision
The revision number of the upstream kpt package that the target
downstream package (PACKAGE_REV_NAME) should be updated to. With
this flag, you can only specify one target downstream package.
--discover
If set, list packages revisions that need updates rather than
performing an update. Must be one of 'upstream' or 'downstream'. If
set to 'upstream', this will list downstream package revisions that
have upstream updates available. If set to 'downstream', this will list
upstream package revisions whose downstream package revisions need
to be updated. You can optionally pass in package revision names as arguments
in order to just list updates for those package revisions, or you can
pass in no arguments in order to list available updates for all package
revisions.
```

<!--mdtogo-->

### Examples

<!--mdtogo:Examples-->

```shell
# update deployment-e982b2196b35a4f5e81e92f49a430fe463aa9f1a package to v3 of its upstream
$ kpt alpha rpkg update deployment-e982b2196b35a4f5e81e92f49a430fe463aa9f1a --revision=v3
```

```shell
# see available upstream updates for all your downstream packages
$ kpt alpha rpkg update --discover=upstream
```

```shell
# see available updates for any downstream packages that were created from the upstream blueprints-e982b2196b35a4f5e81e92f49a430fe463aa9f1a package
$ kpt alpha rpkg update --discover=downstream blueprints-e982b2196b35a4f5e81e92f49a430fe463aa9f1a
```

<!--mdtogo-->

0 comments on commit e710f1b

Please sign in to comment.