summaryrefslogtreecommitdiffstats
path: root/src/rsync/pkg/grpc/register.go
diff options
context:
space:
mode:
authorRajamohan Raj <rajamohan.raj@intel.com>2020-08-19 00:32:30 +0000
committerRajamohan Raj <rajamohan.raj@intel.com>2020-08-27 22:14:23 +0000
commit49c839f48994a394ed5004e4e4446b46833c7014 (patch)
treeb0e09cbcfb3f232ad6c037ecc4a05d76605ca8ca /src/rsync/pkg/grpc/register.go
parent9c942a11c14836630ba528b75bdcb2790045b91f (diff)
Remove the need for rysnc registration in orchestrator
Removed dependency of rsync registration from orchestrator.RSYNC shall have a function NewRsyncInfo to initiate a new rsync independent of the orchestrator and make gRPC calls. Issue-ID: MULTICLOUD-1196 Signed-off-by: Rajamohan Raj <rajamohan.raj@intel.com> Change-Id: I16bbac6a6865cf3c4ee7b763dac72abe2ed1ad0a
Diffstat (limited to 'src/rsync/pkg/grpc/register.go')
-rw-r--r--src/rsync/pkg/grpc/register.go40
1 files changed, 0 insertions, 40 deletions
diff --git a/src/rsync/pkg/grpc/register.go b/src/rsync/pkg/grpc/register.go
index fb462505..60bd50d6 100644
--- a/src/rsync/pkg/grpc/register.go
+++ b/src/rsync/pkg/grpc/register.go
@@ -19,8 +19,6 @@ import (
"strings"
log "github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/logutils"
- controller "github.com/onap/multicloud-k8s/src/orchestrator/pkg/module/controller"
- mtypes "github.com/onap/multicloud-k8s/src/orchestrator/pkg/module/types"
)
const default_host = "localhost"
@@ -58,41 +56,3 @@ func GetServerHostPort() (string, int) {
}
return host, port
}
-
-func RegisterGrpcServer(host string, port int) error {
- // expect name of this rsync program to be in env variable "RSYNC_NAME" - e.g. RSYNC_NAME="rsync"
- // This will be the name of the controller that is registered in the orchestrator controller API
- // This same name will be used as the key name for intents in the deployment intent group
- serviceName := os.Getenv(ENV_RSYNC_NAME)
- if serviceName == "" {
- serviceName = default_rsync_name
- log.Info("Using default name for rsync service name", log.Fields{
- "Name": serviceName,
- })
- }
-
- client := controller.NewControllerClient()
-
- // Create or update the controller entry
- controller := controller.Controller{
- Metadata: mtypes.Metadata{
- Name: serviceName,
- },
- Spec: controller.ControllerSpec{
- Host: host,
- Port: port,
- Type: controller.CONTROLLER_TYPE_ACTION,
- Priority: controller.MinControllerPriority,
- },
- }
- _, err := client.CreateController(controller, true)
- if err != nil {
- log.Error("Failed to create/update a gRPC controller", log.Fields{
- "Error": err,
- "Controller": serviceName,
- })
- return err
- }
-
- return nil
-}