don't dealloate reserved services (#41)

This commit is contained in:
Michael Quigley 2022-11-29 16:43:35 -05:00
parent 158cc42c07
commit 6841704b90
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -75,6 +75,7 @@ func (h *unshareHandler) Handle(params service.UnshareParams, principal *rest_mo
return service.NewUnshareInternalServerError()
}
if !ssvc.Reserved {
// single tag-based service deallocator; should work regardless of sharing mode
if err := h.deallocateResources(senv, ssvc, svcName, svcZId, edge); err != nil {
logrus.Errorf("error unsharing ziti resources for '%v': %v", ssvc, err)
@ -92,6 +93,10 @@ func (h *unshareHandler) Handle(params service.UnshareParams, principal *rest_mo
return service.NewUnshareInternalServerError()
}
} else {
logrus.Infof("service '%v' is reserved, skipping deallocation", svcName)
}
return service.NewUnshareOK()
}