-
Notifications
You must be signed in to change notification settings - Fork 6
feat(v3): install Helm charts directly without KOTS CLI #2715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(v3): install Helm charts directly without KOTS CLI #2715
Conversation
} | ||
} | ||
|
||
func WithKubeConfigPath(path string) AppInstallManagerOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks unused
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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
os.Remove(tmpFile.Name()) | |
_ = os.Remove(tmpFile.Name()) |
There was a problem hiding this 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)) | ||
} |
There was a problem hiding this comment.
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.
This reverts commit 9f1cb9f.
* 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.
* feat(v3): install Helm charts directly without KOTS CLI * gofmt * fix tests * gofmt * update docs * feedback
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?
Does this PR require documentation?
NONE