-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: set quay image expiry to prevent overflow of images #157
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #157 +/- ##
==========================================
- Coverage 85.71% 85.21% -0.51%
==========================================
Files 19 19
Lines 994 994
==========================================
- Hits 852 847 -5
- Misses 93 96 +3
- Partials 49 51 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
40ed7cd
to
3ec25c1
Compare
Signed-off-by: KevFan <[email protected]>
3ec25c1
to
64b0dd2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Just one comment around ENV
in dockerfile
Dockerfile
Outdated
@@ -31,4 +31,9 @@ WORKDIR / | |||
COPY --from=builder /workspace/manager . | |||
USER 65532:65532 | |||
|
|||
# Quay image expiry | |||
ARG QUAY_IMAGE_EXPIRY | |||
ENV QUAY_IMAGE_EXPIRY=${QUAY_IMAGE_EXPIRY:-never} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this ENV?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I was following the current examples of how this was done. I assumed it was to use the enviroment default value 🤔
Lines 19 to 25 in 1f721de
# Build | |
ARG GIT_SHA | |
ARG DIRTY | |
ENV GIT_SHA=${GIT_SHA:-unknown} | |
ENV DIRTY=${DIRTY:-unknown} | |
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags "-X main.gitSHA=${GIT_SHA} -X main.dirty=${DIRTY}" -o manager main.go |
But this probably can be simpler by doing the following instead if we want to always take it in from the build argument instead
ENV QUAY_IMAGE_EXPIRY=${QUAY_IMAGE_EXPIRY:-never} | |
ARG QUAY_IMAGE_EXPIRY=never |
Let me give it a try and push an update
bundle.Dockerfile
Outdated
|
||
# Quay image expiry | ||
ARG QUAY_IMAGE_EXPIRY | ||
ENV QUAY_IMAGE_EXPIRY=${QUAY_IMAGE_EXPIRY:-never} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this ENV?
Signed-off-by: KevFan <[email protected]>
Description
Part of: Kuadrant/kuadrant-operator#769
Associated with: Kuadrant/kuadrant-operator#843
Currently, all built Quay images never expire and are consuming unnecessary quota on Quay.io. Quay provides a way to set tag expiration from a Dockerfile to prevent this issue for images that don't need to be kept indefinitely, such as development branches and nightly builds. This can help prevent the problem from escalating over time.
Verification
expire_images
tag has an expiry at the following quay repos which was build by the CI for this branch: