fix(docker): delete docker resources [EE-2411] (#6414)

fixes [EE-2411]

ignore resource control object not found when deleting a docker resource
pull/6393/head
Chaim Lev-Ari 2022-01-23 09:17:31 +02:00 committed by GitHub
parent 804fdd414e
commit 3ed92e5fee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -16,6 +16,7 @@ import (
portainer "github.com/portainer/portainer/api"
"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/http/proxy/factory/utils"
"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 {
resourceControl, err := transport.dataStore.ResourceControl().ResourceControlByResourceIDAndType(resourceIdentifierAttribute, resourceType)
if err != nil {
if err == dataerrors.ErrObjectNotFound {
return response, nil
}
return response, err
}