Skip to content

Conversation

emosbaugh
Copy link
Member

@emosbaugh emosbaugh commented Aug 26, 2025

What this PR does / why we need it:

App release manager needs to use a helm client with the k8s version so that it can properly render templates using KubeVersion helm built-in.

Additionally, app install manager is using the incorrect k8s version when instantiating the helm client for target=kubernetes. It is using the version from the build when it should be using the version discovered from the cluster. This makes it so the version is always retrieved from the cluster.

Which issue(s) this PR fixes:

Does this PR require a test?

Does this PR require a release note?


Does this PR require documentation?

@emosbaugh emosbaugh marked this pull request as ready for review August 26, 2025 20:43
@emosbaugh emosbaugh requested a review from sgalsaleh August 26, 2025 20:56
return nil
}

k8sVersion, err := m.getK8sVersion()
Copy link
Member

Choose a reason for hiding this comment

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

edge case: this logic can break later on upgrades if we start to deploy the app first before upgrading infra. for now it's fine

Copy link
Member Author

Choose a reason for hiding this comment

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

why would we install the app before upgrading the infra? is this how it works today? i could see running the app preflights before installing the infra.

Copy link
Member

Choose a reason for hiding this comment

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

Ah preflights is a good point. No that's not how it works today, we deploy infra first today

return manifests, nil
}

func (m *appReleaseManager) setupHelmClient() error {
Copy link
Member

Choose a reason for hiding this comment

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

i think we should break this template.go file down later on, it feels overloaded now

Copy link
Member Author

Choose a reason for hiding this comment

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

moved this to the util.go file

appreleasemanager.WithReleaseData(controller.releaseData),
appreleasemanager.WithLicense(license),
appreleasemanager.WithPrivateCACertConfigMapName(controller.privateCACertConfigMapName),
appreleasemanager.WithK8sVersion(controller.k8sVersion),
Copy link
Member Author

Choose a reason for hiding this comment

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

this is only passing the version to the release manager, not the install manager. is that correct?

Copy link
Member

Choose a reason for hiding this comment

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

Hmm does the install manager assume a linux target and uses the k0s version? If so then it should be fixed to follow the pattern in this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

updated so they both use it

@emosbaugh emosbaugh requested a review from sgalsaleh August 26, 2025 22:10
Copy link

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-0af9475" -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-0af9475?airgap=true" -H "Authorization: $EC_SMOKE_TEST_LICENSE_ID" -o embedded-cluster-smoke-test-staging-app-ci.tgz

Happy debugging!

}

k8sVersion := m.k8sVersion
if k8sVersion == "" {
Copy link
Member

Choose a reason for hiding this comment

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

i feel this is going to be hard to debug if the caller forgets to pass the k8s version. what if we make it a required option?

Copy link
Member Author

Choose a reason for hiding this comment

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

updated

@emosbaugh emosbaugh requested a review from sgalsaleh August 27, 2025 17:53
@emosbaugh emosbaugh merged commit 8a18e1e into milestone-7 Aug 27, 2025
17 of 26 checks passed
@emosbaugh emosbaugh deleted the emosbaugh/sc-128387/set-k0s-version-when-rendering-helm-chart branch August 27, 2025 19:05
emosbaugh added a commit that referenced this pull request Aug 27, 2025
* fix(api): use correct helm client k8s version

* f

* use embedded k0s version for linux installs

* use embedded k0s version for linux installs

* pass in k8s version to app release manager when target is kubernetes

* f
emosbaugh added a commit that referenced this pull request Aug 27, 2025
* fix(api): use correct helm client k8s version

* f

* use embedded k0s version for linux installs

* use embedded k0s version for linux installs

* pass in k8s version to app release manager when target is kubernetes

* f
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.

2 participants