Skip to content

Commit 5a6527d

Browse files
committed
Simple kubectl plugin for plan functionality
We would like to modularize kpt into composable functionality. Start with creating a kubectl plugin that can hold "plan" functionality.
1 parent 4c4cf98 commit 5a6527d

File tree

20 files changed

+1126
-0
lines changed

20 files changed

+1126
-0
lines changed

plugins/cmd/kubectl-plan/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# kubectl-plan
2+
3+
kubectl-plan is an experimental kubectl plugin that dry-runs
4+
apply operations and shows the changes in an easy to read format.
5+
6+
It is still under development and highly experimental, it should
7+
not be treated as stable.

plugins/cmd/kubectl-plan/main.go

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package main
2+
3+
import (
4+
"context"
5+
"fmt"
6+
"os"
7+
8+
"github.com/GoogleContainerTools/kpt/plugins/pkg/cmd/plan"
9+
)
10+
11+
func main() {
12+
if err := Run(context.Background()); err != nil {
13+
fmt.Fprintf(os.Stderr, "%v\n", err)
14+
os.Exit(1)
15+
}
16+
}
17+
18+
func Run(ctx context.Context) error {
19+
root := plan.NewCommand()
20+
return root.ExecuteContext(ctx)
21+
}

plugins/go.mod

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
module github.com/GoogleContainerTools/kpt/plugins
2+
3+
go 1.21.3
4+
5+
require (
6+
github.com/google/go-cmp v0.5.9
7+
github.com/spf13/cobra v1.8.0
8+
k8s.io/apimachinery v0.28.4
9+
k8s.io/client-go v0.28.4
10+
k8s.io/klog v1.0.0
11+
k8s.io/klog/v2 v2.100.1
12+
k8s.io/kubectl v0.28.4
13+
oras.land/oras-go v1.2.4
14+
sigs.k8s.io/kubebuilder-declarative-pattern v0.13.0
15+
sigs.k8s.io/kubebuilder-declarative-pattern/mockkubeapiserver v0.0.0-20231030230424-f6a5c89244f2
16+
sigs.k8s.io/kustomize/kyaml v0.15.0
17+
)
18+
19+
require (
20+
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
21+
github.com/MakeNowJust/heredoc v1.0.0 // indirect
22+
github.com/Microsoft/hcsshim v0.11.0 // indirect
23+
github.com/chai2010/gettext-go v1.0.2 // indirect
24+
github.com/containerd/containerd v1.7.6 // indirect
25+
github.com/davecgh/go-spew v1.1.1 // indirect
26+
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
27+
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
28+
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
29+
github.com/go-errors/errors v1.4.2 // indirect
30+
github.com/go-logr/logr v1.2.4 // indirect
31+
github.com/go-openapi/jsonpointer v0.19.6 // indirect
32+
github.com/go-openapi/jsonreference v0.20.2 // indirect
33+
github.com/go-openapi/swag v0.22.3 // indirect
34+
github.com/gogo/protobuf v1.3.2 // indirect
35+
github.com/golang/protobuf v1.5.3 // indirect
36+
github.com/google/btree v1.0.1 // indirect
37+
github.com/google/gnostic-models v0.6.8 // indirect
38+
github.com/google/gofuzz v1.2.0 // indirect
39+
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
40+
github.com/google/uuid v1.3.0 // indirect
41+
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
42+
github.com/imdario/mergo v0.3.13 // indirect
43+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
44+
github.com/josharian/intern v1.0.0 // indirect
45+
github.com/json-iterator/go v1.1.12 // indirect
46+
github.com/klauspost/compress v1.16.0 // indirect
47+
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
48+
github.com/mailru/easyjson v0.7.7 // indirect
49+
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
50+
github.com/moby/spdystream v0.2.0 // indirect
51+
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect
52+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
53+
github.com/modern-go/reflect2 v1.0.2 // indirect
54+
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
55+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
56+
github.com/opencontainers/go-digest v1.0.0 // indirect
57+
github.com/opencontainers/image-spec v1.1.0-rc5 // indirect
58+
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
59+
github.com/pkg/errors v0.9.1 // indirect
60+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
61+
github.com/sirupsen/logrus v1.9.3 // indirect
62+
github.com/spf13/pflag v1.0.5 // indirect
63+
github.com/xlab/treeprint v1.2.0 // indirect
64+
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
65+
golang.org/x/net v0.17.0 // indirect
66+
golang.org/x/oauth2 v0.8.0 // indirect
67+
golang.org/x/sync v0.3.0 // indirect
68+
golang.org/x/sys v0.13.0 // indirect
69+
golang.org/x/term v0.13.0 // indirect
70+
golang.org/x/text v0.13.0 // indirect
71+
golang.org/x/time v0.3.0 // indirect
72+
google.golang.org/appengine v1.6.7 // indirect
73+
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
74+
google.golang.org/grpc v1.56.3 // indirect
75+
google.golang.org/protobuf v1.31.0 // indirect
76+
gopkg.in/evanphx/json-patch.v5 v5.6.0 // indirect
77+
gopkg.in/inf.v0 v0.9.1 // indirect
78+
gopkg.in/yaml.v2 v2.4.0 // indirect
79+
gopkg.in/yaml.v3 v3.0.1 // indirect
80+
k8s.io/api v0.28.4 // indirect
81+
k8s.io/cli-runtime v0.28.4 // indirect
82+
k8s.io/component-base v0.28.4 // indirect
83+
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
84+
k8s.io/utils v0.0.0-20230505201702-9f6742963106 // indirect
85+
sigs.k8s.io/controller-runtime v0.13.0 // indirect
86+
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
87+
sigs.k8s.io/kustomize/api v0.15.0 // indirect
88+
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
89+
sigs.k8s.io/yaml v1.3.0 // indirect
90+
)

0 commit comments

Comments
 (0)