Skip to content
Open
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
5b15b1a
Adds test fixtures for v1beta2 license support (Phase 0 TDD)
crdant Oct 29, 2025
6236cc8
build(deps): update kotskinds to v0.0.0-20251029124314-174e89c93554
crdant Oct 29, 2025
0d7a9dd
test: simplify license test fixtures to match actual KOTS format
crdant Oct 29, 2025
5f57ae0
test: add TDD tests for v1beta1 and v1beta2 license parsing
crdant Oct 29, 2025
af3e584
feat: update ParseLicense to return LicenseWrapper for multi-version …
crdant Oct 29, 2025
4d87b3d
refactor: update metrics reporter to use LicenseWrapper for license a…
crdant Oct 29, 2025
8c19e5a
refactor: update installer CLI to use LicenseWrapper for multi-versio…
crdant Oct 29, 2025
a892eb7
refactor: update package-level types to use LicenseWrapper for licens…
crdant Oct 29, 2025
92d3629
refactor: update infrastructure managers to use LicenseWrapper for mu…
crdant Oct 29, 2025
4dec0f0
refactor: update template engine to use LicenseWrapper for multi-vers…
crdant Oct 29, 2025
dc65a4f
test: update CLI tests to use LicenseWrapper for multi-version licens…
crdant Oct 29, 2025
7685e3e
fix: update test fixtures to include apiVersion/kind for LicenseWrapp…
crdant Oct 29, 2025
82b4725
test: add apiVersion/kind to integration test license fixtures
crdant Oct 30, 2025
2241373
Removes double definition
crdant Oct 31, 2025
a4c1af6
Fixes strange merge outcome
crdant Oct 31, 2025
eae182d
refactor: remove unused kyaml import from app controller
crdant Oct 31, 2025
9527ea4
fix: update infrastructure managers to use LicenseWrapper API methods
crdant Oct 31, 2025
a7dd820
fix: update template engine for LicenseWrapper nil checks and channel…
crdant Oct 31, 2025
c95311c
fix: update installer commands to use LicenseWrapper methods consiste…
crdant Oct 31, 2025
468b7a7
fix: use direct V1/V2 nil checks for LicenseWrapper instead of method…
crdant Oct 31, 2025
9a769da
fix: update test expectations for LicenseFieldValue with missing data
crdant Oct 31, 2025
66f1925
fix: restore backward-compatible error handling in LicenseFieldValue
crdant Oct 31, 2025
7cd2ff1
fix: correct EntitlementValue access in license expiration check
crdant Oct 31, 2025
ef5032c
Removes improperly commited docs
crdant Oct 31, 2025
2312a97
Merge remote-tracking branch 'origin/main' into feature/crdant/suppor…
crdant Oct 31, 2025
8f4f9a8
More license wrapping
crdant Oct 31, 2025
afe1e83
fix: update test expectations for LicenseWrapper error messages
crdant Oct 31, 2025
f93edad
refactor: update ReplicatedAPI client to support LicenseWrapper
crdant Oct 31, 2025
5b3c0d5
docs: add ReplicatedAPI LicenseWrapper refactor plan
crdant Oct 31, 2025
5a33c14
Removes plan
crdant Oct 31, 2025
be11ef1
test: add v1beta2 license sync test case
crdant Oct 31, 2025
a433a5a
fix: correct variable declarations in test files
crdant Oct 31, 2025
6ea8c24
Formats
crdant Oct 31, 2025
4028622
fix: add required apiVersion and kind fields to test license YAML
crdant Oct 31, 2025
c53579f
Includes a `v1beta2` license for E2E tests
crdant Oct 31, 2025
7e994fb
refactor: convert LicenseWrapper to pointer type (Phases 1-2)
crdant Nov 3, 2025
d2be922
refactor: convert LicenseWrapper to pointer type (Phases 3-7)
crdant Nov 3, 2025
095d0e8
test: update test files to use pointer-based LicenseWrapper
crdant Nov 3, 2025
a04d1e9
fix: correct pointer type handling in install tests
crdant Nov 3, 2025
a2d0164
feat: add license version reporting to replicatedapi client
crdant Nov 3, 2025
ccd89a7
feat: add X-Replicated-License-Version header for v1beta2 licenses
crdant Nov 3, 2025
f5f4083
Merge remote-tracking branch 'origin/main' into feature/crdant/suppor…
crdant Nov 3, 2025
6773c55
test: embed license test data in test files
crdant Nov 3, 2025
a0d5967
fix: use GetAppSlug() getter to prevent nil pointer dereference
crdant Nov 3, 2025
19bdeda
fix: add defensive nil checks for license wrapper dereferences
crdant Nov 3, 2025
9058333
test: use getter methods for license fields in install config tests
crdant Nov 3, 2025
7ffacf7
fix: prevent nil pointer dereference in install metrics reporter crea…
crdant Nov 3, 2025
bbe1cd1
fix: remove duplicate Test_buildInstallConfig_License function
crdant Nov 3, 2025
1080645
Respects test data for assume yes
crdant Nov 3, 2025
02d4ee8
Properly reformats
crdant Nov 3, 2025
1d024c8
test: fix error message expectations in install config license tests
crdant Nov 3, 2025
719f0b9
Merge remote-tracking branch 'origin/main' into feature/crdant/suppor…
crdant Nov 4, 2025
ecc5b53
fix: resolve merge conflict type mismatches for v1beta2 license support
crdant Nov 4, 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
11 changes: 6 additions & 5 deletions api/controllers/app/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import (
"github.com/replicatedhq/embedded-cluster/api/pkg/logger"
"github.com/replicatedhq/embedded-cluster/api/types"
"github.com/replicatedhq/embedded-cluster/pkg/helm"
"github.com/replicatedhq/embedded-cluster/pkg/helpers"
"github.com/replicatedhq/embedded-cluster/pkg/release"
kotsv1beta1 "github.com/replicatedhq/kotskinds/apis/kots/v1beta1"
"github.com/replicatedhq/kotskinds/pkg/licensewrapper"
"github.com/sirupsen/logrus"
helmcli "helm.sh/helm/v3/pkg/cli"
"sigs.k8s.io/controller-runtime/pkg/client"
kyaml "sigs.k8s.io/yaml"
)

