Skip to content

Commit 4a2dea2

Browse files
authored
feat(cluster-api): add the Proxmox infrastructure provider and in-cluster IPAM as optional packages (#4087)
## What this PR does **Series behind #3481** — three separable pull requests: 1. **#4087 — Cluster API providers** (capmox + in-cluster IPAM) 2. #4088 — the `substrate` switch in `kubernetes` and `kubernetes-nodes` 3. #4089 — the Proxmox CSI driver and cloud-controller-manager #4087 and #4088 share no files and can be reviewed in parallel. #4089 builds on #4088. --- This is the provisioning layer #3481 asks to specify first: the part that creates the VMs. Neither of the other two is needed to review it. ### What it adds Two Cluster API providers, packaged the way the existing KubeVirt provider is — vendored components, `gzip -9 -n` for a reproducible artifact, a `make components` target that regenerates it from the upstream release and checks the downloads against the SHA-256 sums the Makefile pins: | Package | Version | Contract | |---|---|---| | `capi-providers-infraprovider-proxmox` | capmox v0.7.7 | v1beta1 | | `capi-providers-ipam-in-cluster` | CAIP v1.0.3 | v1beta1 | capmox v0.7.7 rather than the current v0.9.x on purpose: from v0.8 it declares contract `v1beta2`, which the CAPI core shipped here (v1.10.1) does not serve. Both join the `iaas` bundle as **opt-in** packages, where the KubeVirt infrastructure provider is unconditional. The asymmetry is deliberate: capmox drives a hypervisor outside the cluster and needs a Secret holding a Proxmox API token, which capi-operator reads before it installs anything — with no Secret the provider is never deployed at all. Enabling it by default would ask every Cozystack install that has no Proxmox to supply hypervisor credentials. ```yaml bundles: enabledPackages: - cozystack.capi-provider-infra-proxmox # brings IPAM with it - cozystack.capi-provider-ipam-in-cluster # also enableable on its own ``` Enabling capmox emits the IPAM provider automatically — capmox allocates worker addresses from an `InClusterIPPool` and has no DHCP mode, so on its own it never gets a `ProxmoxCluster` to `Ready`. IPAM stays independently enableable, since assigning addresses is a generic Cluster API concern. Naming capmox in `enabledPackages` while disabling IPAM stops the render. The cluster would catch that combination on its own — the capmox `PackageSource` depends on the IPAM `Package`, so with that `Package` absent capmox goes `Ready=False` with `DependenciesNotReady` and no `HelmRelease` is created — but it would not say why. Failing the render names the two conflicting list entries at the moment someone writes them, instead of leaving a condition to decode. ### Why the earlier attempt did not produce a VM #1927's blocker — "ProxmoxMachine does not produce a VM" — was not a capmox incompatibility. It was four independent causes, each of which only became visible once the previous one was cleared: 1. **`PROXMOX_URL` included `/api2/json`.** capmox appends that itself, so every call went to `/api2/json/api2/json/…` and returned 501. 2. **No IPAM provider.** `no matches for kind "InClusterIPPool"`; the `ProxmoxCluster` never reached `Ready` and every `ProxmoxMachine` sat in `WaitingForClusterInfrastructure`. 3. **`templateSelector.matchTags` is set equality, not containment** (`slices.Equal` after sort). A template carrying four tags is not selected by naming one of them: `found 0 VM templates with tags`. 4. **capmox waits for the qemu-guest-agent, which Talos does not ship.** `error waiting for agent: timed out` — cleared with `checks.skipQemuGuestAgent` and `skipCloudInitStatus`. None of these are in the provider. They are packaging and configuration, which is why the earlier work could look complete and still never boot a machine. ### Evidence Run on Proxmox VE 9.2.11 with Talos v1.13.6 and Cozystack's CAPI stack (core v1.10.1, CABPT v0.6.12, Kamaji control-plane provider v0.19.0): ``` $ kubectl get proxmoxmachine,machine -n tenant-proxmox proxmoxmachine/kubernetes-px-md0-… Ready=True VMProvisioned=True machine/kubernetes-px-md0-… Running proxmox://0ef88cc1-6aea-4563-af64-344d8060d5c0 $ qm list 106 kubernetes-px-md0-jmzds-h9npx running ``` The machine boots Talos from the nocloud ISO, reads the machineconfig capmox writes, and joins. That is the layer #69 called a hard blocker. ### What this PR does not claim - One Proxmox node, one tenant cluster, manual runs — there is no e2e coverage for Proxmox in CI, and this PR does not add any. - It does not make Proxmox a supported platform. It makes the provisioning layer reviewable, which #3481 names as the precondition for that conversation. - It does not touch `capi-providers-core`. The same drift check, pointed at that package, shows that the `startupProbe` from #2946 never reached the shipped blob; that fix changes what every new install runs and is #4483, with its own release note. - Nothing here exposes `ProxmoxCluster.spec.credentialsRef` to a tenant, and nothing should: `capmox-manager-role` grants get/list/watch/patch on Secrets cluster-wide and that field takes a namespace. Whatever renders a `ProxmoxCluster` for a tenant in the rest of the series has to keep the field out of tenant hands. ### Testing `make unit-tests` — exit 0. New suites: `packages/core/platform/tests/sources_capi_provider_proxmox_test.yaml` and `bundles_proxmox_wiring_test.yaml` (both bundle paths, the enable/disable precedence, and the refusal above). Every negated `containsDocument` in the wiring suite carries `any: true`; without it the negation passes whether or not the document is in the render. Three mutations, each reverted afterwards — emitting the capmox `Package` unconditionally, emitting the IPAM `Package` unconditionally, and dropping the `disabledPackages` check from `$proxmoxEnabled` — each turn red the tests named after the property they break, and the unmutated chart stays green (44 suites, 198 tests). `hack/capi-provider-components_test.bats` covers both new provider packages: the blob and the YAML are the same bytes; the Makefile version, the ConfigMap name and `spec.version` are one value — `applied-spec-hash` covers the provider spec and the config Secret but not the ConfigMap, so a bump that regenerates the files while `spec.version` stays behind installs the old provider silently; and the vendored files match the SHA-256 sums the Makefile pins, so the pin holds even when nobody runs `make components`. The render was compared against `main` for five configurations (defaults, `isp-full`, `isp-full-generic` with paas, an unrelated `enabledPackages`, and `disabledPackages` naming IPAM). No line is removed in any of them and the `Package` count is unchanged; the only additions are the two `PackageSource` objects, which the chart renders for every package, optional or not. ### Screenshots Not applicable — no UI change. ### Downstream repositories I walked the trigger map in `docs/agents/contributing.md` against this diff, file by file. What it matches is below. **No box is ticked**, because every follow-up it points at depends on a decision that is not mine to make: #3481 asks whether Proxmox becomes a supported platform at all, and writing its documentation or its Terraform schema before that is answered would be work built on an assumption. I have not filed speculative PRs or issues in those repositories for the same reason. If the direction is accepted, I open them; a human should decide which. **cozystack/website — matches, no follow-up yet.** - `packages/core/platform/values.yaml` changed. `content/en/docs/next/operations/configuration/platform-package.md` is a hand-written table of the `spec.components.platform.values.*` keys; this PR does not add a key, but it documents two new values that `bundles.enabledPackages` now accepts, and the table is where a reader would look for them. - Two platform components are added (`capi-providers-infraprovider-proxmox`, `capi-providers-ipam-in-cluster`) → `guides/platform-stack/_index.md`, `operations/configuration/licenses.md`. - The `iaas` bundle gains two optional packages → `operations/configuration/variants.md`. **Everything else: no match.** Nothing under `packages/apps/` or `packages/extra/` (terraform-provider, website app lists), no `packages/core/installer/values.yaml` or `networking.*`/`publishing.*` key the Ansible role sets, no `hack/` file or package-layout change (ccp, external-apps-example), no `ApplicationDefinition` semantics, no telemetry metric, no node prerequisites (talm, ansible), no commit-convention change (community). - [ ] No downstream repository is affected by this change - [ ] [cozystack/website](https://github.com/cozystack/website) - follow-up: - [ ] [cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack) - follow-up: - [ ] [cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack) - follow-up: - [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up: - [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up: - [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) - follow-up: - [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) - follow-up: - [ ] [cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server) - follow-up: - [ ] [cozystack/external-apps-example](https://github.com/cozystack/external-apps-example) - follow-up: - [ ] [cozystack/examples](https://github.com/cozystack/examples) - follow-up: - [ ] [cozystack/community](https://github.com/cozystack/community) - follow-up: ### Release note ```release-note feat(cluster-api): add optional Cluster API packages for Proxmox — the capmox infrastructure provider and the in-cluster IPAM provider it requires. Neither is deployed unless named in `bundles.enabledPackages`, since capmox drives a hypervisor outside the cluster and does nothing without Proxmox API credentials. Enabling the Proxmox provider brings the IPAM provider with it. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added optional Proxmox infrastructure provider support for IaaS clusters. - Added in-cluster IP address management, usable independently or alongside Proxmox. - Proxmox deployments require a pre-created credentials Secret and automatically include in-cluster IPAM. - Added validation for incompatible Proxmox and IPAM settings. - **Tests** - Added coverage for provider dependencies, package enablement, disabling behavior, invalid configurations, and packaged provider components. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents e883f6f + 7843ec9 commit 4a2dea2

24 files changed

Lines changed: 5710 additions & 0 deletions
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
#!/usr/bin/env bats
2+
# The vendored CAPI provider packages ship the provider manifests twice: as the
3+
# readable YAML a reviewer reads, and as the gzip blob the chart actually mounts
4+
# into the cluster. `make components` writes both from one download, so they
5+
# agree at the moment of vendoring and nothing keeps them in step afterwards.
6+
#
7+
# An edit to the YAML alone is silent in every way that matters. The diff looks
8+
# right, review passes on it, and the cluster runs whatever the blob held —
9+
# which is the version nobody read. This asserts the two are the same bytes.
10+
#
11+
# The comparison is on the decompressed bytes, so the gzip header plays no part
12+
# in it. `make components` still passes -n, for a different reason: without it
13+
# the header carries a timestamp and every regeneration rewrites the committed
14+
# blob even when the input has not changed.
15+
16+
REPO_ROOT="$(cd "$(dirname "${BATS_TEST_FILENAME:-$0}")/.." && pwd)"
17+
18+
check_pair() {
19+
local pkg="$1" yaml="$2"
20+
local dir="$REPO_ROOT/packages/system/$pkg/files"
21+
22+
[ -f "$dir/$yaml" ] || { echo "missing $pkg/files/$yaml" >&2; return 1; }
23+
[ -f "$dir/components.gz" ] || { echo "missing $pkg/files/components.gz" >&2; return 1; }
24+
25+
local work; work="$(mktemp -d)"
26+
gzip -dc "$dir/components.gz" > "$work/decompressed.yaml"
27+
28+
if ! cmp -s "$work/decompressed.yaml" "$dir/$yaml"; then
29+
echo "$pkg: components.gz does not match $yaml" >&2
30+
echo "the chart mounts the blob, so the cluster would run what the YAML does not say" >&2
31+
if grep -q '^components:' "$REPO_ROOT/packages/system/$pkg/Makefile" 2>/dev/null; then
32+
echo "run: make -C packages/system/$pkg components" >&2
33+
else
34+
echo "regenerate: gzip -9 -n -c files/$yaml > files/components.gz" >&2
35+
fi
36+
head -40 "$work/decompressed.yaml" > "$work/a"
37+
head -40 "$dir/$yaml" > "$work/b"
38+
diff "$work/a" "$work/b" | head -20 >&2 || true
39+
rm -rf "$work"
40+
return 1
41+
fi
42+
rm -rf "$work"
43+
}
44+
45+
@test "capmox components.gz matches the vendored infrastructure-components.yaml" {
46+
check_pair capi-providers-infraprovider-proxmox infrastructure-components.yaml
47+
}
48+
49+
@test "in-cluster IPAM components.gz matches the vendored ipam-components.yaml" {
50+
check_pair capi-providers-ipam-in-cluster ipam-components.yaml
51+
}
52+
53+
# A version bump can land in git and never reach a cluster. capi-operator hashes
54+
# the provider spec and the config Secret into applied-spec-hash, and the
55+
# ConfigMap is in neither: bumping the Makefile and running `make components`
56+
# while spec.version and the ConfigMap name stay behind produces a release that
57+
# installs the old provider and reports the old version, with no error anywhere.
58+
# The three have to be one value, so this asserts they are.
59+
check_version() {
60+
local pkg="$1" makefile_var="$2"
61+
local dir="$REPO_ROOT/packages/system/$pkg"
62+
63+
local version
64+
version="$(sed -n "s/^${makefile_var}=//p" "$dir/Makefile")"
65+
[ -n "$version" ] || { echo "$pkg: no $makefile_var in Makefile" >&2; return 1; }
66+
67+
local cm_name provider_version
68+
cm_name="$(sed -n 's/^ name: //p' "$dir/templates/configmaps.yaml")"
69+
provider_version="$(sed -n 's/^ version: //p' "$dir/templates/providers.yaml")"
70+
71+
if [ "$cm_name" != "$provider_version" ]; then
72+
echo "$pkg: ConfigMap name '$cm_name' and spec.version '$provider_version' differ" >&2
73+
echo "fetchConfig would find no ConfigMap for the version the operator installs" >&2
74+
return 1
75+
fi
76+
77+
case "$cm_name" in
78+
"$version"-*) ;;
79+
*)
80+
echo "$pkg: Makefile has $makefile_var=$version, the chart installs '$cm_name'" >&2
81+
echo "the vendored files were regenerated without moving the version the operator reads" >&2
82+
return 1
83+
;;
84+
esac
85+
}
86+
87+
@test "capmox ships the version its Makefile vendored" {
88+
check_version capi-providers-infraprovider-proxmox CAPMOX_VERSION
89+
}
90+
91+
@test "in-cluster IPAM ships the version its Makefile vendored" {
92+
check_version capi-providers-ipam-in-cluster CAIP_VERSION
93+
}
94+
95+
# The Makefile pins the SHA-256 of both release assets and `make components`
96+
# checks its downloads against them. The pin is only as good as the files it
97+
# describes, so the vendored copies are checked against it here as well: a
98+
# vendored file edited by hand, or a sum bumped without the file, both show up
99+
# without anyone running the refresh target.
100+
check_sums() {
101+
local pkg="$1" makefile_var="$2" yaml="$3"
102+
local dir="$REPO_ROOT/packages/system/$pkg"
103+
104+
local sum_components sum_metadata
105+
sum_components="$(sed -n "s/^${makefile_var}_SHA256_COMPONENTS=//p" "$dir/Makefile")"
106+
sum_metadata="$(sed -n "s/^${makefile_var}_SHA256_METADATA=//p" "$dir/Makefile")"
107+
[ -n "$sum_components" ] && [ -n "$sum_metadata" ] \
108+
|| { echo "$pkg: Makefile pins no ${makefile_var}_SHA256_* sums" >&2; return 1; }
109+
110+
if ! printf '%s %s\n%s %s\n' "$sum_components" "$dir/files/$yaml" "$sum_metadata" "$dir/files/metadata.yaml" \
111+
| sha256sum -c - >/dev/null 2>&1; then
112+
echo "$pkg: a vendored file does not match the sum its Makefile pins" >&2
113+
echo "either the file was edited without a refresh, or the sum moved without the file" >&2
114+
return 1
115+
fi
116+
}
117+
118+
@test "capmox vendored files match the sums its Makefile pins" {
119+
check_sums capi-providers-infraprovider-proxmox CAPMOX infrastructure-components.yaml
120+
}
121+
122+
@test "in-cluster IPAM vendored files match the sums its Makefile pins" {
123+
check_sums capi-providers-ipam-in-cluster CAIP ipam-components.yaml
124+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
apiVersion: cozystack.io/v1alpha1
3+
kind: PackageSource
4+
metadata:
5+
name: cozystack.capi-provider-infra-proxmox
6+
spec:
7+
sourceRef:
8+
kind: OCIRepository
9+
name: cozystack-packages
10+
namespace: cozy-system
11+
path: /
12+
variants:
13+
# The kubevirt infra provider depends on cozystack.kubevirt because its VMs run
14+
# inside this cluster. The proxmox one has no such edge: the hypervisor is
15+
# external, reached over the Proxmox API with the credentials in the package's
16+
# credentialsSecretName. What it does need is the IPAM provider — capmox
17+
# allocates static addresses from an InClusterIPPool rather than using DHCP,
18+
# so without it ProxmoxCluster never reaches Ready.
19+
- name: default
20+
dependsOn:
21+
- cozystack.networking
22+
- cozystack.capi-operator
23+
- cozystack.capi-provider-ipam-in-cluster
24+
components:
25+
- name: capi-providers-infraprovider-proxmox
26+
path: system/capi-providers-infraprovider-proxmox
27+
install:
28+
privileged: true
29+
namespace: cozy-cluster-api
30+
releaseName: capi-providers-infraprovider-proxmox
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
apiVersion: cozystack.io/v1alpha1
3+
kind: PackageSource
4+
metadata:
5+
name: cozystack.capi-provider-ipam-in-cluster
6+
spec:
7+
sourceRef:
8+
kind: OCIRepository
9+
name: cozystack-packages
10+
namespace: cozy-system
11+
path: /
12+
variants:
13+
# No infrastructure edge here on purpose: an IPAM provider is a generic Cluster
14+
# API addon, and the only current consumer declares the dependency on its own
15+
# side, so this variant stays reusable by any provider that assigns addresses
16+
# instead of leasing them.
17+
- name: default
18+
dependsOn:
19+
- cozystack.networking
20+
- cozystack.capi-operator
21+
components:
22+
- name: capi-providers-ipam-in-cluster
23+
path: system/capi-providers-ipam-in-cluster
24+
install:
25+
privileged: true
26+
namespace: cozy-cluster-api
27+
releaseName: capi-providers-ipam-in-cluster

‎packages/core/platform/templates/bundles/iaas.yaml‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,44 @@
218218
{{include "cozystack.platform.package.default" (list "cozystack.capi-provider-core" $) }}
219219
{{include "cozystack.platform.package.default" (list "cozystack.capi-provider-cp-kamaji" $) }}
220220
{{include "cozystack.platform.package.default" (list "cozystack.capi-provider-infra-kubevirt" $) }}
221+
{{- /*
222+
The Proxmox infrastructure provider is opt-in where the KubeVirt one is not,
223+
and the asymmetry is not a matter of taste. capmox talks to a hypervisor that
224+
lives outside this cluster, and it needs a capmox-config Secret holding a
225+
Proxmox API token: capi-operator reads that Secret before it installs
226+
anything, so with no Secret the provider is never deployed at all. Enabling
227+
this by default would ask every Cozystack install that has no Proxmox to
228+
supply hypervisor credentials.
229+
230+
Enable it by adding cozystack.capi-provider-infra-proxmox to
231+
bundles.enabledPackages. The in-cluster IPAM provider comes with it, for the
232+
reason written next to the dependsOn edge in
233+
sources/capi-provider-infra-proxmox.yaml. IPAM is also independently
234+
enableable — it is a generic Cluster API addon, useful to any provider that
235+
assigns rather than leases.
236+
*/ -}}
237+
{{- $proxmoxName := "cozystack.capi-provider-infra-proxmox" -}}
238+
{{- $ipamName := "cozystack.capi-provider-ipam-in-cluster" -}}
239+
{{- $pkgDisabled := default (list) .Values.bundles.disabledPackages -}}
240+
{{- $pkgEnabled := default (list) .Values.bundles.enabledPackages -}}
241+
{{- $proxmoxEnabled := and (has $proxmoxName $pkgEnabled) (not (has $proxmoxName $pkgDisabled)) -}}
242+
{{- /*
243+
Naming the pair in conflicting lists is the one case worth stopping for. The
244+
cluster catches it on its own: the capmox PackageSource depends on the IPAM
245+
Package, so with that Package absent the capmox one goes Ready=False with
246+
DependenciesNotReady and no HelmRelease is created. What it does not do is
247+
say why. Failing the render names the two list entries that conflict, at the
248+
moment someone writes them, instead of leaving a condition to decode later.
249+
*/ -}}
250+
{{- if and $proxmoxEnabled (has $ipamName $pkgDisabled) -}}
251+
{{- fail (printf "%s requires %s, which is listed in bundles.disabledPackages: capmox allocates worker addresses from an InClusterIPPool and has no DHCP mode, so without the IPAM provider no ProxmoxCluster ever becomes Ready" $proxmoxName $ipamName) -}}
252+
{{- end -}}
253+
{{- if or $proxmoxEnabled (has $ipamName $pkgEnabled) }}
254+
{{include "cozystack.platform.package.default" (list $ipamName $) }}
255+
{{- end }}
256+
{{- if $proxmoxEnabled }}
257+
{{include "cozystack.platform.package.default" (list $proxmoxName $) }}
258+
{{- end }}
221259
{{include "cozystack.platform.package" (list "cozystack.kubernetes-application" "kubevirt" $) }}
222260
{{include "cozystack.platform.package" (list "cozystack.kubernetes-nodes-application" "kubevirt" $) }}
223261
{{include "cozystack.platform.package" (list "cozystack.computeplane-application" "kubevirt" $) }}
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
suite: bundles.iaas proxmox substrate wiring
2+
# capmox is opt-in where the KubeVirt infra provider is not: it drives a
3+
# hypervisor outside this cluster and does nothing without a Proxmox API token.
4+
# What is pinned here is that opting in is enough — the IPAM provider it cannot
5+
# work without comes along — and that opting in halfway stops the render instead
6+
# of parking a Package at Ready=False with DependenciesNotReady and no message
7+
# naming the two list entries that conflict.
8+
templates:
9+
- templates/bundles/iaas.yaml
10+
release:
11+
name: cozystack
12+
namespace: cozy-system
13+
tests:
14+
- it: ships neither package by default
15+
set:
16+
bundles:
17+
system:
18+
enabled: true
19+
variant: isp-full
20+
iaas:
21+
enabled: true
22+
enabledPackages: []
23+
asserts:
24+
- containsDocument:
25+
apiVersion: cozystack.io/v1alpha1
26+
kind: Package
27+
name: cozystack.capi-provider-infra-proxmox
28+
any: true
29+
not: true
30+
- containsDocument:
31+
apiVersion: cozystack.io/v1alpha1
32+
kind: Package
33+
name: cozystack.capi-provider-ipam-in-cluster
34+
any: true
35+
not: true
36+
# The KubeVirt provider stays unconditional — this wiring must not have
37+
# made the default substrate opt-in by accident.
38+
- containsDocument:
39+
apiVersion: cozystack.io/v1alpha1
40+
kind: Package
41+
name: cozystack.capi-provider-infra-kubevirt
42+
any: true
43+
44+
- it: pulls in the IPAM provider when capmox is enabled
45+
set:
46+
bundles:
47+
system:
48+
enabled: true
49+
variant: isp-full
50+
iaas:
51+
enabled: true
52+
enabledPackages:
53+
- cozystack.capi-provider-infra-proxmox
54+
asserts:
55+
- containsDocument:
56+
apiVersion: cozystack.io/v1alpha1
57+
kind: Package
58+
name: cozystack.capi-provider-infra-proxmox
59+
any: true
60+
- containsDocument:
61+
apiVersion: cozystack.io/v1alpha1
62+
kind: Package
63+
name: cozystack.capi-provider-ipam-in-cluster
64+
any: true
65+
66+
- it: emits the IPAM provider on its own, without dragging capmox in
67+
set:
68+
bundles:
69+
system:
70+
enabled: true
71+
variant: isp-full
72+
iaas:
73+
enabled: true
74+
enabledPackages:
75+
- cozystack.capi-provider-ipam-in-cluster
76+
asserts:
77+
- containsDocument:
78+
apiVersion: cozystack.io/v1alpha1
79+
kind: Package
80+
name: cozystack.capi-provider-ipam-in-cluster
81+
any: true
82+
- containsDocument:
83+
apiVersion: cozystack.io/v1alpha1
84+
kind: Package
85+
name: cozystack.capi-provider-infra-proxmox
86+
any: true
87+
not: true
88+
89+
- it: emits neither when capmox is enabled and disabled at once
90+
set:
91+
bundles:
92+
system:
93+
enabled: true
94+
variant: isp-full
95+
iaas:
96+
enabled: true
97+
enabledPackages:
98+
- cozystack.capi-provider-infra-proxmox
99+
disabledPackages:
100+
- cozystack.capi-provider-infra-proxmox
101+
asserts:
102+
- containsDocument:
103+
apiVersion: cozystack.io/v1alpha1
104+
kind: Package
105+
name: cozystack.capi-provider-infra-proxmox
106+
any: true
107+
not: true
108+
- containsDocument:
109+
apiVersion: cozystack.io/v1alpha1
110+
kind: Package
111+
name: cozystack.capi-provider-ipam-in-cluster
112+
any: true
113+
not: true
114+
115+
- it: refuses to ship capmox with its IPAM provider disabled
116+
set:
117+
bundles:
118+
system:
119+
enabled: true
120+
variant: isp-full
121+
iaas:
122+
enabled: true
123+
enabledPackages:
124+
- cozystack.capi-provider-infra-proxmox
125+
disabledPackages:
126+
- cozystack.capi-provider-ipam-in-cluster
127+
asserts:
128+
- failedTemplate:
129+
errorMessage: "cozystack.capi-provider-infra-proxmox requires cozystack.capi-provider-ipam-in-cluster, which is listed in bundles.disabledPackages: capmox allocates worker addresses from an InClusterIPPool and has no DHCP mode, so without the IPAM provider no ProxmoxCluster ever becomes Ready"

0 commit comments

Comments
 (0)