diff --git a/components/infra-proxy-service/server/migrations.go b/components/infra-proxy-service/server/migrations.go index 60786c9690e..89782829581 100644 --- a/components/infra-proxy-service/server/migrations.go +++ b/components/infra-proxy-service/server/migrations.go @@ -1,9 +1,12 @@ package server -/*import ( +import ( "bytes" + "github.com/chef/automate/api/interservice/infra_proxy/migrations/response" + "github.com/chef/automate/api/interservice/infra_proxy/migrations/service" uuid "github.com/chef/automate/lib/uuid4" log "github.com/sirupsen/logrus" + "io" "os" "path" ) @@ -28,9 +31,9 @@ func saveFile(migrationId string, filename string, fileData bytes.Buffer) error return nil } -*/ + // UploadFile Takes the stream of data to upload a file -/*func (s *Server) UploadFile(stream service.MigrationDataService_UploadFileServer) error { +func (s *Server) UploadFile(stream service.MigrationDataService_UploadFileServer) error { in, err := stream.Recv() if err != io.EOF && err != nil { return err @@ -61,9 +64,9 @@ func saveFile(migrationId string, filename string, fileData bytes.Buffer) error return err } - res := &response.UploadFileResponse{ + res := &response.UploadZipFileResponse{ MigrationId: migrationId, - Status: "Completed", + Success: true, } err = stream.SendAndClose(res) @@ -72,13 +75,13 @@ func saveFile(migrationId string, filename string, fileData bytes.Buffer) error } return nil -}*/ +} -/*func createMigrationId() (string, error) { +func createMigrationId() (string, error) { uuid, err := uuid.NewV4() if err != nil { log.WithError(err).Error("Failed to make a V4 UUID") return "", err } return uuid.String(), nil -}*/ +} diff --git a/components/infra-proxy-service/server/migrations/migrations.go b/components/infra-proxy-service/server/migrations/migrations.go index 55ce2da1b08..24fa3b1cffd 100644 --- a/components/infra-proxy-service/server/migrations/migrations.go +++ b/components/infra-proxy-service/server/migrations/migrations.go @@ -1,6 +1,6 @@ package migrations -import ( +/*import ( "bytes" uuid "github.com/chef/automate/lib/uuid4" log "github.com/sirupsen/logrus" @@ -92,3 +92,4 @@ func createMigrationId() (string, error) { } return uuid.String(), nil } +*/