Skip to content

Commit

Permalink
The go.operator-sdk.io plugin is now in its own package.
Browse files Browse the repository at this point in the history
cmd/operator-sdk/cli: update import path for Go plugin

go.mod,go.sum: bump kubebuilder version
  • Loading branch information
estroz committed Jun 18, 2020
1 parent ca0e78d commit 2d84134
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 10 deletions.
8 changes: 5 additions & 3 deletions cmd/operator-sdk/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/operator-framework/operator-sdk/cmd/operator-sdk/olm"
"github.com/operator-framework/operator-sdk/cmd/operator-sdk/version"
"github.com/operator-framework/operator-sdk/internal/flags"
"github.com/operator-framework/operator-sdk/internal/plugins/golang"
golangv2 "github.com/operator-framework/operator-sdk/internal/plugins/golang/v2"
"github.com/operator-framework/operator-sdk/internal/util/projutil"

log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -63,9 +63,11 @@ func GetPluginsCLIAndRoot() (cli.CLI, *cobra.Command) {
c, err := cli.New(
cli.WithCommandName("operator-sdk"),
cli.WithPlugins(
&golang.Plugin{},
&golangv2.Plugin{},
),
cli.WithDefaultPlugins(
&golangv2.Plugin{},
),
cli.WithDefaultPlugins(&golang.Plugin{}),
cli.WithExtraCommands(commands...),
)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ require (
rsc.io/letsencrypt v0.0.3 // indirect
sigs.k8s.io/controller-runtime v0.6.0
sigs.k8s.io/controller-tools v0.3.0
sigs.k8s.io/kubebuilder v1.0.9-0.20200604172714-cd5eed9f42b7
sigs.k8s.io/kubebuilder v1.0.9-0.20200604222544-6e0d3d4f18ec
sigs.k8s.io/yaml v1.2.0
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1381,8 +1381,8 @@ sigs.k8s.io/controller-runtime v0.6.0/go.mod h1:CpYf5pdNY/B352A1TFLAS2JVSlnGQ5O2
sigs.k8s.io/controller-tools v0.2.4/go.mod h1:m/ztfQNocGYBgTTCmFdnK94uVvgxeZeE3LtJvd/jIzA=
sigs.k8s.io/controller-tools v0.3.0 h1:y3YD99XOyWaXkiF1kd41uRvfp/64teWcrEZFuHxPhJ4=
sigs.k8s.io/controller-tools v0.3.0/go.mod h1:enhtKGfxZD1GFEoMgP8Fdbu+uKQ/cq1/WGJhdVChfvI=
sigs.k8s.io/kubebuilder v1.0.9-0.20200604172714-cd5eed9f42b7 h1:1loZ7UPyGCEgDjuZgpb88h/omKDTb2/5uNe+KrqFC4U=
sigs.k8s.io/kubebuilder v1.0.9-0.20200604172714-cd5eed9f42b7/go.mod h1:FGPx0hvP73+bapzWoy5ePuhAJYgJjrFbPxgvWyortM0=
sigs.k8s.io/kubebuilder v1.0.9-0.20200604222544-6e0d3d4f18ec h1:KrjgXmv5pcpgjN8dCz0u2xDWxUll4aLNzEcl0UPzluo=
sigs.k8s.io/kubebuilder v1.0.9-0.20200604222544-6e0d3d4f18ec/go.mod h1:FGPx0hvP73+bapzWoy5ePuhAJYgJjrFbPxgvWyortM0=
sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0=
sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU=
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package golang
package v2

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package golang
package v2

import "sigs.k8s.io/kubebuilder/pkg/model/config"

// Config configures this plugin, and is saved in the project config file.
type Config struct{}

// hasPluginConfig returns true if cfg.Plugins contains an exact match for this plugin's key.
func hasPluginConfig(cfg *config.Config) bool {
if len(cfg.Plugins) == 0 {
return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package golang
package v2

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package golang
package v2

import (
"github.com/operator-framework/operator-sdk/internal/plugins"
Expand Down Expand Up @@ -41,6 +41,8 @@ var (
_ plugin.CreateWebhookPluginGetter = Plugin{}
)

// Plugin defines an Operator SDK Go scaffold and CLI plugin. Its current purpose is to
// add operator-framework features to the base kubebuilder Go scaffold and CLI.
type Plugin struct{}

func (Plugin) Name() string { return (kbgov2.Plugin{}).Name() }
Expand Down

0 comments on commit 2d84134

Please sign in to comment.