Giter Club home page Giter Club logo

harbor-cleaner's People

Contributors

cd1989 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

harbor-cleaner's Issues

Improve the N tag policy to retain exactly N tags

For the moment, if some tags share a same image manifests, they will be bind together, we can't delete some of them and to retain others.

If t1, t2, t3, t4 refer to the same image and we want to delete tags t1, t2. Then we can:

  • Hold manifest of the image
  • Delete t1 (so all 4 tags will be deleted)
  • Push t3, t4 back by pushing the manifest, since blobs already in registry, no need to push blobs.

Harbor:'_xsrf' argument missing from POST

For Harbor 1.9+ versions, you may encounter this problem:

ERRO[0000] login harbor: http://10.73.48.46 error: code 403, body: 
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>beego application error</title>
    <style>
        html, body, body * {padding: 0; margin: 0;}
        #header {background:#ffd; border-bottom:solid 2px #A31515; padding: 20px 10px;}
        #header h2{ }
        #footer {border-top:solid 1px #aaa; padding: 5px 10px; font-size: 12px; color:green;}
        #content {padding: 5px;}
        #content .stack b{ font-size: 13px; color: red;}
        #content .stack pre{padding-left: 10px;}
        table {}
        td.t {text-align: right; padding-right: 5px; color: #888;}
    </style>
    <script type="text/javascript">
    </script>
</head>
<body>
    <div id="header">
        <h2>Harbor:&#39;_xsrf&#39; argument missing from POST</h2>
    </div>
    <div id="content">
        <table>
            <tr>
                <td class="t">Request Method: </td><td>POST</td>
            </tr>
            <tr>
                <td class="t">Request URL: </td><td>/c/login?principal=admin&amp;password=Pwd123456</td>
            </tr>
            <tr>
                <td class="t">RemoteAddr: </td><td>172.22.0.1</td>
            </tr>
        </table>
        <div class="stack">
            <b>Stack</b>
            <pre>/usr/local/go/src/runtime/panic.go:522
/harbor/src/vendor/github.com/astaxie/beego/context/context.go:80
/harbor/src/vendor/github.com/astaxie/beego/context/context.go:164
/harbor/src/vendor/github.com/astaxie/beego/controller.go:649
/harbor/src/vendor/github.com/astaxie/beego/router.go:788
/usr/local/go/src/net/http/server.go:2774
/usr/local/go/src/net/http/server.go:1878
/usr/local/go/src/runtime/asm_amd64.s:1337
</pre>
        </div>
    </div>
    <div id="footer">
        <p>beego 1.9.0 (beego framework)</p>
        <p>golang version: go1.12.12</p>
    </div>
</body>
</html> 

A workaround is to disable XSRF check in Harbor.

  1. Edit ./common/config/core/app.conf to set EnableXSRF to false
  2. Restart harbor-core by docker restart harbor-core
  3. Try harbor-cleaner again
  4. Revert the change of app.conf if you want.

Support for v2.x and above.

Hi, I want to implement the harbor-cleanup policies for the version 2.x and higher. Any chance of an update and support for v2.0?
Screenshot 2024-04-08 at 15 57 23

Clean untagged images

For images that have no tags, even GC can't release the storage.

Untagged images will be generated when push images with same tag to override a old one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.