Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -22,6 +22,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 Down
4 changes: 4 additions & 0 deletions .github/actions/get-configuration/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ 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 }}
Expand Down Expand Up @@ -42,6 +45,7 @@ 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 "cert_manager_version=$(yq e '.certManager' versions.yaml)" >> $GITHUB_OUTPUT
echo "gardener_cert_manager_version=$(yq e '.gardenerCertManager' 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
1 change: 1 addition & 0 deletions .github/workflows/test-e2e-with-gcm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
k8s_version: ${{ steps.configuration.outputs.k8s_version }}
istio_version: ${{ steps.configuration.outputs.istio_version }}
k3d_version: ${{ steps.configuration.outputs.k3d_version }}
ocm_cli_version: ${{ steps.configuration.outputs.ocm_cli_version }}
modulectl_version: ${{ steps.configuration.outputs.modulectl_version }}
go-version-file: lifecycle-manager/go.mod
cache-dependency-path: lifecycle-manager/go.sum
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ jobs:
k8s_version: ${{ steps.configuration.outputs.k8s_version }}
istio_version: ${{ steps.configuration.outputs.istio_version }}
k3d_version: ${{ steps.configuration.outputs.k3d_version }}
ocm_cli_version: ${{ steps.configuration.outputs.ocm_cli_version }}
modulectl_version: ${{ steps.configuration.outputs.modulectl_version }}
go-version-file: lifecycle-manager/go.mod
cache-dependency-path: lifecycle-manager/go.sum
Expand Down
12 changes: 12 additions & 0 deletions scripts/tests/deploy_moduletemplate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ yq eval '.bdba += ["europe-docker.pkg.dev/kyma-project/prod/template-operator:'"
cat module-config-for-e2e.yaml
modulectl create --config-file ./module-config-for-e2e.yaml --registry http://localhost:5111 --insecure

# Configure OCM to use insecure HTTP for local registry
OCM_CONFIG="$(dirname "$0")/ocm-config-local-registry.yaml"
REGISTRY_URL="localhost:5111"

echo "[DEBUG] List Component Versions from local registry:"
echo ocm --config "${OCM_CONFIG}" get componentversions "http://${REGISTRY_URL}//kyma-project.io/module/template-operator"
ocm --config "${OCM_CONFIG}" get componentversions "http://${REGISTRY_URL}//kyma-project.io/module/template-operator"

echo "[DEBUG] Get ComponentDescriptor from local registry:"
echo ocm --config "${OCM_CONFIG}" get componentversion "http://${REGISTRY_URL}//kyma-project.io/module/template-operator:${RELEASE_VERSION}" -o yaml
ocm --config "${OCM_CONFIG}" get componentversion "http://${REGISTRY_URL}//kyma-project.io/module/template-operator:${RELEASE_VERSION}" -o yaml

cat template.yaml
echo "ModuleTemplate created successfully"

Expand Down
12 changes: 12 additions & 0 deletions scripts/tests/ocm-config-local-registry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
type: generic.config.ocm.software/v1
configurations:
- type: ocm.config.ocm.software
aliases:
localhost:5111:
type: OCIRegistry
baseUrl: http://localhost:5111
- type: oci.config.ocm.software
aliases:
localhost:5111:
type: OCIRegistry
baseUrl: http://localhost:5111
23 changes: 23 additions & 0 deletions scripts/tests/ocm-config-private-registry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
type: generic.config.ocm.software/v1
configurations:
- type: ocm.config.ocm.software
aliases:
k3d-private-oci-reg.localhost:5001:
type: OCIRegistry
baseUrl: http://k3d-private-oci-reg.localhost:5001
- type: oci.config.ocm.software
aliases:
k3d-private-oci-reg.localhost:5001:
type: OCIRegistry
baseUrl: http://k3d-private-oci-reg.localhost:5001
- type: credentials.config.ocm.software
consumers:
- identity:
type: OCIRegistry
hostname: k3d-private-oci-reg.localhost
port: "5001"
credentials:
- type: Credentials
properties:
username: myuser
password: mypass
2 changes: 2 additions & 0 deletions versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ envtest_k8s: "1.32.0" # kubernetes version used in integration tests
kubectl: "1.31.3"
kustomize: "5.4.3"
modulectl: "1.2.2"
ocm-cli: "0.32.0"
template-operator: "1.0.4"
yq: "4.45.1"
envtest: "0.21"
Loading