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

Extend OCM Plugins to support generic actions + define oci.repository.prepare action to assure existence of OCI repositories #320

Merged
merged 8 commits into from
Apr 4, 2023

Conversation

mandelsoft
Copy link
Contributor

@mandelsoft mandelsoft commented Apr 3, 2023

What this PR does / why we need it:

AWS ECR registries require the creation of an OCI repository before something can be uploaded.

To better support such special cases without flooding the common library with special cases
the plugin concept has been extended to support general typed actions.

The library now uses an action oco.repository.prepare to assure the existence of an OCI repository
before content is pushed.

Then an ecrplugin (under cmds/ecrplugin) is provided, which implements this special behaviour
for private ecr repositories.

Just copy the executable into your ~/.ocm/plugin folder.

Checkout its features with ocm describe plugin ecrplugin or ocm get plugins.

Unfortunately the ECR credentials cannot be used to access the AWS rest API required to create OCI repositories.
Therefore we need some kind of credential mapping. THis has been done based on plugin info and the spec of the action attributes.

As a result, the ecrplugin required appropriate additional AWS credentials which have bo be configured
in the .ocmconfig with the consumer type AWS

type: generic.config.ocm.software/v1
configurations:
  - type: credentials.config.ocm.software
    consumers:
      - identity:
          type: AWS
        credentials:
          - type: Credentials
            properties:
              awsAccessKeyID: "AKIAVWO6XXXXXXXXXXN6"
              awsSecretAccessKey: "XXXXXXXXXXXXXXXXXXXXXXXXX"

Which issue(s) this PR fixes:
Fixes #317

Special notes for your reviewer:

Release Notes:

@mandelsoft mandelsoft merged commit 218c2b1 into open-component-model:main Apr 4, 2023
@mandelsoft mandelsoft deleted the ecr branch April 4, 2023 08:06
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.

Add support for AWS ECR as an OCM OCI repository
2 participants