mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-02-23 00:10:06 -05: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.
|
// UploadCoordinator receives a coordinator binary in a stream of chunks and writes to a file.
|
||||||
func (s *debugdServer) UploadCoordinator(stream pb.Debugd_UploadCoordinatorServer) error {
|
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.
|
startAction := deploy.ServiceManagerRequest{
|
||||||
_ = s.serviceManager.SystemdAction(stream.Context(), deploy.ServiceManagerRequest{
|
|
||||||
Unit: debugd.CoordinatorSystemdUnitName,
|
Unit: debugd.CoordinatorSystemdUnitName,
|
||||||
Action: deploy.Stop,
|
Action: deploy.Start,
|
||||||
})
|
|
||||||
restartAction := deploy.ServiceManagerRequest{
|
|
||||||
Unit: debugd.CoordinatorSystemdUnitName,
|
|
||||||
Action: deploy.Restart,
|
|
||||||
}
|
}
|
||||||
var responseStatus pb.UploadCoordinatorStatus
|
var responseStatus pb.UploadCoordinatorStatus
|
||||||
defer func() {
|
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)
|
log.Printf("Starting uploaded coordinator failed: %v\n", err)
|
||||||
if responseStatus == pb.UploadCoordinatorStatus_UPLOAD_COORDINATOR_SUCCESS {
|
if responseStatus == pb.UploadCoordinatorStatus_UPLOAD_COORDINATOR_SUCCESS {
|
||||||
responseStatus = pb.UploadCoordinatorStatus_UPLOAD_COORDINATOR_START_FAILED
|
responseStatus = pb.UploadCoordinatorStatus_UPLOAD_COORDINATOR_START_FAILED
|
||||||
|
Loading…
x
Reference in New Issue
Block a user