Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
add changed OciRepositoryCtx to python-bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
ccwienk committed Jun 17, 2021
1 parent f01d9c4 commit 64d0547
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions bindings-python/gci/componentmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,18 @@ class Resource(Artifact, LabelMethodsMixin):

@dc
class RepositoryContext:
pass # actually, must have attr `type`


class OciComponentNameMapping(enum.Enum):
URL_PATH = 'urlPath'
SHA256_DIGEST= 'sha256-digest'


@dc
class OciRepositoryContext(RepositoryContext):
baseUrl: str
componentNameNammping: OciComponentNameMapping = OciComponentNameMapping.URL_PATH
type: AccessType = AccessType.OCI_REGISTRY


Expand Down
4 changes: 2 additions & 2 deletions bindings-python/tests/gci/componentmodel_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def test_component():
name='component-name',
version='1.2.3',
repositoryContexts=[
cm.RepositoryContext(baseUrl='old-ctx-url'),
cm.RepositoryContext(baseUrl='current-ctx-url'),
cm.OciRepositoryContext(baseUrl='old-ctx-url'),
cm.OciRepositoryContext(baseUrl='current-ctx-url'),
],
provider=None,
sources=(),
Expand Down

0 comments on commit 64d0547

Please sign in to comment.