fix: register oci type instead of AnyConsumerIdentityType#1890
Conversation
AnyConsumerIdentityType
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe changes migrate OCI credential repository registrations from using a generic Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
e71bc60 to
264686b
Compare
264686b to
8244b6b
Compare
Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>
8244b6b to
22925c5
Compare
Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>
22925c5 to
48327f2
Compare
…omponent-model into registry-docker-credential-type
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>
…omponent-model into registry-docker-credential-type
0a829ef to
aabdd7b
Compare
We removed the registration of `AnyConsumerIdentity` for the OCI Credential plugin in #1890. While working on it, we noticed that, now, we error out when no repository plugin is found for a consumer type, e.g. `HelmChartRepository`, because we do not have a fallback repository anymore. This PR introduces a typed error to handle this. By returning `ErrNoRepositoryPluginFound` the caller can decide what to do with it. In our case, we do want to append the error `ErrNoIndirectCredentials` when resolving the credential indirectly, so the caller can, for example, just log the error and continue. > // TODO(@frewilhelm): Discuss if we want to introduce another API instead, e.g. IsRegistered(typed runtime.Typed) Currently, we just introduced a typed error. However, we should discuss if we want to add an API, e.g. `IsRegistered(typed runtime.Typed)` instead to give potential other users the possibility to use the functionality --- This is a required PR for #1890 because we need to update the `credential` module to make it work. You can take a look at the PR to see how the error is used in [`bindings/go/plugin/manager/registries/credentialrepository/graph_integration.go`](https://github.com/open-component-model/open-component-model/pull/1890/changes#diff-ea6f3328552c9ace91b8a2a703762023cbfd7e4d068c19dcbea29ae2c0624e56) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a new error signal to surface a specific "no repository plugin" condition. * **Bug Fixes** * Improved fallback resolution logic to return clearer, combined error information when a repository plugin is not found, leading to more precise error reporting during credential resolution. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>
…omponent-model into registry-docker-credential-type
Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>
…omponent-model into registry-docker-credential-type
…omponent-model into registry-docker-credential-type
Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>
Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
What this PR does / why we need it
Currently, the
OCICredentialRepositoryis registered with theAnyConsumerIdentityType. As a result, any credential identity*would be matched against theOCICredentialRepository. However, theOCICredentialRepositorycan only handle credentials of typeDockerConfigwhich requires certain fields, e.g.hostname.This PR changes the registration of the
OCICredentialRepositorywithAnyConsumerIdentityTypetov1.Typewhich results inOCIRepository.Which issue(s) this PR fixes
Fixes open-component-model/ocm-project#786
Testing
How to test the changes
Verification
ocmSummary by CodeRabbit