diff --git a/helm-framework/helm/data_source_helm_template.go b/helm-framework/helm/data_source_helm_template.go index 88d9ef79d..15b78df10 100644 --- a/helm-framework/helm/data_source_helm_template.go +++ b/helm-framework/helm/data_source_helm_template.go @@ -834,7 +834,7 @@ func chartPathOptionsModel(model *HelmTemplateModel, meta *Meta, cpo *action.Cha } } - version := model.Version.ValueString() + version := getVersionModel(model) cpo.CaFile = model.RepositoryCaFile.ValueString() cpo.CertFile = model.RepositoryCertFile.ValueString() @@ -851,6 +851,13 @@ func chartPathOptionsModel(model *HelmTemplateModel, meta *Meta, cpo *action.Cha return cpo, chartName, diags } +func getVersionModel(model *HelmTemplateModel) string { + version := model.Version.ValueString() + if version == "" && model.Devel.ValueBool() { + return ">0.0.0-0" + } + return strings.TrimSpace(version) +} func getChartModel(ctx context.Context, model *HelmTemplateModel, meta *Meta, name string, cpo *action.ChartPathOptions) (*chart.Chart, string, diag.Diagnostics) { var diags diag.Diagnostics diff --git a/helm-framework/helm/resource_helm_release.go b/helm-framework/helm/resource_helm_release.go index 9a616d2fc..91294af5c 100644 --- a/helm-framework/helm/resource_helm_release.go +++ b/helm-framework/helm/resource_helm_release.go @@ -1141,11 +1141,11 @@ func getVersion(model *HelmReleaseModel) string { } func isChartInstallable(ch *chart.Chart) error { - chartType := ch.Metadata.Type - if strings.EqualFold(chartType, "library") { - return errors.Errorf("library charts are not installable") + switch ch.Metadata.Type { + case "", "application": + return nil } - return nil + return errors.Errorf("%s charts are not installable", ch.Metadata.Type) } func getChart(ctx context.Context, model *HelmReleaseModel, m *Meta, name string, cpo *action.ChartPathOptions) (*chart.Chart, string, diag.Diagnostics) {