mirror of https://github.com/portainer/portainer
fix(docker): delete docker resources [EE-2411] (#6414)
fixes [EE-2411] ignore resource control object not found when deleting a docker resourcepull/6393/head
parent
804fdd414e
commit
3ed92e5fee
|
@ -16,6 +16,7 @@ import (
|
||||||
|
|
||||||
portainer "github.com/portainer/portainer/api"
|
portainer "github.com/portainer/portainer/api"
|
||||||
"github.com/portainer/portainer/api/dataservices"
|
"github.com/portainer/portainer/api/dataservices"
|
||||||
|
dataerrors "github.com/portainer/portainer/api/dataservices/errors"
|
||||||
"github.com/portainer/portainer/api/docker"
|
"github.com/portainer/portainer/api/docker"
|
||||||
"github.com/portainer/portainer/api/http/proxy/factory/utils"
|
"github.com/portainer/portainer/api/http/proxy/factory/utils"
|
||||||
"github.com/portainer/portainer/api/http/security"
|
"github.com/portainer/portainer/api/http/security"
|
||||||
|
@ -601,6 +602,10 @@ func (transport *Transport) executeGenericResourceDeletionOperation(request *htt
|
||||||
if response.StatusCode == http.StatusNoContent || response.StatusCode == http.StatusOK {
|
if response.StatusCode == http.StatusNoContent || response.StatusCode == http.StatusOK {
|
||||||
resourceControl, err := transport.dataStore.ResourceControl().ResourceControlByResourceIDAndType(resourceIdentifierAttribute, resourceType)
|
resourceControl, err := transport.dataStore.ResourceControl().ResourceControlByResourceIDAndType(resourceIdentifierAttribute, resourceType)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if err == dataerrors.ErrObjectNotFound {
|
||||||
|
return response, nil
|
||||||
|
}
|
||||||
|
|
||||||
return response, err
|
return response, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue