Commit ef663ee
authored
docs: add how-to for transferring Helm charts with OCM (#751)
#### What this PR does / why we need it
Adds a how-to guide for transferring component versions containing Helm
chart resources (`helm/v1` access type) between OCI registries using the
OCM CLI. Covers the `--upload-as localBlob` and `--upload-as
ociArtifact` options.
Related to
open-component-model/open-component-model#1846
#### Which issue(s) this PR is related to
Related to
open-component-model/open-component-model#1846 (comment)
#### 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
#### Test
```bash
#!/bin/zsh
set -e
REGISTRY="${REGISTRY:-ghcr.io/matthiasbruns/ocm-tutorials}"
COMPONENT="ocm.software/podinfo"
VERSION="6.9.1"
CTF_DIR=$(mktemp -d)
echo "CTF archive: $CTF_DIR"
pause() {
echo "\n>>> Next: $1"
echo "--- Press Enter to continue ---"
read
}
# Step 1: Create constructor.yaml
cat <<EOF > constructor.yaml
components:
- name: ${COMPONENT}
version: ${VERSION}
provider:
name: ocm.software
resources:
- name: podinfo
version: ${VERSION}
type: helmChart
access:
type: helm/v1
helmRepository: https://stefanprodan.github.io/podinfo
helmChart: podinfo-${VERSION}.tgz
EOF
echo "Created constructor.yaml"
pause "Add component version to CTF archive"
# Step 2: Add component version to CTF
./ocm add cv \
--repository "ctf::${CTF_DIR}" \
--constructor constructor.yaml \
--skip-reference-digest-processing
echo "Component version added to CTF"
pause "Transfer with --upload-as ociArtifact"
# Step 3: Transfer as ociArtifact
./ocm transfer cv \
--copy-resources \
--upload-as ociArtifact \
"ctf::${CTF_DIR}//${COMPONENT}:${VERSION}" \
"${REGISTRY}"
echo "Transfer complete (ociArtifact)"
pause "Verify: get component version from registry"
# Step 4: Verify component version
./ocm get cv "${REGISTRY}//${COMPONENT}:${VERSION}"
pause "Verify: inspect component descriptor to find imageReference"
# Step 5: Inspect component descriptor to find imageReference
./ocm get cv "${REGISTRY}//${COMPONENT}:${VERSION}" -o yaml
pause "Verify: download the chart resource"
# Step 6: Download the chart resource
rm -rf ./downloaded
./ocm download resource \
"${REGISTRY}//${COMPONENT}:${VERSION}" \
--identity "name=podinfo,version=${VERSION}" \
--output ./downloaded
echo "\nDownloaded to ./downloaded:"
ls -la ./downloaded
# Cleanup
pause "Clean up CTF archive"
rm -rf "${CTF_DIR}"
echo "Removed ${CTF_DIR}"
echo "\nDone."
```
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Documentation**
* Added a detailed how-to for transferring Helm-chart-backed component
versions between OCI registries via the CLI, including prerequisites,
step-by-step workflow, verification, storage modes, cross-registry
examples, and relevant commands.
* **Chores**
* Expanded repository configuration wordlist with two additional entries
to recognize more terms.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Signed-off-by: Matthias Bruns <git@matthiasbruns.com>1 parent 1f0c8b2 commit ef663ee
File tree
2 files changed
+170
-0
lines changed- .github/config
- content/docs/how-to
2 files changed
+170
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
| 468 | + | |
| 469 | + | |
| 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 | + | |
0 commit comments