plugin-barman-cloud/internal/cnpgi/operator/start.go
Leonardo Cecchi dd6548c4a2
feat: operator plugin and manifests (#18)
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
2024-10-01 15:40:48 +02:00

22 lines
667 B
Go

package operator
import (
"github.com/cloudnative-pg/cnpg-i-machinery/pkg/pluginhelper/http"
"github.com/cloudnative-pg/cnpg-i/pkg/lifecycle"
"github.com/cloudnative-pg/cnpg-i/pkg/reconciler"
"github.com/spf13/cobra"
"google.golang.org/grpc"
)
// NewCommand creates the command to start the GRPC server
// of the operator plugin
func NewCommand() *cobra.Command {
cmd := http.CreateMainCmd(IdentityImplementation{}, func(server *grpc.Server) error {
reconciler.RegisterReconcilerHooksServer(server, ReconcilerImplementation{})
lifecycle.RegisterOperatorLifecycleServer(server, LifecycleImplementation{})
return nil
})
cmd.Use = "plugin"
return cmd
}