|
| 1 | +suite: isp-hosted emits the dependency closure its app catalog needs |
| 2 | +templates: |
| 3 | + - templates/bundles/system.yaml |
| 4 | +release: |
| 5 | + name: cozystack |
| 6 | + namespace: cozy-system |
| 7 | +tests: |
| 8 | + # The isp-hosted preset drops the data-plane head (the host provides CNI, |
| 9 | + # storage and virtualisation) but MUST still emit the system bundle's |
| 10 | + # variant-agnostic control-plane body. Shipping bundles.system.enabled: false |
| 11 | + # while paas/naas stayed on rendered an app catalog whose entire dependency |
| 12 | + # closure was absent: all 24 Packages sat in DependenciesNotReady forever and |
| 13 | + # the cozystack-platform HelmRelease never went Ready. Each package below is a |
| 14 | + # dependsOn edge of a paas/naas application PackageSource, so losing any one of |
| 15 | + # them reproduces that wedge. |
| 16 | + - it: emits every package the paas/naas catalog depends on |
| 17 | + set: |
| 18 | + bundles: |
| 19 | + system: |
| 20 | + enabled: true |
| 21 | + variant: isp-hosted |
| 22 | + iaas: |
| 23 | + enabled: false |
| 24 | + paas: |
| 25 | + enabled: true |
| 26 | + naas: |
| 27 | + enabled: true |
| 28 | + asserts: |
| 29 | + # Sole source of the application-definition-crd component, i.e. the |
| 30 | + # ApplicationDefinition CRD every *-rd component renders against. Without |
| 31 | + # it the *-rd HelmReleases fail with `no matches for kind |
| 32 | + # "ApplicationDefinition" in version "cozystack.io/v1alpha1"`. |
| 33 | + - containsDocument: |
| 34 | + apiVersion: cozystack.io/v1alpha1 |
| 35 | + kind: Package |
| 36 | + name: cozystack.cozystack-engine |
| 37 | + any: true |
| 38 | + # The noop networking Package for this variant. 23 of the catalog's |
| 39 | + # PackageSources declare dependsOn: cozystack.networking. |
| 40 | + - containsDocument: |
| 41 | + apiVersion: cozystack.io/v1alpha1 |
| 42 | + kind: Package |
| 43 | + name: cozystack.networking |
| 44 | + any: true |
| 45 | + - containsDocument: |
| 46 | + apiVersion: cozystack.io/v1alpha1 |
| 47 | + kind: Package |
| 48 | + name: cozystack.cert-manager |
| 49 | + any: true |
| 50 | + - containsDocument: |
| 51 | + apiVersion: cozystack.io/v1alpha1 |
| 52 | + kind: Package |
| 53 | + name: cozystack.prometheus-operator-crds |
| 54 | + any: true |
| 55 | + - containsDocument: |
| 56 | + apiVersion: cozystack.io/v1alpha1 |
| 57 | + kind: Package |
| 58 | + name: cozystack.postgres-operator |
| 59 | + any: true |
| 60 | + - containsDocument: |
| 61 | + apiVersion: cozystack.io/v1alpha1 |
| 62 | + kind: Package |
| 63 | + name: cozystack.objectstorage-controller |
| 64 | + any: true |
| 65 | + |
| 66 | + # bucket-application lives in the system bundle rather than iaas: its own |
| 67 | + # dependsOn closure is networking + objectstorage-controller + cozystack-engine |
| 68 | + # and nothing in it needs KubeVirt or CAPI, while cozystack.backupstrategy-controller |
| 69 | + # — a default package of the system bundle — hard-depends on it. Keeping it in |
| 70 | + # iaas left every system-on/iaas-off configuration with a permanently |
| 71 | + # DependenciesNotReady backupstrategy-controller. |
| 72 | + - it: emits bucket-application from the system bundle even when iaas is disabled |
| 73 | + set: |
| 74 | + bundles: |
| 75 | + system: |
| 76 | + enabled: true |
| 77 | + variant: isp-hosted |
| 78 | + iaas: |
| 79 | + enabled: false |
| 80 | + asserts: |
| 81 | + - containsDocument: |
| 82 | + apiVersion: cozystack.io/v1alpha1 |
| 83 | + kind: Package |
| 84 | + name: cozystack.bucket-application |
| 85 | + any: true |
| 86 | + - containsDocument: |
| 87 | + apiVersion: cozystack.io/v1alpha1 |
| 88 | + kind: Package |
| 89 | + name: cozystack.backupstrategy-controller |
| 90 | + any: true |
| 91 | + |
| 92 | + # The tests above drive the templates through `set:`, so they pin the template |
| 93 | + # logic but would not notice values-isp-hosted.yaml itself regressing. Load the |
| 94 | + # shipped preset unmodified — this is the assertion that actually fails if |
| 95 | + # bundles.system.enabled goes back to false, which is how the wedge shipped. |
| 96 | + - it: ships the isp-hosted preset with the system bundle enabled |
| 97 | + values: |
| 98 | + - ../values-isp-hosted.yaml |
| 99 | + asserts: |
| 100 | + - containsDocument: |
| 101 | + apiVersion: cozystack.io/v1alpha1 |
| 102 | + kind: Package |
| 103 | + name: cozystack.cozystack-engine |
| 104 | + any: true |
| 105 | + - containsDocument: |
| 106 | + apiVersion: cozystack.io/v1alpha1 |
| 107 | + kind: Package |
| 108 | + name: cozystack.networking |
| 109 | + any: true |
| 110 | + - containsDocument: |
| 111 | + apiVersion: cozystack.io/v1alpha1 |
| 112 | + kind: Package |
| 113 | + name: cozystack.bucket-application |
| 114 | + any: true |
| 115 | + |
| 116 | + # The hosted variant must not drag in the data-plane it exists to exclude. |
| 117 | + # |
| 118 | + # `any: true` is load-bearing on a negated containsDocument. Without it the |
| 119 | + # assertion negates "EVERY rendered document matches", which any multi-document |
| 120 | + # render satisfies trivially — the case then passes even with cozystack.linstor |
| 121 | + # emitted into the hosted branch. With `any: true` it negates "SOME document |
| 122 | + # matches", which is the intended meaning. |
| 123 | + - it: does not emit data-plane packages on the hosted variant |
| 124 | + set: |
| 125 | + bundles: |
| 126 | + system: |
| 127 | + enabled: true |
| 128 | + variant: isp-hosted |
| 129 | + iaas: |
| 130 | + enabled: false |
| 131 | + asserts: |
| 132 | + - containsDocument: |
| 133 | + apiVersion: cozystack.io/v1alpha1 |
| 134 | + kind: Package |
| 135 | + name: cozystack.linstor |
| 136 | + any: true |
| 137 | + not: true |
| 138 | + # securitygroup-controller is emitted from the common-packages helper, which |
| 139 | + # only the isp-full branches call — it watches cilium.io CRDs that the noop |
| 140 | + # networking variant never installs. Emitted on isp-full, absent here. |
| 141 | + - containsDocument: |
| 142 | + apiVersion: cozystack.io/v1alpha1 |
| 143 | + kind: Package |
| 144 | + name: cozystack.securitygroup-controller |
| 145 | + any: true |
| 146 | + not: true |
0 commit comments