Skip to content

Commit

Permalink
Plumb the Provider through kpt into cli-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
seans3 committed Oct 16, 2020
1 parent 818997b commit d1931b6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
11 changes: 7 additions & 4 deletions commands/livecmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"sigs.k8s.io/cli-utils/cmd/initcmd"
"sigs.k8s.io/cli-utils/cmd/preview"
"sigs.k8s.io/cli-utils/cmd/status"
"sigs.k8s.io/cli-utils/pkg/provider"
)

func GetLiveCommand(name string, f util.Factory) *cobra.Command {
Expand All @@ -53,18 +54,20 @@ func GetLiveCommand(name string, f util.Factory) *cobra.Command {
ErrOut: os.Stderr,
}

provider := provider.NewProvider(f)

initCmd := initcmd.NewCmdInit(f, ioStreams)
initCmd.Short = livedocs.InitShort
initCmd.Long = livedocs.InitShort + "\n" + livedocs.InitLong
initCmd.Example = livedocs.InitExamples

applyCmd := apply.ApplyCommand(f, ioStreams)
applyCmd := apply.GetApplyRunner(provider, ioStreams).Command
_ = applyCmd.Flags().MarkHidden("no-prune")
applyCmd.Short = livedocs.ApplyShort
applyCmd.Long = livedocs.ApplyShort + "\n" + livedocs.ApplyLong
applyCmd.Example = livedocs.ApplyExamples

previewCmd := preview.PreviewCommand(f, ioStreams)
previewCmd := preview.GetPreviewRunner(provider, ioStreams).Command
previewCmd.Short = livedocs.PreviewShort
previewCmd.Long = livedocs.PreviewShort + "\n" + livedocs.PreviewLong
previewCmd.Example = livedocs.PreviewExamples
Expand All @@ -74,12 +77,12 @@ func GetLiveCommand(name string, f util.Factory) *cobra.Command {
diffCmd.Long = livedocs.DiffShort + "\n" + livedocs.DiffLong
diffCmd.Example = livedocs.DiffExamples

destroyCmd := destroy.DestroyCommand(f, ioStreams)
destroyCmd := destroy.GetDestroyRunner(provider, ioStreams).Command
destroyCmd.Short = livedocs.DestroyShort
destroyCmd.Long = livedocs.DestroyShort + "\n" + livedocs.DestroyLong
destroyCmd.Example = livedocs.DestroyExamples

statusCmd := status.StatusCommand(f)
statusCmd := status.GetStatusRunner(provider).Command
statusCmd.Short = livedocs.StatusShort
statusCmd.Long = livedocs.StatusLong
statusCmd.Example = livedocs.StatusExamples
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
// Currently, we have to import the latest version of kubectl.
// Once there is a 0.18 release, we can import a semver release.
k8s.io/kubectl v0.0.0-20191219154910-1528d4eea6dd
sigs.k8s.io/cli-utils v0.20.6
sigs.k8s.io/cli-utils v0.20.7-0.20201016204101-35a4eb0f63f9
sigs.k8s.io/kustomize/cmd/config v0.8.3
sigs.k8s.io/kustomize/kyaml v0.9.2
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,8 @@ modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
sigs.k8s.io/cli-utils v0.20.6 h1:leIIk2NOzacXqhuNnm0tB328RSzp+1QR9PkAdSP1aRI=
sigs.k8s.io/cli-utils v0.20.6/go.mod h1:Lsj0EXMtqcSYyIPY9IXemMQW/muYDHMEWNfQI/DctrA=
sigs.k8s.io/cli-utils v0.20.7-0.20201016204101-35a4eb0f63f9 h1:jVCjSNcisbAtk4PE7WMXAuKJPVLHkk+8iF+zu9HjHhc=
sigs.k8s.io/cli-utils v0.20.7-0.20201016204101-35a4eb0f63f9/go.mod h1:Lsj0EXMtqcSYyIPY9IXemMQW/muYDHMEWNfQI/DctrA=
sigs.k8s.io/controller-runtime v0.4.0 h1:wATM6/m+3w8lj8FXNaO6Fs/rq/vqoOjO1Q116Z9NPsg=
sigs.k8s.io/controller-runtime v0.4.0/go.mod h1:ApC79lpY3PHW9xj/w9pj+lYkLgwAAUZwfXkME1Lajns=
sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0=
Expand Down

0 comments on commit d1931b6

Please sign in to comment.