type Controller interface {
Expand Down Expand Up @@ -176,10 +176,11 @@ func NewAppController(opts ...AppControllerOption) (*AppController, error) {
return nil, err
}

var license *kotsv1beta1.License
var license *licensewrapper.LicenseWrapper
if len(controller.license) > 0 {
license = &kotsv1beta1.License{}
if err := kyaml.Unmarshal(controller.license, license); err != nil {
var err error
license, err = helpers.ParseLicenseFromBytes(controller.license)
if err != nil {
return nil, fmt.Errorf("parse license: %w", err)
}
}
Expand Down
4 changes: 2 additions & 2 deletions api/controllers/linux/install/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,7 @@ func TestSetupInfra(t *testing.T) {
appcontroller.WithStateMachine(sm),
appcontroller.WithStore(mockStore),
appcontroller.WithReleaseData(getTestReleaseData(&appConfig)),
appcontroller.WithLicense([]byte("spec:\n licenseID: test-license\n")),
appcontroller.WithLicense([]byte("apiVersion: kots.io/v1beta1\nkind: License\nspec:\n licenseID: test-license\n")),
appcontroller.WithAppConfigManager(mockAppConfigManager),
appcontroller.WithAppPreflightManager(mockAppPreflightManager),
appcontroller.WithAppReleaseManager(mockAppReleaseManager),
Expand All @@ -1187,7 +1187,7 @@ func TestSetupInfra(t *testing.T) {
WithAllowIgnoreHostPreflights(tt.serverAllowIgnoreHostPreflights),
WithMetricsReporter(mockMetricsReporter),
WithReleaseData(getTestReleaseData(&appConfig)),
WithLicense([]byte("spec:\n licenseID: test-license\n")),
WithLicense([]byte("apiVersion: kots.io/v1beta1\nkind: License\nspec:\n licenseID: test-license\n")),
WithStore(mockStore),
WithHelmClient(&helm.MockClient{}),
)
Expand Down
4 changes: 2 additions & 2 deletions api/integration/app/install/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ func TestAppInstallSuite(t *testing.T) {
linuxinstall.WithStateMachine(linuxinstall.NewStateMachine(linuxinstall.WithCurrentState(initialState))),
linuxinstall.WithReleaseData(rd),
linuxinstall.WithHelmClient(&helm.MockClient{}),
linuxinstall.WithLicense([]byte("spec:\n licenseID: test-license\n")),
linuxinstall.WithLicense([]byte("apiVersion: kots.io/v1beta1\nkind: License\nspec:\n licenseID: test-license\n")),
linuxinstall.WithConfigValues(configValues),
)
require.NoError(t, err)
Expand All @@ -1072,7 +1072,7 @@ func TestAppInstallSuite(t *testing.T) {
kubernetesinstall.WithStateMachine(kubernetesinstall.NewStateMachine(kubernetesinstall.WithCurrentState(initialState))),
kubernetesinstall.WithReleaseData(rd),
kubernetesinstall.WithHelmClient(&helm.MockClient{}),
kubernetesinstall.WithLicense([]byte("spec:\n licenseID: test-license\n")),
kubernetesinstall.WithLicense([]byte("apiVersion: kots.io/v1beta1\nkind: License\nspec:\n licenseID: test-license\n")),
kubernetesinstall.WithConfigValues(configValues),
kubernetesinstall.WithKubernetesEnvSettings(helmcli.New()),
)
Expand Down
5 changes: 3 additions & 2 deletions api/internal/managers/app/config/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/replicatedhq/embedded-cluster/api/types"
"github.com/replicatedhq/embedded-cluster/pkg/release"
kotsv1beta1 "github.com/replicatedhq/kotskinds/apis/kots/v1beta1"
"github.com/replicatedhq/kotskinds/pkg/licensewrapper"
"github.com/sirupsen/logrus"
"sigs.k8s.io/controller-runtime/pkg/client"
)
Expand All @@ -33,7 +34,7 @@ type appConfigManager struct {
rawConfig kotsv1beta1.Config
appConfigStore configstore.Store
releaseData *release.ReleaseData
license *kotsv1beta1.License
license *licensewrapper.LicenseWrapper
isAirgap bool
privateCACertConfigMapName string
kcli client.Client
Expand Down Expand Up @@ -62,7 +63,7 @@ func WithReleaseData(releaseData *release.ReleaseData) AppConfigManagerOption {
}
}

func WithLicense(license *kotsv1beta1.License) AppConfigManagerOption {
func WithLicense(license *licensewrapper.LicenseWrapper) AppConfigManagerOption {
return func(c *appConfigManager) {
c.license = license
}
Expand Down
7 changes: 4 additions & 3 deletions api/internal/managers/app/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/replicatedhq/embedded-cluster/pkg/netutils"
"github.com/replicatedhq/embedded-cluster/pkg/runtimeconfig"
kotsv1beta1 "github.com/replicatedhq/kotskinds/apis/kots/v1beta1"
"github.com/replicatedhq/kotskinds/pkg/licensewrapper"
kyaml "sigs.k8s.io/yaml"
)

Expand Down Expand Up @@ -44,8 +45,8 @@ func (m *appInstallManager) Install(ctx context.Context, configValues kotsv1beta
}

func (m *appInstallManager) install(ctx context.Context, configValues kotsv1beta1.ConfigValues) error {
license := &kotsv1beta1.License{}
if err := kyaml.Unmarshal(m.license, license); err != nil {
licenseWrapper, err := licensewrapper.LoadLicenseFromBytes(m.license)
if err != nil {
return fmt.Errorf("parse license: %w", err)
}

Expand All @@ -61,7 +62,7 @@ func (m *appInstallManager) install(ctx context.Context, configValues kotsv1beta
ecDomains := utils.GetDomains(m.releaseData)

installOpts := kotscli.InstallOptions{
AppSlug: license.Spec.AppSlug,
AppSlug: licenseWrapper.GetAppSlug(),
License: m.license,
Namespace: kotsadmNamespace,
ClusterID: m.clusterID,
Expand Down
17 changes: 8 additions & 9 deletions api/internal/managers/app/install/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@ func TestAppInstallManager_Install(t *testing.T) {
// Setup environment variable for V3
t.Setenv("ENABLE_V3", "1")

// Create test license
license := &kotsv1beta1.License{
Spec: kotsv1beta1.LicenseSpec{
AppSlug: "test-app",
},
}
licenseBytes, err := kyaml.Marshal(license)
require.NoError(t, err)
// Create test license with proper Kubernetes resource format
licenseYAML := `apiVersion: kots.io/v1beta1
kind: License
spec:
appSlug: test-app
`
licenseBytes := []byte(licenseYAML)

// Create test release data
releaseData := &release.ReleaseData{
Expand All @@ -45,7 +44,7 @@ func TestAppInstallManager_Install(t *testing.T) {
}

// Set up release data globally so AppSlug() returns the correct value for v3
err = release.SetReleaseDataForTests(map[string][]byte{
err := release.SetReleaseDataForTests(map[string][]byte{
"channelrelease.yaml": []byte("# channel release object\nappSlug: test-app"),
})
require.NoError(t, err)
Expand Down
5 changes: 3 additions & 2 deletions api/internal/managers/app/release/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/replicatedhq/embedded-cluster/pkg/helm"
"github.com/replicatedhq/embedded-cluster/pkg/release"
kotsv1beta1 "github.com/replicatedhq/kotskinds/apis/kots/v1beta1"
"github.com/replicatedhq/kotskinds/pkg/licensewrapper"
troubleshootv1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
"github.com/sirupsen/logrus"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand All @@ -24,7 +25,7 @@ type AppReleaseManager interface {
type appReleaseManager struct {
rawConfig kotsv1beta1.Config
releaseData *release.ReleaseData
license *kotsv1beta1.License
license *licensewrapper.LicenseWrapper
isAirgap bool
privateCACertConfigMapName string
kcli client.Client
Expand Down Expand Up @@ -60,7 +61,7 @@ func WithHelmClient(hcli helm.Client) AppReleaseManagerOption {
}
}

func WithLicense(license *kotsv1beta1.License) AppReleaseManagerOption {
func WithLicense(license *licensewrapper.LicenseWrapper) AppReleaseManagerOption {
return func(m *appReleaseManager) {
m.license = license
}
Expand Down
18 changes: 9 additions & 9 deletions api/internal/managers/kubernetes/infra/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import (
"github.com/replicatedhq/embedded-cluster/pkg/addons"
addontypes "github.com/replicatedhq/embedded-cluster/pkg/addons/types"
"github.com/replicatedhq/embedded-cluster/pkg/helm"
"github.com/replicatedhq/embedded-cluster/pkg/helpers"
"github.com/replicatedhq/embedded-cluster/pkg/runtimeconfig"
"github.com/replicatedhq/embedded-cluster/pkg/support"
kotsv1beta1 "github.com/replicatedhq/kotskinds/apis/kots/v1beta1"
"github.com/replicatedhq/kotskinds/pkg/licensewrapper"
"github.com/sirupsen/logrus"
"k8s.io/client-go/metadata"
"sigs.k8s.io/controller-runtime/pkg/client"
kyaml "sigs.k8s.io/yaml"
)

func (m *infraManager) Install(ctx context.Context, ki kubernetesinstallation.Installation) (finalErr error) {
Expand Down Expand Up @@ -67,16 +67,16 @@ func (m *infraManager) initInstallComponentsList() error {
}

func (m *infraManager) install(ctx context.Context, ki kubernetesinstallation.Installation) error {
license := &kotsv1beta1.License{}
if err := kyaml.Unmarshal(m.license, license); err != nil {
license, err := helpers.ParseLicenseFromBytes(m.license)
if err != nil {
return fmt.Errorf("parse license: %w", err)
}

if err := m.initInstallComponentsList(); err != nil {
return fmt.Errorf("init components: %w", err)
}

_, err := m.recordInstallation(ctx, m.kcli, license, ki)
_, err = m.recordInstallation(ctx, m.kcli, license, ki)
if err != nil {
return fmt.Errorf("record installation: %w", err)
}
Expand All @@ -97,13 +97,13 @@ func (m *infraManager) install(ctx context.Context, ki kubernetesinstallation.In
return nil
}

func (m *infraManager) recordInstallation(ctx context.Context, kcli client.Client, license *kotsv1beta1.License, ki kubernetesinstallation.Installation) (*ecv1beta1.Installation, error) {
func (m *infraManager) recordInstallation(ctx context.Context, kcli client.Client, license *licensewrapper.LicenseWrapper, ki kubernetesinstallation.Installation) (*ecv1beta1.Installation, error) {
// TODO: we may need this later

return nil, nil
}

func (m *infraManager) installAddOns(ctx context.Context, kcli client.Client, mcli metadata.Interface, hcli helm.Client, license *kotsv1beta1.License, ki kubernetesinstallation.Installation) error {
func (m *infraManager) installAddOns(ctx context.Context, kcli client.Client, mcli metadata.Interface, hcli helm.Client, license *licensewrapper.LicenseWrapper, ki kubernetesinstallation.Installation) error {
progressChan := make(chan addontypes.AddOnProgress)
defer close(progressChan)

Expand Down Expand Up @@ -148,7 +148,7 @@ func (m *infraManager) installAddOns(ctx context.Context, kcli client.Client, mc
return nil
}

func (m *infraManager) getAddonInstallOpts(ctx context.Context, license *kotsv1beta1.License, ki kubernetesinstallation.Installation) (addons.KubernetesInstallOptions, error) {
func (m *infraManager) getAddonInstallOpts(ctx context.Context, license *licensewrapper.LicenseWrapper, ki kubernetesinstallation.Installation) (addons.KubernetesInstallOptions, error) {
// TODO: We should not use the runtimeconfig package for kubernetes target installs. Since runtimeconfig.KotsadmNamespace is
// target agnostic, we should move it to a package that can be used by both linux/kubernetes targets.
kotsadmNamespace, err := runtimeconfig.KotsadmNamespace(ctx, m.kcli)
Expand All @@ -163,7 +163,7 @@ func (m *infraManager) getAddonInstallOpts(ctx context.Context, license *kotsv1b
TLSCertBytes: m.tlsConfig.CertBytes,
TLSKeyBytes: m.tlsConfig.KeyBytes,
Hostname: m.tlsConfig.Hostname,
IsMultiNodeEnabled: license.Spec.IsEmbeddedClusterMultiNodeEnabled,
IsMultiNodeEnabled: license.IsEmbeddedClusterMultiNodeEnabled(),
EmbeddedConfigSpec: m.getECConfigSpec(),
EndUserConfigSpec: m.getEndUserConfigSpec(),
KotsadmNamespace: kotsadmNamespace,
Expand Down
32 changes: 20 additions & 12 deletions api/internal/managers/linux/infra/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ import (
addontypes "github.com/replicatedhq/embedded-cluster/pkg/addons/types"
"github.com/replicatedhq/embedded-cluster/pkg/extensions"
"github.com/replicatedhq/embedded-cluster/pkg/helm"
"github.com/replicatedhq/embedded-cluster/pkg/helpers"
"github.com/replicatedhq/embedded-cluster/pkg/kubeutils"
"github.com/replicatedhq/embedded-cluster/pkg/netutils"
"github.com/replicatedhq/embedded-cluster/pkg/runtimeconfig"
"github.com/replicatedhq/embedded-cluster/pkg/support"
kotsv1beta1 "github.com/replicatedhq/kotskinds/apis/kots/v1beta1"
"github.com/replicatedhq/kotskinds/pkg/licensewrapper"
"github.com/sirupsen/logrus"
"k8s.io/client-go/metadata"
nodeutil "k8s.io/component-helpers/node/util"
"sigs.k8s.io/controller-runtime/pkg/client"
kyaml "sigs.k8s.io/yaml"
)

const K0sComponentName = "Runtime"
Expand Down Expand Up @@ -72,10 +72,14 @@ func (m *infraManager) Install(ctx context.Context, rc runtimeconfig.RuntimeConf
return nil
}

func (m *infraManager) initInstallComponentsList(license *kotsv1beta1.License) error {
func (m *infraManager) initInstallComponentsList(license *licensewrapper.LicenseWrapper) error {
if license == nil {
return fmt.Errorf("license is required for component initialization")
}

components := []types.InfraComponent{{Name: K0sComponentName}}

addOnsNames := addons.GetAddOnsNamesForInstall(m.airgapBundle != "", license.Spec.IsDisasterRecoverySupported)
addOnsNames := addons.GetAddOnsNamesForInstall(m.airgapBundle != "", license.IsDisasterRecoverySupported())
for _, addOnName := range addOnsNames {
components = append(components, types.InfraComponent{Name: addOnName})
}
Expand All @@ -91,16 +95,16 @@ func (m *infraManager) initInstallComponentsList(license *kotsv1beta1.License) e
}

func (m *infraManager) install(ctx context.Context, rc runtimeconfig.RuntimeConfig) error {
license := &kotsv1beta1.License{}
if err := kyaml.Unmarshal(m.license, license); err != nil {
license, err := helpers.ParseLicenseFromBytes(m.license)
if err != nil {
return fmt.Errorf("parse license: %w", err)
}

if err := m.initInstallComponentsList(license); err != nil {
return fmt.Errorf("init components: %w", err)
}

_, err := m.installK0s(ctx, rc)
_, err = m.installK0s(ctx, rc)
if err != nil {
return fmt.Errorf("install k0s: %w", err)
}
Expand Down Expand Up @@ -210,7 +214,7 @@ func (m *infraManager) installK0s(ctx context.Context, rc runtimeconfig.RuntimeC
return k0sCfg, nil
}

func (m *infraManager) recordInstallation(ctx context.Context, kcli client.Client, license *kotsv1beta1.License, rc runtimeconfig.RuntimeConfig) (*ecv1beta1.Installation, error) {
func (m *infraManager) recordInstallation(ctx context.Context, kcli client.Client, license *licensewrapper.LicenseWrapper, rc runtimeconfig.RuntimeConfig) (*ecv1beta1.Installation, error) {
logFn := m.logFn("metadata")

// get the configured custom domains
Expand Down Expand Up @@ -246,7 +250,7 @@ func (m *infraManager) recordInstallation(ctx context.Context, kcli client.Clien
return in, nil
}

func (m *infraManager) installAddOns(ctx context.Context, kcli client.Client, mcli metadata.Interface, hcli helm.Client, license *kotsv1beta1.License, rc runtimeconfig.RuntimeConfig) error {
func (m *infraManager) installAddOns(ctx context.Context, kcli client.Client, mcli metadata.Interface, hcli helm.Client, license *licensewrapper.LicenseWrapper, rc runtimeconfig.RuntimeConfig) error {
progressChan := make(chan addontypes.AddOnProgress)
defer close(progressChan)

Expand Down Expand Up @@ -291,7 +295,11 @@ func (m *infraManager) installAddOns(ctx context.Context, kcli client.Client, mc
return nil
}

func (m *infraManager) getAddonInstallOpts(ctx context.Context, license *kotsv1beta1.License, rc runtimeconfig.RuntimeConfig) (addons.InstallOptions, error) {
func (m *infraManager) getAddonInstallOpts(ctx context.Context, license *licensewrapper.LicenseWrapper, rc runtimeconfig.RuntimeConfig) (addons.InstallOptions, error) {
if license == nil {
return addons.InstallOptions{}, fmt.Errorf("license is required for addon installation")
}

kotsadmNamespace, err := runtimeconfig.KotsadmNamespace(ctx, m.kcli)
if err != nil {
return addons.InstallOptions{}, fmt.Errorf("get kotsadm namespace: %w", err)
Expand All @@ -305,8 +313,8 @@ func (m *infraManager) getAddonInstallOpts(ctx context.Context, license *kotsv1b
TLSCertBytes: m.tlsConfig.CertBytes,
TLSKeyBytes: m.tlsConfig.KeyBytes,
Hostname: m.tlsConfig.Hostname,
DisasterRecoveryEnabled: license.Spec.IsDisasterRecoverySupported,
IsMultiNodeEnabled: license.Spec.IsEmbeddedClusterMultiNodeEnabled,
DisasterRecoveryEnabled: license.IsDisasterRecoverySupported(),
IsMultiNodeEnabled: license.IsEmbeddedClusterMultiNodeEnabled(),
EmbeddedConfigSpec: m.getECConfigSpec(),
EndUserConfigSpec: m.getEndUserConfigSpec(),
ProxySpec: rc.ProxySpec(),
Expand Down
8 changes: 7 additions & 1 deletion api/internal/managers/linux/infra/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/replicatedhq/embedded-cluster/pkg/addons"
"github.com/replicatedhq/embedded-cluster/pkg/runtimeconfig"
kotsv1beta1 "github.com/replicatedhq/kotskinds/apis/kots/v1beta1"
"github.com/replicatedhq/kotskinds/pkg/licensewrapper"
"github.com/stretchr/testify/assert"
)

Expand Down Expand Up @@ -63,14 +64,19 @@ func TestInfraManager_getAddonInstallOpts(t *testing.T) {
},
}

// Wrap the license
wrappedLicense := &licensewrapper.LicenseWrapper{
V1: license,
}

// Create infra manager
manager := NewInfraManager(
WithClusterID("test-cluster"),
WithLicense([]byte("spec:\n licenseID: test-license\n")),
)

// Test the getAddonInstallOpts method with configValues passed as parameter
opts, err := manager.getAddonInstallOpts(t.Context(), license, rc)
opts, err := manager.getAddonInstallOpts(t.Context(), wrappedLicense, rc)
assert.NoError(t, err)

// Verify the install options
Expand Down
Loading
Loading