Commit 1f0c8b2
docs: Add how-to for migrating fallback resolvers to path matcher resolvers (#748)
#### What this PR does / why we need it
Adds a new how-to guide that walks users through migrating their
`.ocmconfig` from the deprecated `ocm.config.ocm.software` fallback
resolvers to the new `resolvers.config.ocm.software/v1alpha1` path
matcher resolvers.
The guide covers:
- Step-by-step config migration (`prefix` → `componentNamePattern`,
removing `priority`, changing the config type)
- A "When You Cannot Migrate Yet" section with mermaid diagrams showing
the behavioral difference (probe-and-retry vs first-match-wins)
- A concrete example of a registry migration scenario where fallback
resolvers are still needed
- A key differences comparison table
#### Which issue(s) this PR is related to
Related to open-component-model/ocm-project#927
#### Type of content
- [ ] Tutorial (`getting-started/` or `tutorials/`)
- [x] How-to Guide (`how-to/`)
- [ ] Explanation / Concept (`concepts/`)
- [ ] Reference (`reference/`)
- [ ] Other (infrastructure, config, fixes)
#### Checklist
- [x] I have read and followed the [Contributing
Guide](https://github.com/open-component-model/ocm-website/blob/main/CONTRIBUTING.md)
- [x] All commands/code snippets are tested and can be copy-pasted
#### Testing
Fully tested with
##### .ocmconfig-legacy
```yaml
type: generic.config.ocm.software/v1
configurations:
- type: credentials.config.ocm.software
repositories:
- repository:
type: DockerConfig/v1
dockerConfigFile: "~/.docker/config.json"
- type: ocm.config.ocm.software
resolvers:
- repository:
type: OCIRepository/v1
baseUrl: ghcr.io
subPath: matthiasbruns/ocm-tutorial-migrate-a
prefix: ocm.software/tutorials/backend
priority: 10
- repository:
type: OCIRepository/v1
baseUrl: ghcr.io
subPath: matthiasbruns/ocm-tutorial-migrate-b
prefix: ocm.software/tutorials/frontend
priority: 10
```
##### .ocmconfig-migrated
```yaml
type: generic.config.ocm.software/v1
configurations:
- type: credentials.config.ocm.software
repositories:
- repository:
type: DockerConfig/v1
dockerConfigFile: "~/.docker/config.json"
- type: resolvers.config.ocm.software/v1alpha1
resolvers:
- repository:
type: OCIRepository/v1
baseUrl: ghcr.io
subPath: matthiasbruns/ocm-tutorial-migrate-a
componentNamePattern: "ocm.software/tutorials/backend"
- repository:
type: OCIRepository/v1
baseUrl: ghcr.io
subPath: matthiasbruns/ocm-tutorial-migrate-b
componentNamePattern: "ocm.software/tutorials/frontend"
```
##### app-constructor.yam
```yaml
components:
- name: ocm.software/tutorials/app
version: "1.0.0"
provider:
name: ocm.software
componentReferences:
- name: backend-service
componentName: ocm.software/tutorials/backend
version: "1.0.0"
- name: frontend-service
componentName: ocm.software/tutorials/frontend
version: "1.0.0"
resources:
- name: config
version: "1.0.0"
type: plainText
input:
type: utf8
text: "app deployment configuration"
```
##### backend-constructor.yaml
```yaml
components:
- name: ocm.software/tutorials/backend
version: "1.0.0"
provider:
name: ocm.software
resources:
- name: config
version: "1.0.0"
type: plainText
input:
type: utf8
text: "backend service configuration"
```
##### frontend-constructor.yaml
```yaml
components:
- name: ocm.software/tutorials/frontend
version: "1.0.0"
provider:
name: ocm.software
resources:
- name: config
version: "1.0.0"
type: plainText
input:
type: utf8
text: "frontend service configuration"
```
##### test-migrate-resolvers.sh
```bash
#!/bin/bash
set -x
echo $GITHUB_TOKEN | docker login ghcr.io -u ${GITHUB_USERNAME} --password-stdin
# Step 1: Push backend and frontend components (no resolvers needed for leaf components)
./ocm add cv --repository ghcr.io/matthiasbruns/ocm-tutorial-migrate-a \
--constructor backend-constructor.yaml \
--component-version-conflict-policy replace \
--config
./ocm add cv --repository ghcr.io/matthiasbruns/ocm-tutorial-migrate-b \
--constructor frontend-constructor.yaml \
--component-version-conflict-policy replace \
--config
# Step 2: Push app component using the LEGACY fallback config
# This should work but emit a deprecation warning about fallback resolvers
./ocm add cv --repository ghcr.io/matthiasbruns/ocm-tutorial-migrate-app \
--constructor app-constructor.yaml \
--component-version-conflict-policy replace \
--config .ocmconfig-legacy
# Step 3: Verify recursive resolution works with the legacy config
./ocm get cv ghcr.io/matthiasbruns/ocm-tutorial-migrate-app//ocm.software/tutorials/app:1.0.0 \
--config .ocmconfig-legacy --recursive=-1
# Step 4: Verify recursive resolution works with the MIGRATED config
./ocm get cv ghcr.io/matthiasbruns/ocm-tutorial-migrate-app//ocm.software/tutorials/app:1.0.0 \
--config .ocmconfig-migrated --recursive=-1
# Step 5: Push app component again using the migrated config (no deprecation warning)
./ocm add cv --repository ghcr.io/matthiasbruns/ocm-tutorial-migrate-app \
--constructor app-constructor.yaml \
--component-version-conflict-policy replace \
--config .ocmconfig-migrated
# Step 6: Final verification with migrated config
./ocm get cv ghcr.io/matthiasbruns/ocm-tutorial-migrate-app//ocm.software/tutorials/app:1.0.0 \
--config .ocmconfig-migrated --recursive=-1
```
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Documentation**
* Added a new migration guide with step‑by‑step instructions, examples,
verification steps, troubleshooting notes, coexistence guidance, and a
“when you cannot migrate yet” section.
* Updated resolver-related docs, tutorials, and tips with links and a
callout directing readers to the new migration guide.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
Signed-off-by: Matthias Bruns <github@matthiasbruns.com>
Co-authored-by: Jakob Möller <contact@jakob-moeller.com>1 parent e99ab07 commit 1f0c8b2
File tree
5 files changed
+274
-0
lines changed- content/docs
- concepts
- how-to
- reference
- tutorials
5 files changed
+274
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
Lines changed: 262 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
| |||
133 | 137 | | |
134 | 138 | | |
135 | 139 | | |
| 140 | + | |
| 141 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
| 339 | + | |
| 340 | + | |
0 commit comments