aboutsummaryrefslogtreecommitdiffstats
path: root/src/rsync
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
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')
-rw-r--r--src/rsync/cmd/main.go6
-rw-r--r--src/rsync/pkg/client/client.go2
-rw-r--r--src/rsync/pkg/grpc/installappserver/installappserver.go3
-rw-r--r--src/rsync/pkg/grpc/register.go40
4 files changed, 5 insertions, 46 deletions
diff --git a/src/rsync/cmd/main.go b/src/rsync/cmd/main.go
index 95c36e20..3e6c4df7 100644
--- a/src/rsync/cmd/main.go
+++ b/src/rsync/cmd/main.go
@@ -15,12 +15,12 @@ package main
import (
"fmt"
- "log"
- "math/rand"
- "net"
register "github.com/onap/multicloud-k8s/src/rsync/pkg/grpc"
installpb "github.com/onap/multicloud-k8s/src/rsync/pkg/grpc/installapp"
"github.com/onap/multicloud-k8s/src/rsync/pkg/grpc/installappserver"
+ "log"
+ "math/rand"
+ "net"
"strings"
"time"
diff --git a/src/rsync/pkg/client/client.go b/src/rsync/pkg/client/client.go
index 0eaded22..a489b951 100644
--- a/src/rsync/pkg/client/client.go
+++ b/src/rsync/pkg/client/client.go
@@ -187,4 +187,4 @@ func (c *Client) IsReachable() error {
return fmt.Errorf("Kubernetes cluster unreachable")
}
return nil
-} \ No newline at end of file
+}
diff --git a/src/rsync/pkg/grpc/installappserver/installappserver.go b/src/rsync/pkg/grpc/installappserver/installappserver.go
index d70000c0..3a24dab8 100644
--- a/src/rsync/pkg/grpc/installappserver/installappserver.go
+++ b/src/rsync/pkg/grpc/installappserver/installappserver.go
@@ -16,10 +16,9 @@ package installappserver
import (
"context"
"encoding/json"
- "log"
-
con "github.com/onap/multicloud-k8s/src/rsync/pkg/context"
"github.com/onap/multicloud-k8s/src/rsync/pkg/grpc/installapp"
+ "log"
)
type installappServer struct {
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
-}