Skip to content

Conversation

@diamonwiggins
Copy link
Member

@diamonwiggins diamonwiggins commented Nov 14, 2025

What this PR does / why we need it:

This PR implements initial detection for kURL to Embedded Cluster V3 for migration.

Key changes:

  1. Migration Detection Infrastructure (cmd/installer/cli/migration.go):

    • isKurlCluster() - Detects if the system is running kURL by checking for kURL kubeconfig and the kurl-config ConfigMap
    • isECInstalled() - Checks if Embedded Cluster is already installed
    • detectKurlMigration() - Main detection function that determines if migration is needed
    • getKurlInstallDirectory() - Reads kURL install directory from ConfigMap (defaults to /var/lib/kurl)
    • exportKurlPasswordHash() - Exports kotsadm password hash (for future migration use)
  2. Upgrade Command Integration (cmd/installer/cli/upgrade.go):

    • Integrated migration detection into V3 upgrade flow
    • Displays user-friendly message when kURL cluster is detected
    • Exits gracefully without attempting unsupported migration

Why we need this:

This is the first step toward supporting migration from kURL to Embedded Cluster V3. While actual migration functionality will come in future PRs, this establishes the detection infrastructure

Which issue(s) this PR fixes:

Fixes: https://app.shortcut.com/replicated/story/130962

Does this PR require a test?

Yes - includes comprehensive testing:

  1. Unit tests (cmd/installer/cli/migration_test.go):
    • TestGetKurlInstallDirectory - Tests ConfigMap reading with various scenarios
    • TestExportKurlPasswordHash - Tests password hash extraction
    • TestIsECInstalled - Documents expected behavior (requires filesystem mocking for full testing)
    • TestIsKurlCluster - Documents expected behavior (requires filesystem mocking for full testing)

Does this PR require a release note?

NONE

Does this PR require documentation?

NONE

@github-actions
Copy link

github-actions bot commented Nov 14, 2025

This PR has been released (on staging) and is available for download with a embedded-cluster-smoke-test-staging-app license ID.

Online Installer:

curl "https://staging.replicated.app/embedded/embedded-cluster-smoke-test-staging-app/ci/appver-dev-7f0a2dc" -H "Authorization: $EC_SMOKE_TEST_LICENSE_ID" -o embedded-cluster-smoke-test-staging-app-ci.tgz

Airgap Installer (may take a few minutes before the airgap bundle is built):

curl "https://staging.replicated.app/embedded/embedded-cluster-smoke-test-staging-app/ci-airgap/appver-dev-7f0a2dc?airgap=true" -H "Authorization: $EC_SMOKE_TEST_LICENSE_ID" -o embedded-cluster-smoke-test-staging-app-ci.tgz

Happy debugging!

Copy link
Member

@sgalsaleh sgalsaleh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a dryrun test for this new functionality?

@diamonwiggins diamonwiggins enabled auto-merge (squash) November 17, 2025 21:45
sgalsaleh
sgalsaleh previously approved these changes Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants