示例#1
0
        public bool CanDelete(DockerImageNode imageNode)
        {
            // We DO NOT delete image if it is in the whitelist
            if (this._imageWhitelist.MatchAny(imageNode.InspectResponse.RepoTags))
            {
                return(false);
            }

            // We DO NOT delete image if there is a non blacklist state container exists using that image
            if (imageNode.GetContainerCount() - imageNode.GetContainerCount(_stateBlacklist) > 0)
            {
                return(false);
            }

            return(true);
        }