Skip to content

Commit

Permalink
⚠️ move declarative plugin to golang domain
Browse files Browse the repository at this point in the history
  • Loading branch information
Camila Macedo committed Mar 26, 2021
1 parent b828d86 commit 9d1fd06
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 13 deletions.
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"sigs.k8s.io/kubebuilder/v3/pkg/cli"
cfgv2 "sigs.k8s.io/kubebuilder/v3/pkg/config/v2"
cfgv3 "sigs.k8s.io/kubebuilder/v3/pkg/config/v3"
declarativev1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/declarative/v1"
declarativev1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/declarative/v1"
pluginv2 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v2"
pluginv3 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugins/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ limitations under the License.
package plugins

// DefaultNameQualifier is the suffix appended to all kubebuilder plugin names.
const DefaultNameQualifier = ".kubebuilder.io"
const DefaultNameQualifier = "kubebuilder.io"
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"sigs.k8s.io/kubebuilder/v3/pkg/model/resource"
"sigs.k8s.io/kubebuilder/v3/pkg/plugin"
"sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
"sigs.k8s.io/kubebuilder/v3/pkg/plugins/declarative/v1/internal/templates"
"sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/declarative/v1/internal/templates"
goPluginV3 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
cfgv3 "sigs.k8s.io/kubebuilder/v3/pkg/config/v3"
"sigs.k8s.io/kubebuilder/v3/pkg/model/resource"
"sigs.k8s.io/kubebuilder/v3/pkg/plugin"
"sigs.k8s.io/kubebuilder/v3/pkg/plugins"
"sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang"
)

const pluginName = "declarative" + plugins.DefaultNameQualifier
const pluginName = "declarative." + golang.DefaultGoNameQualifier

var (
pluginVersion = plugin.Version{Number: 1}
Expand Down
19 changes: 19 additions & 0 deletions pkg/plugins/golang/domain.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
Copyright 2020 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package golang

import "sigs.k8s.io/kubebuilder/v3/pkg/plugins"

// DefaultGoNameQualifier is the suffix appended to all kubebuilder plugin names for Golang operators.
const DefaultGoNameQualifier = "go." + plugins.DefaultNameQualifier
2 changes: 1 addition & 1 deletion pkg/plugins/golang/v2/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"sigs.k8s.io/kubebuilder/v3/pkg/plugins"
)

const pluginName = "go" + plugins.DefaultNameQualifier
const pluginName = "go." + plugins.DefaultNameQualifier

var (
pluginVersion = plugin.Version{Number: 2}
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugins/golang/v3/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"sigs.k8s.io/kubebuilder/v3/pkg/plugins"
)

const pluginName = "go" + plugins.DefaultNameQualifier
const pluginName = "go." + plugins.DefaultNameQualifier

var (
pluginVersion = plugin.Version{Number: 3}
Expand Down
4 changes: 2 additions & 2 deletions testdata/project-v2-addon/PROJECT
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
domain: testproject.org
layout:
- go.kubebuilder.io/v2
- declarative.kubebuilder.io/v1
- declarative.go.kubebuilder.io/v1
plugins:
declarative.kubebuilder.io/v1:
declarative.go.kubebuilder.io/v1:
resources:
- domain: testproject.org
group: crew
Expand Down
4 changes: 2 additions & 2 deletions testdata/project-v3-addon/PROJECT
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
domain: testproject.org
layout:
- go.kubebuilder.io/v3
- declarative.kubebuilder.io/v1
- declarative.go.kubebuilder.io/v1
plugins:
declarative.kubebuilder.io/v1:
declarative.go.kubebuilder.io/v1:
resources:
- domain: testproject.org
group: crew
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v3-config/PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ domain: testproject.org
layout:
- go.kubebuilder.io/v3
plugins:
declarative.kubebuilder.io/v1:
declarative.go.kubebuilder.io/v1:
resources:
- domain: testproject.org
group: crew
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v3/PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ domain: testproject.org
layout:
- go.kubebuilder.io/v3
plugins:
declarative.kubebuilder.io/v1:
declarative.go.kubebuilder.io/v1:
resources:
- domain: testproject.org
group: crew
Expand Down

0 comments on commit 9d1fd06

Please sign in to comment.