Skip to content

Commit b286e28

Browse files
chore(docs): add floating tag spec updates (#145)
#### What this PR does / why we need it open-component-model/ocm-project#956 introduces floating-tag support in ocm. This PR adds the required spec changes. For the floating tag tag add & delete support, we currently implement them in two backend - oci - ctf For this we introduced `AliasComponentVersionRepository`, which is reflected in the operations file. Each backend covers its requirements for the implementation in the respective files. #### Which issue(s) this PR is related to Fixes: open-component-model/ocm-project#1172 --------- Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
1 parent 3cabd87 commit b286e28

3 files changed

Lines changed: 85 additions & 0 deletions

File tree

doc/03-persistence/01-operations.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,26 @@ Optional operations might be:
8989
It should not only return component identities, that are direct children,
9090
but traverse the complete subtree.
9191

92+
##### Version Alias Operations
93+
94+
Storage backends **MAY** expose an extended interface
95+
for managing symbolic aliases (floating tags) that resolve to concrete component versions.
96+
97+
An alias is a mutable, human-readable name (e.g., `latest`, `stable`, `production`)
98+
that resolves to exactly one component version at any point in time. Alias names
99+
**MUST NOT** be valid OCM version strings.
100+
101+
- **`AddComponentVersionAlias(ComponentId, VersionOrAliasName, AliasName) error`**
102+
103+
Attach a symbolic alias to an existing component version. `VersionOrAliasName` is either
104+
a version or an existing alias; `AliasName` **MUST NOT** be a valid OCM version string.
105+
If the alias already exists it is updated to point to the new target.
106+
107+
- **`RemoveComponentVersionAlias(ComponentId, AliasName) error`**
108+
109+
Remove an alias. Only the alias pointer is removed; the underlying component version
110+
and its content are not affected. `AliasName` **MUST NOT** be a valid OCM version string.
111+
92112
### Access Method Operations
93113

94114
There must be an implementation for all supported external access methods

doc/04-extensions/03-storage-backends/ctf.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,33 @@ This format uses the `OCIRegistry` element mapping to map OCM elements to OCI el
5555
This format supports no dedicated blob mappings.
5656
Local blobs are always stored as blobs.
5757

58+
## Alias Management Operations
59+
60+
CTF archives **MAY** implement the optional version alias operations defined in
61+
[Version Alias Operations](../../../doc/03-persistence/01-operations.md#version-alias-operations).
62+
Alias resolution uses the existing
63+
[`GetComponentVersion`](../../../doc/03-persistence/01-operations.md#repository-operations)
64+
operation — an alias name is passed where a version is expected and resolves via tag lookup
65+
in `artifact-index.json`.
66+
67+
The following describes how each write operation maps onto the CTF artifact index.
68+
69+
**`AddComponentVersionAlias`**
70+
71+
The alias is recorded in `artifact-index.json` as a tag pointing to the same digest as
72+
`VersionOrAliasName` (a version or existing alias). If the tag already exists it **MUST** be updated to point to the
73+
new digest. `AliasName` **MUST NOT** be a valid OCM version string.
74+
75+
**`RemoveComponentVersionAlias`**
76+
77+
The alias entry is removed from `artifact-index.json`. Only the index entry is removed; the
78+
manifest blob and all referenced content blobs remain in the CTF archive.
79+
80+
Implementations **MUST** return an error if:
81+
82+
* `AliasName` is a valid OCM version string.
83+
* No entry with the given tag exists in the repository.
84+
5885
## Examples
5986

6087
```text

doc/04-extensions/03-storage-backends/oci.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ The specification also introduces a Component Index artifact used for referrer-b
5656
* [12.1 Version Aliasing](#121-version-aliasing)
5757
* [12.1.1 Resolution Rules](#1211-resolution-rules)
5858
* [12.1.2 Interaction with Component Version Processing](#1212-interaction-with-component-version-processing)
59+
* [12.1.3 Alias Management Operations](#1213-alias-management-operations)
5960
* [13. Compatibility Requirements](#13-compatibility-requirements)
6061
* [Examples (Informative)](#examples-informative)
6162
* [Simple Examples](#simple-examples)
@@ -815,6 +816,11 @@ Aliases that rely on SemVer ordering:
815816

816817
Aliases whose semantics do not rely on SemVer (e.g., `edge` → “most recently published”) **MAY** be supported, but clients **MUST** specify their selection criteria.
817818

819+
Alias resolution uses the existing
820+
[`GetComponentVersion`](../../../doc/03-persistence/01-operations.md#repository-operations)
821+
operation — an alias name is passed where a version is expected and resolves via standard
822+
OCI tag lookup.
823+
818824
#### 12.1.1 Resolution Rules
819825

820826
Alias resolution **MUST** produce exactly one concrete version tag.
@@ -855,6 +861,38 @@ Clients **SHOULD** reveal both:
855861

856862
to ensure transparency and debuggability.
857863

864+
#### 12.1.3 Alias Management Operations
865+
866+
**`AddComponentVersionAlias`**
867+
868+
Implementations **MUST** resolve `VersionOrAliasName` (a version or existing alias) as an OCI tag in the component's
869+
repository, validate that the resolved descriptor represents a valid OCM component version,
870+
and then push the alias as an OCI tag pointing to that descriptor using the
871+
[OCI Distribution Specification manifest push](https://github.com/opencontainers/distribution-spec/blob/v1.1.1/spec.md#pushing-manifests)
872+
mechanism.
873+
874+
`AliasName` **MUST** be rejected if it is a valid OCM version string.
875+
876+
After a successful push the alias tag **MUST** resolve to the descriptor identified by
877+
`VersionOrAliasName`. If the tag already pointed elsewhere it is overwritten.
878+
879+
**`RemoveComponentVersionAlias`**
880+
881+
Implementations **MUST** remove the alias tag from the component's OCI repository without
882+
deleting the underlying manifest or blobs, using the
883+
[OCI Distribution Specification tag deletion](https://github.com/opencontainers/distribution-spec/blob/v1.1.1/spec.md#deleting-tags)
884+
mechanism.
885+
886+
Implementations **MUST** return an error if:
887+
888+
* `AliasName` is a valid OCM version string.
889+
* The alias tag does not exist.
890+
* The resolved descriptor is not a valid OCM component version.
891+
892+
Implementations **SHOULD** propagate registry-level errors that indicate tag deletion is
893+
not supported (e.g., a `405 Method Not Allowed` response) as a distinct error to allow
894+
callers to handle the capability gap gracefully.
895+
858896
## 13. Compatibility Requirements
859897

860898
* Clients **SHOULD** support reading manifest- and index-based storage; write support **MAY** be limited.

0 commit comments

Comments
 (0)