Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
027c3ec
feat: install ocm-cli from archived release and add version verification
medmes Nov 7, 2025
05af38d
Merge branch 'main' into feat/use-ocm-cli-to-submit-ocm-components-ve…
medmes Nov 7, 2025
00a3cc5
fix typo for the github action yaml path
medmes Nov 7, 2025
f254a76
Merge branch 'feat/use-ocm-cli-to-submit-ocm-components-versions' of …
medmes Nov 7, 2025
1dde249
add ocm cli version to e2e tests with gardener
medmes Nov 7, 2025
cbd824c
fix quotes on verify_checksum input description
medmes Nov 7, 2025
b40be79
remove quotes in eval value
medmes Nov 7, 2025
84b7649
define ocn_cli_version env variable on get configuration action
medmes Nov 7, 2025
81a9430
remove v prefix for the download url link
medmes Nov 10, 2025
dd16132
Merge branch 'feat/use-ocm-cli-to-submit-ocm-components-versions' of …
medmes Nov 10, 2025
87828f4
replace transfering ocm artifacts using modulectl by ocm cli
medmes Nov 10, 2025
1a36fa8
Merge branch 'main' into feat/use-ocm-cli-to-submit-ocm-components-ve…
medmes Nov 10, 2025
d93a987
add some comments and fix yq output typo error
medmes Nov 10, 2025
99d7512
upgrade modulectl version to use the --disable-registry-push & --outp…
medmes Nov 10, 2025
9a33e72
Merge branch 'main' into feat/use-ocm-cli-to-submit-ocm-components-ve…
medmes Nov 10, 2025
e6a3c23
change the install path default value to the workspace path
medmes Nov 10, 2025
f42b50d
change to dir output instead of file artifact
medmes Nov 10, 2025
b92edf8
revert back to default path
medmes Nov 10, 2025
3a40f5f
Push and patch ModuleTemplate
medmes Nov 11, 2025
0f10ffe
Merge branch 'main' into feat/use-ocm-cli-to-submit-ocm-components-ve…
medmes Nov 11, 2025
542d49b
Push e2e test
medmes Nov 12, 2025
ed73d71
Merge branch 'main' into feat/use-ocm-cli-to-submit-ocm-components-ve…
medmes Nov 12, 2025
746d303
export template-operator to versions.yaml and upgrade to correct modu…
medmes Nov 12, 2025
adffcc1
Merge branch 'feat/use-ocm-cli-to-submit-ocm-components-versions' of …
medmes Nov 12, 2025
8d211fd
patch image tag for kustomize before generating the raw manifest
medmes Nov 12, 2025
a3bbfb8
fix action tests versions
medmes Nov 12, 2025
e0dc241
fix bdba issue relatred to the ocm version validation
medmes Nov 12, 2025
9c6d99a
Fixed validation of non-existent images: ocm Skip digest generation
medmes Nov 12, 2025
d2682c9
Skip digest generation in actions
medmes Nov 12, 2025
ae6df04
enable uploader oci Registry
medmes Nov 12, 2025
58ecf1d
ocm accept host:port and not full url
medmes Nov 12, 2025
961760a
add ocm config in oorder to retrieve credentials for private registry
medmes Nov 12, 2025
52941f7
add creentials to ocm config
medmes Nov 12, 2025
dde8b2e
created dedidacted ocm config files under scripts/test directory
medmes Nov 12, 2025
a8c14a0
set ocm config in seperate files to be picked from ~/.ocmconfig
medmes Nov 13, 2025
4a66d84
use -config directly on the ocm command
medmes Nov 13, 2025
39b9c9f
ocm cli added ocm config
medmes Nov 13, 2025
8649748
add debugging line
medmes Nov 13, 2025
185440c
chenge the type name ocm config
medmes Nov 13, 2025
62894f6
uniify credential access
medmes Nov 14, 2025
2300cd9
Merge branch 'main' into feat/use-ocm-cli-to-submit-ocm-components-ve…
medmes Nov 14, 2025
49e85d9
Merge branch 'main' into feat/use-ocm-cli-to-submit-ocm-components-ve…
medmes Nov 14, 2025
73fd668
fix namespace issue for ModuleTemplate klm e2e testing
medmes Nov 14, 2025
aa8dabc
Merge branch 'main' into feat/use-ocm-cli-to-submit-ocm-components-ve…
medmes Nov 14, 2025
c3fb13c
remove the default template-operator version
medmes Nov 14, 2025
20ee2ad
debugging
medmes Nov 14, 2025
9c1258b
added k8s deployments checks logs
medmes Nov 14, 2025
cc4ec1e
add post debugging after GH action timeout
medmes Nov 14, 2025
249a86b
debugging post jobs
medmes Nov 14, 2025
1bf9c82
post debug
medmes Nov 14, 2025
c1e3fd4
adding module-config to the GH action
medmes Nov 14, 2025
66a1b5e
changed module-config yaml
medmes Nov 14, 2025
6d35155
module-config.yaml added to deploy template operator
medmes Nov 14, 2025
4f1f2ba
removed
medmes Nov 14, 2025
b9ad8af
Merge branch 'main' into feat/use-ocm-cli-to-submit-ocm-components-ve…
medmes Nov 16, 2025
cb02e2b
patching the oci descriptor oci-registry
medmes Nov 16, 2025
ac3f41d
added oci registry to patched MT
medmes Nov 16, 2025
04d0d62
patched
medmes Nov 16, 2025
5bf6fa0
port changed
medmes Nov 16, 2025
7b6498a
revert back internal port to 5000
medmes Nov 16, 2025
73ec7c5
remove unwanted debug scripts
medmes Nov 16, 2025
15a3329
remove unwanted debug scripts
medmes Nov 16, 2025
77db027
Merge branch 'main' into feat/use-ocm-cli-to-submit-ocm-components-ve…
medmes Nov 17, 2025
f78e04c
align ctf directory
medmes Nov 17, 2025
ca8c44a
added ctf transfer overwirte and fix parsing to MMie tar
medmes Nov 17, 2025
d90a738
remove default to 1.0.4
medmes Nov 17, 2025
47aeb0a
remove redandant script in actions
medmes Nov 17, 2025
fd9273e
Merge branch 'main' into feat/use-ocm-cli-to-submit-ocm-components-ve…
medmes Nov 19, 2025
4ea0210
fix compression klm
medmes Nov 19, 2025
c0f33d8
Merge branch 'main' into feat/use-ocm-cli-to-submit-ocm-components-ve…
medmes Nov 20, 2025
6871fdb
Merge branch 'main' into feat/use-ocm-cli-to-submit-ocm-components-ve…
Tomasz-Smelcerz-SAP Nov 21, 2025
a0aa65e
Update modulectl version
Tomasz-Smelcerz-SAP Nov 21, 2025
060dad6
[DEBUG] revert changes in manifest parsing
Tomasz-Smelcerz-SAP Nov 21, 2025
14608b5
[DEBUG] print component-constructor.yaml
Tomasz-Smelcerz-SAP Nov 21, 2025
3a45d0f
Revert debugging
Tomasz-Smelcerz-SAP Nov 22, 2025
308356a
update modulectl version
Tomasz-Smelcerz-SAP Nov 27, 2025
7f41510
revert changes to img handling
Tomasz-Smelcerz-SAP Nov 27, 2025
7d11917
Merge branch 'main' into feat/use-ocm-cli-to-submit-ocm-components-ve…
Tomasz-Smelcerz-SAP Nov 27, 2025
1bf85e1
Extend debugging
Tomasz-Smelcerz-SAP Nov 27, 2025
8bce8de
Extend debugging
Tomasz-Smelcerz-SAP Nov 27, 2025
9a323e1
Extend debugging
Tomasz-Smelcerz-SAP Nov 28, 2025
eca6ef0
Extend debugging
Tomasz-Smelcerz-SAP Nov 28, 2025
2604c65
Extend debugging
Tomasz-Smelcerz-SAP Nov 28, 2025
05d506b
Merge branch 'main' into feat/use-ocm-cli-to-submit-ocm-components-ve…
medmes Nov 30, 2025
d96626d
revert back the bdba scanning append
medmes Nov 30, 2025
4850666
fixed the deployable image version
medmes Nov 30, 2025
6a58674
make it generic enough the component descriptor image name
medmes Nov 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ name: Deploy template-operator With ModuleReleaseMeta
description: Deploys a test-specific template-operator and corresponding ModuleReleaseMeta.
inputs:
module_version:
description: "Version of the template operator to be deployed, should be aligned with the latest version released in github."
description: "Version of the template operator to be deployed, should be aligned with the version in versions.yaml"
required: true
default: "1.0.4"
runs:
using: composite
steps:
Expand All @@ -22,6 +21,8 @@ runs:
cp ../lifecycle-manager/scripts/tests/deploy_moduletemplate.sh .
cp ../lifecycle-manager/scripts/tests/deploy_modulereleasemeta.sh .
cp ../lifecycle-manager/scripts/tests/deploy_mandatory_modulereleasemeta.sh .
cp ../lifecycle-manager/scripts/tests/ocm-config-local-registry.yaml .
cp ../lifecycle-manager/scripts/tests/ocm-config-private-registry.yaml .
- name: Create and apply Template Operator ModuleTemplate from the latest release
working-directory: template-operator
if: ${{ matrix.e2e-test != 'mandatory-module' &&
Expand All @@ -31,10 +32,9 @@ runs:
}}
shell: bash
run: |
modulectl create --config-file ./module-config.yaml --registry http://localhost:5111 --insecure
sed -i 's/localhost:5111/k3d-kcp-registry.localhost:5000/g' ./template.yaml
kubectl get crds
kubectl apply -f template.yaml
yq eval '.images[0].newTag = "${{ inputs.module_version }}"' -i config/manager/deployment/kustomization.yaml
make build-manifests
./deploy_moduletemplate.sh ${{ env.ModuleName }} ${{ inputs.module_version }} true false true false ${{ inputs.module_version }}
- name: Create and apply Template Operator ModuleTemplate with ModuleDeploymentNameInOlderVersion
working-directory: template-operator
if: ${{ matrix.e2e-test != 'mandatory-module' &&
Expand All @@ -44,9 +44,10 @@ runs:
}}
shell: bash
run: |
yq eval '.images[0].newTag = "${{ env.OlderVersion }}"' -i config/manager/deployment/kustomization.yaml
make build-manifests
yq eval '(. | select(.kind == "Deployment") | .metadata.name) = "${{ env.ModuleDeploymentNameInOlderVersion }}"' -i template-operator.yaml
./deploy_moduletemplate.sh ${{ env.ModuleName }} ${{ env.OlderVersion }}
./deploy_moduletemplate.sh ${{ env.ModuleName }} ${{ env.OlderVersion }} true false true false ${{ inputs.module_version }}
- name: Create and apply Template Operator ModuleTemplate with ModuleDeploymentNameInNewerVersion
working-directory: template-operator
if: ${{ matrix.e2e-test != 'mandatory-module' &&
Expand All @@ -67,18 +68,44 @@ runs:
REQUIRE_DOWNTIME=false
fi

yq eval '.images[0].newTag = "${{ env.NewerVersion }}"' -i config/manager/deployment/kustomization.yaml
make build-manifests
yq eval '(. | select(.kind == "Deployment") | .metadata.name) = "${{ env.ModuleDeploymentNameInNewerVersion }}"' -i template-operator.yaml
./deploy_moduletemplate.sh ${{ env.ModuleName }} ${{ env.NewerVersion }} $INCLUDE_DEFAULT_CR $MANDATORY $DEPLOY_MODULETEMPLATE $REQUIRE_DOWNTIME
./deploy_moduletemplate.sh ${{ env.ModuleName }} ${{ env.NewerVersion }} $INCLUDE_DEFAULT_CR $MANDATORY $DEPLOY_MODULETEMPLATE $REQUIRE_DOWNTIME ${{ inputs.module_version }}
- name: Create and apply Template Operator ModuleTemplate in private registry
working-directory: template-operator
if: ${{ matrix.e2e-test == 'oci-reg-cred-secret' }}
shell: bash
run: |
modulectl create --config-file ./module-config.yaml --registry http://k3d-private-oci-reg.localhost:5001 --registry-credentials myuser:mypass --insecure
sed -i 's/k3d-private-oci-reg.localhost:5001/private-oci-reg.localhost:5000/g' ./template.yaml
MODULE_CONFIG="./module-config.yaml"
REGISTRY_URL="k3d-private-oci-reg.localhost:5001"
REGISTRY_CREDS="myuser:mypass"
COMPONENT_CONSTRUCTOR_FILE="./component-constructor.yaml"
CTF_DIR="./component-ctf"
TEMPLATE_FILE="./template.yaml"
TARGET_REGISTRY="private-oci-reg.localhost:5000"
OCM_CONFIG="./ocm-config-private-registry.yaml"

echo "creating ModuleTemplate"
modulectl create \
--config-file "${MODULE_CONFIG}" \
--disable-ocm-registry-push \
--output-constructor-file "${COMPONENT_CONSTRUCTOR_FILE}"

echo "pushing OCM components..."
ocm --config "${OCM_CONFIG}" add componentversions --create --file "${CTF_DIR}" --skip-digest-generation "${COMPONENT_CONSTRUCTOR_FILE}"
ocm --config "${OCM_CONFIG}" transfer ctf \
--overwrite \
--no-update \
"${CTF_DIR}" \
"http://${REGISTRY_URL}"

echo "Verifying component in private registry..."
curl -s -u myuser:mypass "http://${REGISTRY_URL}/v2/_catalog" || echo "Warning: Could not verify registry catalog"

echo "No baseUrl patching needed for private registry..."
kubectl get crds
kubectl apply -f template.yaml
kubectl apply -f <(yq eval '.metadata.namespace = "kcp-system"' "${TEMPLATE_FILE}")
- name: Create and apply ModuleReleaseMeta from the template-operator repo
working-directory: template-operator
if: ${{ matrix.e2e-test == 'kyma-metrics' ||
Expand Down Expand Up @@ -126,9 +153,10 @@ runs:
}}
shell: bash
run: |
yq eval '.images[0].newTag = "${{ env.OlderVersionForMandatoryModule }}"' -i config/manager/deployment/kustomization.yaml
make build-manifests
yq eval '(. | select(.kind == "Deployment") | .metadata.name) = "${{ env.ModuleDeploymentNameInOlderVersion }}"' -i template-operator.yaml
./deploy_moduletemplate.sh ${{ env.ModuleName }} ${{ env.OlderVersionForMandatoryModule }} true true false
./deploy_moduletemplate.sh ${{ env.ModuleName }} ${{ env.OlderVersionForMandatoryModule }} true true false false ${{ inputs.module_version }}
yq eval 'del(.spec.mandatory)' -i template.yaml
kubectl apply -f template.yaml
rm -f template.yaml
Expand All @@ -140,9 +168,10 @@ runs:
working-directory: template-operator
shell: bash
run: |
yq eval '.images[0].newTag = "${{ env.NewerVersionForMandatoryModule }}"' -i config/manager/deployment/kustomization.yaml
make build-manifests
yq eval '(. | select(.kind == "Deployment") | .metadata.name) = "${{ env.ModuleDeploymentNameInNewerVersion }}"' -i template-operator.yaml
./deploy_moduletemplate.sh ${{ env.ModuleName }} ${{ env.NewerVersionForMandatoryModule }} true true false
./deploy_moduletemplate.sh ${{ env.ModuleName }} ${{ env.NewerVersionForMandatoryModule }} true true false false ${{ inputs.module_version }}
yq eval 'del(.spec.mandatory)' -i template.yaml
cp template.yaml ../lifecycle-manager/tests/e2e/mandatory_template_v2.yaml
- name: Create and apply ModuleReleaseMeta Template Operator with newer version in fast channel and older version in regular channel
Expand All @@ -157,14 +186,16 @@ runs:
shell: bash
run: |
# Create and apply ModuleReleaseMeta with version when deployment is in warning state
yq eval '.images[0].newTag = "${{ env.VersionForDeploymentInWarning }}"' -i config/manager/deployment/kustomization.yaml
make build-manifests
yq eval '(. | select(.kind == "Deployment") | .spec.template.spec.containers[0].args) = ["--leader-elect", "--final-state=Warning", "--final-deletion-state=Warning"]' -i template-operator.yaml
./deploy_moduletemplate.sh ${{ env.ModuleName }} ${{ env.VersionForDeploymentInWarning }}
./deploy_moduletemplate.sh ${{ env.ModuleName }} ${{ env.VersionForDeploymentInWarning }} true false true false ${{ inputs.module_version }}
./deploy_modulereleasemeta.sh ${{ env.ModuleName }} regular:${{ env.VersionForDeploymentInWarning }}

# Create and apply ModuleReleaseMeta with version when deployment is misconfigured
yq eval '.images[0].newTag = "${{ env.VersionForMisconfiguredDeploymentImage }}"' -i config/manager/deployment/kustomization.yaml
make build-manifests
yq eval '(. | select(.kind == "Deployment") | .spec.template.spec.containers[0].image) = "non-working/path:001"' -i template-operator.yaml
yq eval '(. | select(.kind == "Deployment") | .spec.template.spec.containers[0].image) = "non-working/path:0.0.1"' -i template-operator.yaml
yq eval '(. | select(.kind == "Deployment") | .spec.progressDeadlineSeconds) = 60' -i template-operator.yaml
yq eval '(. | select(.kind == "Deployment") | .spec.template.spec.containers[0].livenessProbe) = {
"httpGet": {"path": "/healthz", "port": 8081},
Expand All @@ -174,31 +205,34 @@ runs:
"httpGet": {"path": "/readyz", "port": 8081},
"initialDelaySeconds": 5, "periodSeconds": 5, "failureThreshold": 1
}' -i template-operator.yaml
./deploy_moduletemplate.sh ${{ env.MisconfiguredModuleName }} ${{ env.VersionForMisconfiguredDeploymentImage }}
./deploy_moduletemplate.sh ${{ env.MisconfiguredModuleName }} ${{ env.VersionForMisconfiguredDeploymentImage }} true false true false ${{ inputs.module_version }}
./deploy_modulereleasemeta.sh ${{ env.MisconfiguredModuleName }} regular:${{ env.VersionForMisconfiguredDeploymentImage }}
- name: Create ModuleTemplate and ModuleReleaseMeta for Module Status test with StatefulSet
working-directory: template-operator
if: ${{ matrix.e2e-test == 'module-status-decoupling-with-statefulset'}}
shell: bash
run: |
# Create and apply ModuleReleaseMeta with version when statefulset is in warning state
yq eval '.images[0].newTag = "${{ env.VersionForStatefulSetInWarning }}"' -i config/manager/statefulset/kustomization.yaml
make build-statefulset-manifests
yq eval '(. | select(.kind == "StatefulSet") | .spec.template.spec.containers[0].args) = ["--leader-elect", "--final-state=Warning", "--final-deletion-state=Warning"]' -i template-operator.yaml
./deploy_moduletemplate.sh ${{ env.ModuleName }} ${{ env.VersionForStatefulSetInWarning }}
./deploy_moduletemplate.sh ${{ env.ModuleName }} ${{ env.VersionForStatefulSetInWarning }} true false true false ${{ inputs.module_version }}
./deploy_modulereleasemeta.sh ${{ env.ModuleName }} regular:${{ env.VersionForStatefulSetInWarning }}

# Create and apply ModuleReleaseMeta with version when statefulset is misconfigured
yq eval '.images[0].newTag = "${{ env.VersionForMisconfiguredStatefulSetImage }}"' -i config/manager/statefulset/kustomization.yaml
make build-statefulset-manifests
yq eval '(. | select(.kind == "StatefulSet") | .spec.template.spec.containers[0].image) = "non-working/path:002"' -i template-operator.yaml
./deploy_moduletemplate.sh ${{ env.MisconfiguredModuleName }} ${{ env.VersionForMisconfiguredStatefulSetImage }}
yq eval '(. | select(.kind == "StatefulSet") | .spec.template.spec.containers[0].image) = "non-working/path:0.0.2"' -i template-operator.yaml
./deploy_moduletemplate.sh ${{ env.MisconfiguredModuleName }} ${{ env.VersionForMisconfiguredStatefulSetImage }} true false true false ${{ inputs.module_version }}
./deploy_modulereleasemeta.sh ${{ env.MisconfiguredModuleName }} regular:${{ env.VersionForMisconfiguredStatefulSetImage }}
- name: Create Template Operator Module without default CR and apply ModuleReleaseMeta
working-directory: template-operator
if: ${{ matrix.e2e-test == 'module-without-default-cr' }}
shell: bash
run: |
yq eval '.images[0].newTag = "${{ env.VersionForNoDefaultCR }}"' -i config/manager/deployment/kustomization.yaml
make build-manifests
./deploy_moduletemplate.sh ${{ env.ModuleName }} ${{ env.VersionForNoDefaultCR }} false
./deploy_moduletemplate.sh ${{ env.ModuleName }} ${{ env.VersionForNoDefaultCR }} false false true false ${{ inputs.module_version }}
./deploy_modulereleasemeta.sh ${{ env.ModuleName }} regular:${{ env.VersionForNoDefaultCR }}
- name: Apply ModuleReleaseMeta with ModuleTemplate with name <modulename>-<channel>
working-directory: template-operator
Expand All @@ -220,3 +254,21 @@ runs:
shell: bash
run: |
kubectl apply -f tests/e2e/moduletemplate/moduletemplate_template_operator_transferred.yaml
- name: Debug - Check ModuleTemplate and Component Status
working-directory: lifecycle-manager
shell: bash
run: |
echo "=== Checking ModuleTemplates in kcp-system ==="
kubectl get moduletemplates -n kcp-system -o wide || echo "Failed to get ModuleTemplates"

echo ""
echo "=== Checking ModuleReleaseMeta ==="
kubectl get modulereleasemeta -n kcp-system -o wide || echo "Failed to get ModuleReleaseMeta"

echo ""
echo "=== Checking if components are in registry ==="
curl -s "http://localhost:5111/v2/_catalog" || echo "Warning: Could not query registry catalog"

echo ""
echo "=== Checking if component version exists ==="
curl -s "http://localhost:5111/v2/component-descriptors/kyma-project.io/module/template-operator/tags/list" || echo "Warning: Could not list component tags"
8 changes: 8 additions & 0 deletions .github/actions/get-configuration/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ outputs:
k3d_version:
description: The version of k3d to install. For example, 5.6.0.
value: ${{ steps.define-variables.outputs.k3d_version }}
ocm_cli_version:
description: The version of ocm-cli to install. For example, 0.32.0.
value: ${{ steps.define-variables.outputs.ocm_cli_version }}
modulectl_version:
description: The version of modulectl to install. For example, 1.0.0.
value: ${{ steps.define-variables.outputs.modulectl_version }}
template_operator_version:
description: The version of template-operator to checkout. Defaults to value from versions.yaml.
value: ${{ steps.define-variables.outputs.template_operator_version }}
cert_manager_version:
description: The version of cert-manager to deploy. For example, 1.13.3.
value: ${{ steps.define-variables.outputs.cert_manager_version }}
Expand Down Expand Up @@ -42,7 +48,9 @@ runs:
run: |
echo "istio_version=$(yq e '.istio' versions.yaml)" >> $GITHUB_OUTPUT
echo "k3d_version=$(yq e '.k3d' versions.yaml)" >> $GITHUB_OUTPUT
echo "ocm_cli_version=$(yq e '.ocm-cli' versions.yaml)" >> $GITHUB_OUTPUT
echo "modulectl_version=$(yq e '.modulectl' versions.yaml)" >> $GITHUB_OUTPUT
echo "template_operator_version=$(yq e '.template-operator' versions.yaml)" >> $GITHUB_OUTPUT
echo "cert_manager_version=$(yq e '.certManager' versions.yaml)" >> $GITHUB_OUTPUT
echo "gardener_cert_manager_version=$(yq e '.gardenerCertManager' versions.yaml)" >> $GITHUB_OUTPUT
echo "golangci_lint_version=$(yq e '.golangciLint' versions.yaml)" >> $GITHUB_OUTPUT
Expand Down
74 changes: 74 additions & 0 deletions .github/actions/install-ocm-cli/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Install ocm-cli
description: Installs the OCM CLI binary (Linux amd64) with checksum verification; requires explicit release version.
inputs:
ocm_cli_version:
description: Explicit release tag (e.g. v0.32.0). No 'latest'.
required: true
install_path:
description: Directory to place the binary
required: false
default: $(pwd)/ocm/bin
verify_checksum:
description: "'true' to verify checksum (sha256)"
required: false
default: 'true'
runs:
using: composite
steps:
- name: Validate version input
id: validate
shell: bash
run: |
set -euo pipefail
VERSION=${{ inputs.ocm_cli_version }}
if [ -z "${VERSION}" ]; then
echo "Version input empty; aborting." >&2
exit 1
fi
if [ "${VERSION}" = "latest" ] || [ "${VERSION}" = "main" ]; then
echo "Dynamic versions ('latest'/'main') are not allowed; provide an explicit tag like v0.32.0." >&2
exit 1
fi
if ! echo "${VERSION}" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "Version '${VERSION}' does not match required pattern MAJOR.MINOR.PATCH." >&2
exit 1
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Download ocm-cli (Linux amd64)
shell: bash
run: |
set -euo pipefail
VERSION=${{ steps.validate.outputs.version }}
VERSION_NO_V="${VERSION#v}"
INSTALL_PATH=${{ inputs.install_path }}
mkdir -p "${INSTALL_PATH}"

ARCHIVE="ocm-${VERSION_NO_V}-linux-amd64.tar.gz"
BINARY_URL="https://github.com/open-component-model/ocm/releases/download/v${VERSION}/${ARCHIVE}"
SHA_URL="${BINARY_URL}.sha256"

echo "Downloading ${ARCHIVE}"
curl -sSfL "${BINARY_URL}" -o "/tmp/${ARCHIVE}"

if [ "${{ inputs.verify_checksum }}" = "true" ]; then
echo "Verifying checksum"
curl -sSfL "${SHA_URL}" -o "/tmp/${ARCHIVE}.sha256"
EXPECTED_SHA="$(cat /tmp/${ARCHIVE}.sha256 | tr -d '\n\r')"
echo "${EXPECTED_SHA} /tmp/${ARCHIVE}" | sha256sum -c -
else
echo "Checksum verification skipped"
fi

tar -xzf "/tmp/${ARCHIVE}" -C "${INSTALL_PATH}"
if [ ! -x "${INSTALL_PATH}/ocm" ]; then
echo "ocm binary not found after extraction" >&2
exit 1
fi
echo "${INSTALL_PATH}" >> "$GITHUB_PATH"
- name: Test ocm installation
shell: bash
run: |
set -euo pipefail
INSTALLED_VERSION="$(ocm version | yq -p json -oy '.GitVersion')"
echo "OCM CLI version: ${INSTALLED_VERSION}"
ocm help >/dev/null
5 changes: 5 additions & 0 deletions .github/actions/setup-tools/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ inputs:
k3d_version:
description: The version of k3d to install. For example, 5.6.0.
required: true
ocm_cli_version:
description: The version of ocm-cli to install. For example, 0.32.0.
modulectl_version:
description: The version of modulectl to install. For example, 1.0.0.
required: true
Expand All @@ -28,6 +30,9 @@ runs:
- uses: ./lifecycle-manager/.github/actions/install-istioctl
with:
istio_version: ${{ inputs.istio_version }}
- uses: ./lifecycle-manager/.github/actions/install-ocm-cli
with:
ocm_cli_version: ${{ inputs.ocm_cli_version }}
- uses: ./lifecycle-manager/.github/actions/install-modulectl
with:
modulectl_version: ${{ inputs.modulectl_version }}
Expand Down
Loading
Loading