Skip to content

Commit e75f479

Browse files
author
anmol372
committed
added scaffolding to project
1 parent b294533 commit e75f479

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,7 @@ sigs.k8s.io/controller-runtime v0.6.2 h1:jkAnfdTYBpFwlmBn3pS5HFO06SfxvnTZ1p5PeEF
11261126
sigs.k8s.io/controller-runtime v0.6.2/go.mod h1:vhcq/rlnENJ09SIRp3EveTaZ0yqH526hjf9iJdbUJ/E=
11271127
sigs.k8s.io/kubebuilder v1.0.9-0.20201021204649-36124ae2e027 h1:2ubws/tSma7ZSqzH7fYIsVl7CvA4jA79VE8YWn9AhH8=
11281128
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=
11291130
sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0=
11301131
sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU=
11311132
sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=

main.go

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,33 @@ import (
2020
"log"
2121

2222
"github.com/spf13/cobra"
23+
"sigs.k8s.io/kubebuilder/pkg/cli"
2324

2425
"github.com/joelanford/helm-operator/internal/cmd/run"
2526
"github.com/joelanford/helm-operator/internal/cmd/version"
27+
pluginv1 "github.com/joelanford/helm-operator/pkg/plugins/v1"
2628
)
2729

2830
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)
3147
}
3248

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 {
3750
log.Fatal(err)
3851
}
3952
}

0 commit comments

Comments
 (0)