Extend OCM Plugins to support generic actions + define oci.repository.prepare action to assure existence of OCI repositories #320
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 repositorybefore content is pushed.
Then an
ecrplugin
(undercmds/ecrplugin
) is provided, which implements this special behaviourfor private ecr repositories.
Just copy the executable into your ~/.ocm/plugin folder.
Checkout its features with
ocm describe plugin ecrplugin
orocm 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 configuredin the
.ocmconfig
with the consumer typeAWS
Which issue(s) this PR fixes:
Fixes #317
Special notes for your reviewer:
Release Notes: