Skip to content

Commit 0002521

Browse files
committed
Update testdata generation entrypoint
Signed-off-by: chiragkyal <[email protected]>
1 parent a296687 commit 0002521

File tree

1 file changed

+2
-23
lines changed

1 file changed

+2
-23
lines changed

hack/generate/samples/ansible/generate.go

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,9 @@ import (
2121
log "github.com/sirupsen/logrus"
2222
"k8s.io/apimachinery/pkg/runtime/schema"
2323
"sigs.k8s.io/kubebuilder/v4/pkg/cli"
24-
cfgv3 "sigs.k8s.io/kubebuilder/v4/pkg/config/v3"
25-
"sigs.k8s.io/kubebuilder/v4/pkg/plugin"
26-
kustomizev2 "sigs.k8s.io/kubebuilder/v4/pkg/plugins/common/kustomize/v2"
27-
"sigs.k8s.io/kubebuilder/v4/pkg/plugins/golang"
2824

2925
"github.com/operator-framework/ansible-operator-plugins/hack/generate/samples/internal/pkg"
30-
"github.com/operator-framework/ansible-operator-plugins/pkg/plugins/ansible/v1"
26+
"github.com/operator-framework/ansible-operator-plugins/internal/cmd/ansible-operator/scaffold"
3127
"github.com/operator-framework/ansible-operator-plugins/pkg/testutils/command"
3228
"github.com/operator-framework/ansible-operator-plugins/pkg/testutils/e2e"
3329
"github.com/operator-framework/ansible-operator-plugins/pkg/testutils/sample"
@@ -43,24 +39,7 @@ var memcachedGVK = schema.GroupVersionKind{
4339
}
4440

4541
func getCli() *cli.CLI {
46-
ansibleBundle, _ := plugin.NewBundleWithOptions(
47-
plugin.WithName(golang.DefaultNameQualifier),
48-
plugin.WithVersion(ansible.Plugin{}.Version()),
49-
plugin.WithPlugins(kustomizev2.Plugin{}, ansible.Plugin{}),
50-
)
51-
52-
c, err := cli.New(
53-
cli.WithCommandName("cli"),
54-
cli.WithVersion("v0.0.0"),
55-
cli.WithPlugins(
56-
ansibleBundle,
57-
),
58-
cli.WithDefaultPlugins(cfgv3.Version, ansibleBundle),
59-
cli.WithDefaultProjectVersion(cfgv3.Version),
60-
cli.WithCompletion(),
61-
)
62-
pkg.CheckError("getting cli implementation:", err)
63-
return c
42+
return scaffold.GetPluginsCLI()
6443
}
6544

6645
func GenerateMemcachedSamples(rootPath string) []sample.Sample {

0 commit comments

Comments
 (0)