Skip to content

Commit 1e01436

Browse files
authored
deps: bump kubebuilder to v3.0.0-beta.1 (#4581)
Signed-off-by: Adrián Orive <[email protected]>
1 parent 8a6cc68 commit 1e01436

File tree

158 files changed

+1612
-2369
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+1612
-2369
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ require (
3535
rsc.io/letsencrypt v0.0.3 // indirect
3636
sigs.k8s.io/controller-runtime v0.8.2
3737
sigs.k8s.io/controller-tools v0.5.0
38-
sigs.k8s.io/kubebuilder/v3 v3.0.0-alpha.0.0.20210318180717-646f742d9407
38+
sigs.k8s.io/kubebuilder/v3 v3.0.0-beta.1
3939
sigs.k8s.io/yaml v1.2.0
4040
)
4141

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -1555,8 +1555,8 @@ sigs.k8s.io/controller-tools v0.4.1 h1:VkuV0MxlRPmRu5iTgBZU4UxUX2LiR99n3sdQGRxZF
15551555
sigs.k8s.io/controller-tools v0.4.1/go.mod h1:G9rHdZMVlBDocIxGkK3jHLWqcTMNvveypYJwrvYKjWU=
15561556
sigs.k8s.io/controller-tools v0.5.0 h1:3u2RCwOlp0cjCALAigpOcbAf50pE+kHSdueUosrC/AE=
15571557
sigs.k8s.io/controller-tools v0.5.0/go.mod h1:JTsstrMpxs+9BUj6eGuAaEb6SDSPTeVtUyp0jmnAM/I=
1558-
sigs.k8s.io/kubebuilder/v3 v3.0.0-alpha.0.0.20210318180717-646f742d9407 h1:t0QuAKNpt3NEcQFoKtAjGlcvOYWA7OY34ozN81xrKlY=
1559-
sigs.k8s.io/kubebuilder/v3 v3.0.0-alpha.0.0.20210318180717-646f742d9407/go.mod h1:eVtLdWzmvL1ixDYLlVrvQe8wjpikJVoSOg5PghTk2Lw=
1558+
sigs.k8s.io/kubebuilder/v3 v3.0.0-beta.1 h1:WGYvUPZ5tVrAOgvGW/NEqOXV2uYtplB6hJ/SFndrvIc=
1559+
sigs.k8s.io/kubebuilder/v3 v3.0.0-beta.1/go.mod h1:eVtLdWzmvL1ixDYLlVrvQe8wjpikJVoSOg5PghTk2Lw=
15601560
sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0=
15611561
sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU=
15621562
sigs.k8s.io/kustomize/kyaml v0.10.10 h1:caAxDDkaXZp+0kDsZVik4leFJV8LCy09PdVqpaoNeF4=

hack/generate/samples/internal/go/v2/memcached_with_webhooks.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,10 @@ func (mh *MemcachedGoWithWebhooks) Prepare() {
5959
func (mh *MemcachedGoWithWebhooks) Run() {
6060
log.Infof("creating the project")
6161
err := mh.ctx.Init(
62-
"--project-version", "3",
6362
"--plugins", "go/v2",
63+
"--project-version", "3",
6464
"--repo", "github.com/example/memcached-operator",
65-
"--domain",
66-
mh.ctx.Domain)
65+
"--domain", mh.ctx.Domain)
6766
pkg.CheckError("creating the project", err)
6867

6968
err = mh.ctx.CreateAPI(

hack/generate/samples/internal/go/v3/memcached_with_webhooks.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,10 @@ func (mh *MemcachedGoWithWebhooks) Prepare() {
5959
func (mh *MemcachedGoWithWebhooks) Run() {
6060
log.Infof("creating the project")
6161
err := mh.ctx.Init(
62-
"--project-version", "3",
6362
"--plugins", "go/v3",
63+
"--project-version", "3",
6464
"--repo", "github.com/example/memcached-operator",
65-
"--domain",
66-
mh.ctx.Domain)
65+
"--domain", mh.ctx.Domain)
6766
pkg.CheckError("creating the project", err)
6867

6968
err = mh.ctx.CreateAPI(

internal/cmd/operator-sdk/cli/cli.go

+35-9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import (
2121
"sigs.k8s.io/kubebuilder/v3/pkg/cli"
2222
cfgv2 "sigs.k8s.io/kubebuilder/v3/pkg/config/v2"
2323
cfgv3 "sigs.k8s.io/kubebuilder/v3/pkg/config/v3"
24+
"sigs.k8s.io/kubebuilder/v3/pkg/plugin"
25+
golangv2 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v2"
26+
golangv3 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3"
2427

2528
"github.com/operator-framework/operator-sdk/internal/cmd/operator-sdk/alpha/config3alphato3"
2629
"github.com/operator-framework/operator-sdk/internal/cmd/operator-sdk/bundle"
@@ -30,10 +33,12 @@ import (
3033
"github.com/operator-framework/operator-sdk/internal/cmd/operator-sdk/run"
3134
"github.com/operator-framework/operator-sdk/internal/cmd/operator-sdk/scorecard"
3235
"github.com/operator-framework/operator-sdk/internal/flags"
36+
"github.com/operator-framework/operator-sdk/internal/plugins"
3337
ansiblev1 "github.com/operator-framework/operator-sdk/internal/plugins/ansible/v1"
34-
golangv2 "github.com/operator-framework/operator-sdk/internal/plugins/golang/v2"
35-
golangv3 "github.com/operator-framework/operator-sdk/internal/plugins/golang/v3"
38+
envtestv1 "github.com/operator-framework/operator-sdk/internal/plugins/envtest/v1"
3639
helmv1 "github.com/operator-framework/operator-sdk/internal/plugins/helm/v1"
40+
manifestsv2 "github.com/operator-framework/operator-sdk/internal/plugins/manifests/v2"
41+
scorecardv2 "github.com/operator-framework/operator-sdk/internal/plugins/scorecard/v2"
3742
"github.com/operator-framework/operator-sdk/internal/util/projutil"
3843
)
3944

@@ -60,18 +65,39 @@ func Run() error {
6065
// This CLI can run kubebuilder commands and certain SDK specific commands that are aligned for
6166
// the kubebuilder project layout
6267
func GetPluginsCLIAndRoot() (*cli.CLI, *cobra.Command) {
68+
ansibleBundle, _ := plugin.NewBundle("ansible"+plugins.DefaultNameQualifier, plugin.Version{Number: 1},
69+
ansiblev1.Plugin{},
70+
manifestsv2.Plugin{},
71+
scorecardv2.Plugin{},
72+
)
73+
gov2Bundle, _ := plugin.NewBundle(golangv2.Plugin{}.Name(), golangv2.Plugin{}.Version(),
74+
golangv2.Plugin{},
75+
envtestv1.Plugin{},
76+
manifestsv2.Plugin{},
77+
scorecardv2.Plugin{},
78+
)
79+
gov3Bundle, _ := plugin.NewBundle(golangv3.Plugin{}.Name(), golangv3.Plugin{}.Version(),
80+
golangv3.Plugin{},
81+
manifestsv2.Plugin{},
82+
scorecardv2.Plugin{},
83+
)
84+
helmBundle, _ := plugin.NewBundle("helm"+plugins.DefaultNameQualifier, plugin.Version{Number: 1},
85+
helmv1.Plugin{},
86+
manifestsv2.Plugin{},
87+
scorecardv2.Plugin{},
88+
)
6389
c, err := cli.New(
6490
cli.WithCommandName("operator-sdk"),
6591
cli.WithVersion(makeVersionString()),
66-
cli.WithDefaultProjectVersion(cfgv3.Version),
6792
cli.WithPlugins(
68-
&golangv2.Plugin{},
69-
&golangv3.Plugin{},
70-
&helmv1.Plugin{},
71-
&ansiblev1.Plugin{},
93+
ansibleBundle,
94+
gov2Bundle,
95+
gov3Bundle,
96+
helmBundle,
7297
),
73-
cli.WithDefaultPlugins(cfgv2.Version, &golangv2.Plugin{}),
74-
cli.WithDefaultPlugins(cfgv3.Version, &golangv3.Plugin{}),
98+
cli.WithDefaultPlugins(cfgv2.Version, gov2Bundle),
99+
cli.WithDefaultPlugins(cfgv3.Version, gov3Bundle),
100+
cli.WithDefaultProjectVersion(cfgv3.Version),
75101
cli.WithExtraCommands(commands...),
76102
cli.WithExtraAlphaCommands(alphaCommands...),
77103
cli.WithCompletion(),

internal/cmd/operator-sdk/generate/kustomize/manifests.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,11 @@ import (
3030
"sigs.k8s.io/kubebuilder/v3/pkg/config"
3131
cfgv2 "sigs.k8s.io/kubebuilder/v3/pkg/config/v2"
3232
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
33-
"sigs.k8s.io/kubebuilder/v3/pkg/model/file"
3433
"sigs.k8s.io/yaml"
3534

3635
genutil "github.com/operator-framework/operator-sdk/internal/cmd/operator-sdk/generate/internal"
3736
"github.com/operator-framework/operator-sdk/internal/generate/clusterserviceversion/bases"
38-
manifestsv2 "github.com/operator-framework/operator-sdk/internal/plugins/manifests/v2"
37+
"github.com/operator-framework/operator-sdk/internal/plugins/manifests/v2/templates/config/manifests"
3938
"github.com/operator-framework/operator-sdk/internal/util/k8sutil"
4039
"github.com/operator-framework/operator-sdk/internal/util/projutil"
4140
)
@@ -183,7 +182,7 @@ func (c manifestsCmd) run(cfg config.Config) error {
183182
}
184183
}
185184

186-
operatorType := projutil.PluginKeyToOperatorType(cfg.GetPluginChain())
185+
operatorType := projutil.PluginChainToOperatorType(cfg.GetPluginChain())
187186
relBasePath := filepath.Join("bases", c.packageName+".clusterserviceversion.yaml")
188187
basePath := filepath.Join(c.inputDir, relBasePath)
189188
gvks, err := getGVKs(cfg)
@@ -220,8 +219,7 @@ func (c manifestsCmd) run(cfg config.Config) error {
220219
}
221220

222221
// Write a kustomization.yaml to outputDir if one does not exist.
223-
kustomization := manifestsv2.Kustomization{SupportsWebhooks: operatorType == projutil.OperatorTypeGo}
224-
kustomization.IfExistsAction = file.Skip
222+
kustomization := manifests.Kustomization{SupportsWebhooks: operatorType == projutil.OperatorTypeGo}
225223
err = machinery.NewScaffold(machinery.Filesystem{FS: afero.NewOsFs()}, machinery.WithConfig(cfg)).Execute(
226224
&kustomization,
227225
)

internal/kubebuilder/cmdutil/cmdutil.go

-68
This file was deleted.

0 commit comments

Comments
 (0)