-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: jfrog plugin + helm upload handler (#1167)
<!-- markdownlint-disable MD041 --> #### What this PR does / why we need it Implements a JFrog Plugin that contains an uploader that is able to upload to JFrog Helm Chart Repositories (different from OCI). Example Reference Upload configuration: ```yaml - type: credentials.config.ocm.software consumers: - identity: type: JFrogHelm hostname: int.repositories.cloud.sap credentials: - type: Credentials/v1 properties: username: "your-user-here" password: "your-token-here" - type: uploader.ocm.config.ocm.software registrations: - name: plugin/jfrog/JFrogHelm artifactType: helmChart priority: 200 config: type: JFrogHelm/v1alpha1 url: "your-artifactory-url-here" repository: "your-repository-here" # reindexAfterUpload: true # in case you want to force a reindex, requires admin repository credentials, off by default ``` The plugin will be installable with `ocm install plugin ghcr.io/open-component-model/ocm//ocm.software/plugins/jfrogplugin` as it is added to our parallel build list. Since during development (while this PR does not get merged and we dont have an RC) you cannot use this command, you can choose to either push your own version of the plugin (there are commands in the new makefile), or you can run (also in the new makefile): ``` make -C components/jfrogplugin install ``` which will do a build and install locally so you can use it without fetching it remotely Once added, you can run something like ``` ocm plugin get jfrog -oyaml --- element: description: "ALPHA GRADE plugin providing custom functions related to interacting with JFrog Repositories (e.g. Artifactory).\n\nThis plugin is solely for interacting with JFrog Servers and cannot be used for generic repository types.\nThus, you should only consider this plugin if\n- You need to use a JFrog specific API\n- You cannot use any of the generic (non-jfrog) implementations.\n\nExamples:\n\nYou can configure the JFrog plugin as an Uploader in an ocm config file with:\n\n- type: uploader.ocm..config.ocm.software\n registrations:\n - name: plugin/jfrog/JFrogHelm\n \ artifactType: helmChart\n priority: 200 # must be > 100 to be used over the default handler\n config:\n type: JFrogHelm/v1alpha1\n # this is only a sample JFrog Server URL, do NOT append /artifactory\n url: int.repositories.ocm.software \n repository: ocm-helm-test\n" forwardLogging: true pluginName: jfrog pluginVersion: 0.20.0-dev+962ef1469035fbd7b855dff1ccb6ddfc06269745 shortDescription: jfrog plugin uploaders: - constraints: - artifactType: helmChart contextType: "" mediaType: "" repositoryType: "" description: upload artifacts to JFrog HELM repositories by using the JFrog REST API. name: JFrogHelm version: v1 ``` to introspect it. The plugin is now able to be used by OCM. The plugin registers itself for the mediaTypes of a Helm Chart TGZ as well as OCI artifacts to convert them. Notably, the OCI artifact conversion is lossy because the provenance data is omitted, so back and forth conversion while maintaining digests might not always be possible in a fully trusted environment #### Which issue(s) this PR fixes <!-- Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. --> fix #1116 --------- Co-authored-by: Gergely Brautigam <182850+skarlso@users.noreply.github.com>
- Loading branch information
1 parent
a93ecca
commit ada5381
Showing
26 changed files
with
1,401 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ const ( | |
OptArt = "artifactType" | ||
OptConfig = "config" | ||
OptCliConfig = "cli-config" | ||
OptDigest = "digest" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.