Skip to content
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

Add artifactory storage backend #1671

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

bored-engineer
Copy link

What is the problem I am trying to address?

Add the option to use Artifactory as a storage backend for athens.
The implementation it is very similar to the existing external provider with a few tweaks specific to the Artifactory REST API and specific configuration options added for usability.
Note: This client uses artifactory as a generic object storage backend, it may or may not be compatible with the folder structure created by official Artifactory Go Registry plugin.

How is the fix applied?

Implements a new storage.Backend which uses the Artifactory REST API to read/write objects.
The upload action is accomplished by writing a zip file (generated on the fly) and using the X-Explode-Archive: true and X-Explode-Archive-Atomic: true so the objects are extracted atomically into a folder by artifactory.
Lister functionality is accomplished by the FolderInfo API call.

What GitHub issue(s) does this PR fix or close?

Fixes #1130 (which was already closed/abandoned but is the closest match)

@bored-engineer bored-engineer requested a review from a team as a code owner October 18, 2020 19:39
@bored-engineer
Copy link
Author

redis: 2020/10/18 19:45:13 sentinel.go:393: sentinel: GetMasterAddrByName master="redis-1" failed: dial tcp: lookup redis-sentinel on 127.0.0.11:53: no such host
--
429 | with_redis_sentinel_test.go:31: redis: all sentinels are unreachable

Seems like the test failure is unrelated to the PR

@arschles
Copy link
Member

@bored-engineer yea, I think that's a flake. I restarted it. One question though - would it not be better to just use Artifactory as an upstream? iirc you can use it as a Go module server as well

@bored-engineer
Copy link
Author

One question though - would it not be better to just use Artifactory as an upstream? iirc you can use it as a Go module server as well

Yes, that would absolutely make sense if that's an available in your environment. JFrog offers a Go Registry that should be the first option to use.

In our environment that was not an option but using Artifactory as a storage backend was a business requirement (due to in-built compliance/security controls).

@arschles
Copy link
Member

arschles commented Nov 6, 2020

@bored-engineer makes sense. Ok I will review this right now.

Copy link
Member

@arschles arschles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bored-engineer this looks very well done, thanks for submitting it. The only thing left would be to write some tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement storage.Backend for Artifactory storage
3 participants