Skip to content

Commit 48cad55

Browse files
committed
Update testdata generation entrypoint
Signed-off-by: chiragkyal <ckyal@redhat.com>
1 parent a296687 commit 48cad55

File tree

2 files changed

+3
-24
lines changed

2 files changed

+3
-24
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 {

testdata/memcached-molecule-operator/PROJECT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# More info: https://book.kubebuilder.io/reference/project-config.html
55
domain: example.com
66
layout:
7-
- go.kubebuilder.io/v1
7+
- base.ansible.sdk.operatorframework.io/v1
88
multigroup: true
99
projectName: memcached-molecule-operator
1010
resources:

0 commit comments

Comments
 (0)