Skip to content

Commit f89e4ac

Browse files
committed
feat(operator): register slim platform variants
Add isp-slim, isp-slim-generic and isp-hosted-slim to the platform PackageSource so a Package can select the minimal presets shipped by the platform chart. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent 7bcd58c commit f89e4ac

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎cmd/cozystack-operator/main.go‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,9 @@ func installPlatformPackageSource(ctx context.Context, k8sClient client.Client,
694694
{"isp-full", []string{"values.yaml", "values-isp-full.yaml"}},
695695
{"isp-hosted", []string{"values.yaml", "values-isp-hosted.yaml"}},
696696
{"isp-full-generic", []string{"values.yaml", "values-isp-full-generic.yaml"}},
697+
{"isp-slim", []string{"values.yaml", "values-isp-slim.yaml"}},
698+
{"isp-slim-generic", []string{"values.yaml", "values-isp-slim-generic.yaml"}},
699+
{"isp-hosted-slim", []string{"values.yaml", "values-isp-hosted-slim.yaml"}},
697700
}
698701

699702
variants := make([]cozyv1alpha1.Variant, len(variantData))

‎cmd/cozystack-operator/main_test.go‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func TestInstallPlatformPackageSource_Creates(t *testing.T) {
7777
}
7878

7979
// Verify variants
80-
expectedVariants := []string{"default", "isp-full", "isp-hosted", "isp-full-generic"}
80+
expectedVariants := []string{"default", "isp-full", "isp-hosted", "isp-full-generic", "isp-slim", "isp-slim-generic", "isp-hosted-slim"}
8181
if len(ps.Spec.Variants) != len(expectedVariants) {
8282
t.Fatalf("expected %d variants, got %d", len(expectedVariants), len(ps.Spec.Variants))
8383
}
@@ -114,8 +114,8 @@ func TestInstallPlatformPackageSource_Updates(t *testing.T) {
114114
if ps.Spec.SourceRef.Name != "cozystack-platform" {
115115
t.Errorf("expected sourceRef.name %q, got %q", "cozystack-platform", ps.Spec.SourceRef.Name)
116116
}
117-
if len(ps.Spec.Variants) != 4 {
118-
t.Errorf("expected 4 variants, got %d", len(ps.Spec.Variants))
117+
if len(ps.Spec.Variants) != 7 {
118+
t.Errorf("expected 7 variants, got %d", len(ps.Spec.Variants))
119119
}
120120
}
121121

@@ -259,6 +259,9 @@ func TestInstallPlatformPackageSource_VariantValuesFiles(t *testing.T) {
259259
"isp-full": {"values.yaml", "values-isp-full.yaml"},
260260
"isp-hosted": {"values.yaml", "values-isp-hosted.yaml"},
261261
"isp-full-generic": {"values.yaml", "values-isp-full-generic.yaml"},
262+
"isp-slim": {"values.yaml", "values-isp-slim.yaml"},
263+
"isp-slim-generic": {"values.yaml", "values-isp-slim-generic.yaml"},
264+
"isp-hosted-slim": {"values.yaml", "values-isp-hosted-slim.yaml"},
262265
}
263266

264267
for _, v := range ps.Spec.Variants {

0 commit comments

Comments
 (0)