mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
debugd: do not stop coordinator before upload as upload only works if coordinator binary does not exist yet
This commit is contained in:
parent
6f32811029
commit
63d282f1ed
@ -51,18 +51,13 @@ func (s *debugdServer) UploadAuthorizedKeys(ctx context.Context, in *pb.UploadAu
|
||||
|
||||
// UploadCoordinator receives a coordinator binary in a stream of chunks and writes to a file.
|
||||
func (s *debugdServer) UploadCoordinator(stream pb.Debugd_UploadCoordinatorServer) error {
|
||||
// try to stop the coordinator before upload but ignore failure since there might be no coordinator running yet.
|
||||
_ = s.serviceManager.SystemdAction(stream.Context(), deploy.ServiceManagerRequest{
|
||||
startAction := deploy.ServiceManagerRequest{
|
||||
Unit: debugd.CoordinatorSystemdUnitName,
|
||||
Action: deploy.Stop,
|
||||
})
|
||||
restartAction := deploy.ServiceManagerRequest{
|
||||
Unit: debugd.CoordinatorSystemdUnitName,
|
||||
Action: deploy.Restart,
|
||||
Action: deploy.Start,
|
||||
}
|
||||
var responseStatus pb.UploadCoordinatorStatus
|
||||
defer func() {
|
||||
if err := s.serviceManager.SystemdAction(stream.Context(), restartAction); err != nil {
|
||||
if err := s.serviceManager.SystemdAction(stream.Context(), startAction); err != nil {
|
||||
log.Printf("Starting uploaded coordinator failed: %v\n", err)
|
||||
if responseStatus == pb.UploadCoordinatorStatus_UPLOAD_COORDINATOR_SUCCESS {
|
||||
responseStatus = pb.UploadCoordinatorStatus_UPLOAD_COORDINATOR_START_FAILED
|
||||
|
Loading…
Reference in New Issue
Block a user