Skip to content

Commit 1193095

Browse files
committed
helm installs: uninstall and install chart instead of upgrade due to helmv3 force changes
1 parent efbb209 commit 1193095

File tree

3 files changed

+3
-53
lines changed

3 files changed

+3
-53
lines changed

rust/helm-sys/go-helm-wrapper/main.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -58,30 +58,6 @@ func go_install_helm_release(releaseName *C.char, chartName *C.char, chartVersio
5858
return C.CString("")
5959
}
6060

61-
//export go_upgrade_or_install_helm_release
62-
func go_upgrade_or_install_helm_release(releaseName *C.char, chartName *C.char, chartVersion *C.char, valuesYaml *C.char, namespace *C.char, suppressOutput bool) *C.char {
63-
helmClient := getHelmClient(namespace, suppressOutput)
64-
65-
timeout, _ := time.ParseDuration("20m")
66-
chartSpec := gohelm.ChartSpec{
67-
ReleaseName: C.GoString(releaseName),
68-
ChartName: C.GoString(chartName),
69-
Version: C.GoString(chartVersion),
70-
ValuesYaml: C.GoString(valuesYaml),
71-
Namespace: C.GoString(namespace),
72-
UpgradeCRDs: true,
73-
Wait: true,
74-
Timeout: timeout,
75-
Force: true,
76-
}
77-
78-
if _, err := helmClient.InstallOrUpgradeChart(context.Background(), &chartSpec, nil); err != nil {
79-
return C.CString(fmt.Sprintf("%s%s", HELM_ERROR_PREFIX, err))
80-
}
81-
82-
return C.CString("")
83-
}
84-
8561
//export go_uninstall_helm_release
8662
func go_uninstall_helm_release(releaseName *C.char, namespace *C.char, suppressOutput bool) *C.char {
8763
helmClient := getHelmClient(namespace, suppressOutput)

rust/helm-sys/src/lib.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -37,34 +37,6 @@ pub fn install_helm_release(
3737
}
3838
}
3939

40-
pub fn upgrade_or_install_helm_release(
41-
release_name: &str,
42-
chart_name: &str,
43-
chart_version: &str,
44-
values_yaml: &str,
45-
namespace: &str,
46-
suppress_output: bool,
47-
) -> String {
48-
let release_name = CString::new(release_name).unwrap();
49-
let chart_name = CString::new(chart_name).unwrap();
50-
let chart_version = CString::new(chart_version).unwrap();
51-
let values_yaml = CString::new(values_yaml).unwrap();
52-
let namespace = CString::new(namespace).unwrap();
53-
54-
unsafe {
55-
let c = go_upgrade_or_install_helm_release(
56-
release_name.as_ptr() as *mut c_char,
57-
chart_name.as_ptr() as *mut c_char,
58-
chart_version.as_ptr() as *mut c_char,
59-
values_yaml.as_ptr() as *mut c_char,
60-
namespace.as_ptr() as *mut c_char,
61-
suppress_output as u8,
62-
);
63-
64-
cstr_ptr_to_string(c)
65-
}
66-
}
67-
6840
pub fn uninstall_helm_release(
6941
release_name: &str,
7042
namespace: &str,

rust/stackable-cockpit/src/helm.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,9 @@ fn upgrade_release(
371371
namespace: &str,
372372
suppress_output: bool,
373373
) -> Result<(), Error> {
374-
let result = helm_sys::upgrade_or_install_helm_release(
374+
uninstall_release(release_name, namespace, suppress_output)?;
375+
376+
let result = helm_sys::install_helm_release(
375377
release_name,
376378
chart_name,
377379
chart_version,

0 commit comments

Comments
 (0)