Skip to content

Commit

Permalink
Rename edit command to copy
Browse files Browse the repository at this point in the history
  • Loading branch information
mortent committed May 6, 2022
1 parent 8163def commit 83d9178
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions commands/rpkgcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (

"github.com/GoogleContainerTools/kpt/internal/cmdrpkgapprove"
"github.com/GoogleContainerTools/kpt/internal/cmdrpkgclone"
"github.com/GoogleContainerTools/kpt/internal/cmdrpkgcopy"
"github.com/GoogleContainerTools/kpt/internal/cmdrpkgdel"
"github.com/GoogleContainerTools/kpt/internal/cmdrpkgedit"
"github.com/GoogleContainerTools/kpt/internal/cmdrpkgget"
"github.com/GoogleContainerTools/kpt/internal/cmdrpkginit"
"github.com/GoogleContainerTools/kpt/internal/cmdrpkgpropose"
Expand Down Expand Up @@ -76,7 +76,7 @@ func NewRpkgCommand(ctx context.Context, version string) *cobra.Command {
cmdrpkgapprove.NewCommand(ctx, kubeflags),
cmdrpkgreject.NewCommand(ctx, kubeflags),
cmdrpkgdel.NewCommand(ctx, kubeflags),
cmdrpkgedit.NewCommand(ctx, kubeflags),
cmdrpkgcopy.NewCommand(ctx, kubeflags),
)

return repo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package cmdrpkgedit
package cmdrpkgcopy

import (
"context"
Expand All @@ -28,9 +28,9 @@ import (
)

const (
command = "cmdrpkgedit"
command = "cmdrpkgcopy"
longMsg = `
kpt alpha rpkg edit SOURCE_PACKAGE NAME
kpt alpha rpkg copy SOURCE_PACKAGE NAME
Creates a new copy of a source package in the target repository.
Expand Down Expand Up @@ -63,10 +63,11 @@ func newRunner(ctx context.Context, rcg *genericclioptions.ConfigFlags) *runner
cfg: rcg,
}
c := &cobra.Command{
Use: "edit SOURCE_PACKAGE NAME",
Use: "copy SOURCE_PACKAGE NAME",
Aliases: []string{"edit"},
Short: "Creates a copy of a source package in the target repository.",
Long: longMsg,
Example: "kpt alpha rpkg edit upstream-package-name target-package-name --repository target-repository --revision v1",
Example: "kpt alpha rpkg copy upstream-package-name target-package-name --repository target-repository --revision v1",
PreRunE: r.preRunE,
RunE: r.runE,
Hidden: porch.HidePorchCommands,
Expand All @@ -85,7 +86,7 @@ type runner struct {
client client.Client
Command *cobra.Command

edit porchapi.PackageEditTaskSpec
copy porchapi.PackageEditTaskSpec

repository string // Target repository
revision string // Target package revision
Expand All @@ -111,7 +112,7 @@ func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
source := args[0]
target := args[1]

r.edit.Source = &porchapi.PackageRevisionRef{
r.copy.Source = &porchapi.PackageRevisionRef{
Name: source,
}

Expand All @@ -138,7 +139,7 @@ func (r *runner) runE(cmd *cobra.Command, args []string) error {
Tasks: []porchapi.Task{
{
Type: porchapi.TaskTypeEdit,
Edit: &r.edit,
Edit: &r.copy,
},
},
},
Expand Down

0 comments on commit 83d9178

Please sign in to comment.