File tree Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -1126,6 +1126,7 @@ sigs.k8s.io/controller-runtime v0.6.2 h1:jkAnfdTYBpFwlmBn3pS5HFO06SfxvnTZ1p5PeEF
1126
1126
sigs.k8s.io/controller-runtime v0.6.2 /go.mod h1:vhcq/rlnENJ09SIRp3EveTaZ0yqH526hjf9iJdbUJ/E =
1127
1127
sigs.k8s.io/kubebuilder v1.0.9-0.20201021204649-36124ae2e027 h1:2ubws/tSma7ZSqzH7fYIsVl7CvA4jA79VE8YWn9AhH8 =
1128
1128
sigs.k8s.io/kubebuilder v1.0.9-0.20201021204649-36124ae2e027 /go.mod h1:NatUhFMh/ci8gR+qETvZBIlZ4RTQoNa+9uei7okpgcY =
1129
+ sigs.k8s.io/kubebuilder v1.0.8 h1:XYctSbuOICM9z1Ok0GIWChc1cj90EEEczeJQnb7ZPf0 =
1129
1130
sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0 =
1130
1131
sigs.k8s.io/kustomize v2.0.3+incompatible /go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU =
1131
1132
sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874 /go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw =
Original file line number Diff line number Diff line change @@ -20,20 +20,33 @@ import (
20
20
"log"
21
21
22
22
"github.com/spf13/cobra"
23
+ "sigs.k8s.io/kubebuilder/pkg/cli"
23
24
24
25
"github.com/joelanford/helm-operator/internal/cmd/run"
25
26
"github.com/joelanford/helm-operator/internal/cmd/version"
27
+ pluginv1 "github.com/joelanford/helm-operator/pkg/plugins/v1"
26
28
)
27
29
28
30
func main () {
29
- root := cobra.Command {
30
- Use : "helm-operator" ,
31
+ commands := []* cobra.Command {
32
+ run .NewCmd (),
33
+ version .NewCmd (),
34
+ }
35
+ c , err := cli .New (
36
+ cli .WithCommandName ("helm-operator" ),
37
+ cli .WithPlugins (
38
+ & pluginv1.Plugin {},
39
+ ),
40
+ cli .WithDefaultPlugins (
41
+ & pluginv1.Plugin {},
42
+ ),
43
+ cli .WithExtraCommands (commands ... ),
44
+ )
45
+ if err != nil {
46
+ log .Fatal (err )
31
47
}
32
48
33
- root .AddCommand (run .NewCmd ())
34
- root .AddCommand (version .NewCmd ())
35
-
36
- if err := root .Execute (); err != nil {
49
+ if err := c .Run (); err != nil {
37
50
log .Fatal (err )
38
51
}
39
52
}
You can’t perform that action at this time.
0 commit comments