You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would allow us to reference `smd/v2` as a unit in documentation and releases, and to advertise support for specific group versions per deployment. Internally, `smd` itself would still route requests via `/v2` in its own API router.
47
47
48
+
### Two-Layer Versioning System
49
+
50
+
OpenCHAMI follows Kubernetes and Google's approach with two distinct versioning layers:
51
+
52
+
1.**API Group Version** (in the URL path): `/apis/smd/v2/`
53
+
2.**Resource Schema Version** (in the request/response payload): Individual resources can be served in multiple versions
54
+
55
+
This separation allows the same API group endpoint to serve resources in different schema versions. For example:
- Client specifies resource version via Accept header: `Accept: application/json;version=v3beta1`
58
+
- Server can serve the same Component resource in both `v2` and `v3beta1` schemas
59
+
60
+
This design enables individual resources to evolve without requiring a new API group version.
61
+
48
62
### Integers vs alphanumeric for versions
49
63
50
64
The [Google AIP-185 API Versioning](https://google.aip.dev/185) puts the major version number in the URI. The use of the term "major version number" is taken from [semantic versioning at semver.org](https://semver.org/). However, unlike in traditional semantic versioning, Google APIs must not expose minor or patch version numbers. For example, Google APIs use v1, not v1.0, v1.1, or v1.4.2. From a user's perspective, major versions are updated in place, and users receive new functionality without migration. For this reason, this RFD suggests only using the major version number in the URL.
@@ -69,15 +83,15 @@ For example:
69
83
* The API group might be `/apis/apps/v1`
70
84
* Within it, a `Deployment` resource might have multiple served versions (`v1`, `v1beta1`) with one storage version.
71
85
72
-
Right now, a change to the `Component` resource in `smd` replacing `id` (currently an `xname`) with an opaque identifier and moving `xname` into `location` would force us to think in terms of a new API URI version.
86
+
Right now, a change to the `Component` resource in `smd` replacing `id` (currently an `xname`) with an opaque identifier and moving `xname` into `location` would not require a new API group version.
73
87
74
-
Instead, we can version resource schemas within a group API version.
88
+
Instead, we can version resource schemas within the existing group API version:
75
89
76
90
* Keep the group at `smd/v2`.
77
91
* Internally serve `Component` in both `v2` (old schema) and `v3beta1` (new schema) for a period.
78
92
* Persist everything in the new schema, converting for old clients as Kubernetes does for CRDs.
79
93
80
-
This separation of API group version (what’s in the URI) from resource schema version (what’s in the payload) would give us more flexibility to evolve individual resources without churning the entire group version.
94
+
This separation of API group version (what's in the URI) from resource schema version (what's in the payload) gives us flexibility to evolve individual resources without churning the entire group version.
0 commit comments