Skip to content

Conversation

sgalsaleh
Copy link
Member

What this PR does / why we need it:

Installs Helm charts directly without relying on the KOTS CLI

Which issue(s) this PR fixes:

SC-128045

Does this PR require a test?

Yes

Does this PR require a release note?

NONE

Does this PR require documentation?

NONE

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

}
}

func WithKubeConfigPath(path string) AppInstallManagerOption {
Copy link
Member

Choose a reason for hiding this comment

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

this looks unused

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch. i think i'll need your work on stopping deploys from kots to test this properly e2e

return len(p), nil
}

func (m *appInstallManager) 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.

why not make hcli required? also isnt it better to initialize things in the constructor as errors will happen unexpectedly late?

Copy link
Member Author

Choose a reason for hiding this comment

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

but the cluster won't be up yet during initialization in the linux target scenario. hcli is mainly overridden by tests

Copy link
Member

Choose a reason for hiding this comment

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

got it

logFn := m.logFn("app-helm")

if m.releaseData == nil || len(m.releaseData.HelmChartArchives) == 0 {
logFn("no helm charts found in release data")
Copy link
Member

Choose a reason for hiding this comment

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

is this an error? what is a use case for not having any helm charts?

for i, chartArchive := range m.releaseData.HelmChartArchives {
logFn("installing chart %d/%d", i+1, len(m.releaseData.HelmChartArchives))

if err := m.installHelmChart(ctx, chartArchive, i); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

rather than pass the index here as an argument, can you wrap the error in the index?

defer tmpFile.Close()

if _, err := tmpFile.Write(chartArchive); err != nil {
os.Remove(tmpFile.Name())
Copy link
Member

@emosbaugh emosbaugh Aug 21, 2025

Choose a reason for hiding this comment

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

better to acknowledge you are ignoring an error here

Suggested change
os.Remove(tmpFile.Name())
_ = os.Remove(tmpFile.Name())

Copy link
Member

@emosbaugh emosbaugh left a comment

Choose a reason for hiding this comment

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

some comments

}

logFn("successfully installed chart %d/%d", i+1, len(m.releaseData.HelmChartArchives))
}
Copy link

Choose a reason for hiding this comment

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

Bug: Helm Chart Absence Causes Installation Failure

The application installation fails if no Helm charts are found in the release data. The installHelmCharts function currently errors out in this scenario, but some applications legitimately don't include Helm charts. This prevents the KOTS CLI setup and other necessary installation steps from completing, even when no charts are expected.

Fix in Cursor Fix in Web

@sgalsaleh sgalsaleh merged commit 9f1cb9f into main Aug 21, 2025
27 checks passed
@sgalsaleh sgalsaleh deleted the salah/sc-128045/update-app-install-endpoint-to-install-helm branch August 21, 2025 21:37
diamonwiggins added a commit that referenced this pull request Aug 25, 2025
diamonwiggins added a commit that referenced this pull request Aug 25, 2025
* Revert "feat(v3): pass isEmbeddedClusterV3 to adminconsole chart (#2723)"

This reverts commit 58fb99e.

* Revert "Extract installable charts test improvements (#2722)"

This reverts commit 6aee665.

* Revert "feat(v3): use values and optionalValues from HelmChart custom resource when installing app charts (#2719)"

This reverts commit ed1fceb.

* Revert "feat(v3): install Helm charts directly without KOTS CLI (#2715)"

This reverts commit 9f1cb9f.
emosbaugh pushed a commit that referenced this pull request Aug 27, 2025
* feat(v3): install Helm charts directly without KOTS CLI

* gofmt

* fix tests

* gofmt

* update docs

* feedback
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