Visitar URL original
refactor: simplify Target and Remote layering by Hrushikesh-ramilla · Pull Request #2333 · oras-project/oras · GitHub
Skip to content

refactor: simplify Target and Remote layering - #2333

Open
Hrushikesh-ramilla wants to merge 1 commit into
oras-project:mainfrom
Hrushikesh-ramilla:refactor/target-remote-layering
Open

Hrushikesh-ramilla wants to merge 1 commit into
oras-project:mainfrom
Hrushikesh-ramilla:refactor/target-remote-layering

Conversation

@Hrushikesh-ramilla

Copy link
Copy Markdown

What this PR does / why we need it:

Simplifies the Target/Remote layering in cmd/oras/internal/option:

  • Short-circuits Target.ModifyError on target.Type == TargetTypeOCILayout || target.IsOCILayout so --oci-layout-path targets do not fall through into remote registry error formatting.
  • Removes the duplicate Target.prefix field and uses Remote.flagPrefix consistently across setFlagDetails, ApplyFlags, and Parse.
  • Shares the TargetTypeOCILayout / TargetTypeRemote dispatch across NewTarget, NewBlobDeleter, NewManifestDeleter, and NewReadonlyTarget.
  • Initializes remo.store on demand via credentialStore() so Remote.ConfigPath() and DecorateCredentialError() do not depend on authClient having run first.

Which issue(s) this PR fixes:

Relates to #2280

Please check the following list:

  • Does the affected code have corresponding tests?
  • Are the changes documented, not just with inline comments, but also with conceptual docs such as an overview of a new feature, or task-based documentation like a tutorial?

Signed-off-by: hrushikeshramilla <ramillahrushikesh@gmail.com>
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.

1 participant