Skip to content

Commit f343070

Browse files
committed
fix: report effective Helm timeout source
1 parent ca996bf commit f343070

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

pkg/component/helm/client.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"helm.sh/helm/v4/pkg/storage/driver"
1616

1717
errUtils "github.com/cloudposse/atmos/errors"
18-
cfg "github.com/cloudposse/atmos/pkg/config"
1918
"github.com/cloudposse/atmos/pkg/perf"
2019
)
2120

@@ -242,7 +241,7 @@ func releaseOperationError(operation string, spec *chartSpec, cause error) error
242241
WithContext("namespace", spec.Namespace).
243242
WithContext("wait_strategy", policy.WaitStrategy).
244243
WithContext("timeout", policy.Timeout).
245-
WithContext("timeout_field", cfg.HelmTimeoutSectionName).
244+
WithContext("timeout_field", spec.Lifecycle.TimeoutField).
246245
Err()
247246
}
248247

pkg/component/helm/client_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"helm.sh/helm/v4/pkg/kube"
1414

1515
errUtils "github.com/cloudposse/atmos/errors"
16-
cfg "github.com/cloudposse/atmos/pkg/config"
1716
)
1817

1918
func TestResolveUpgradeChartRef(t *testing.T) {
@@ -105,10 +104,10 @@ func TestReleaseOperationErrorIncludesEffectivePolicy(t *testing.T) {
105104
err := releaseOperationError("upgrade", &chartSpec{
106105
ReleaseName: "demo",
107106
Namespace: "apps",
108-
Lifecycle: releaseLifecycleResolution{Policy: releaseLifecycle{
107+
Lifecycle: releaseLifecycleResolution{Policy: effectiveReleasePolicy{
109108
WaitStrategy: kube.StatusWatcherStrategy,
110109
Timeout: 7 * time.Minute,
111-
}},
110+
}, TimeoutField: "release.upgrade.timeout"},
112111
}, cause)
113112

114113
require.ErrorIs(t, err, errUtils.ErrHelmReleaseOperation)
@@ -118,7 +117,7 @@ func TestReleaseOperationErrorIncludesEffectivePolicy(t *testing.T) {
118117
assert.True(t, errUtils.HasContext(err, "namespace", "apps"))
119118
assert.True(t, errUtils.HasContext(err, "wait_strategy", "watcher"))
120119
assert.True(t, errUtils.HasContext(err, "timeout", "7m0s"))
121-
assert.True(t, errUtils.HasContext(err, "timeout_field", cfg.HelmTimeoutSectionName))
120+
assert.True(t, errUtils.HasContext(err, "timeout_field", "release.upgrade.timeout"))
122121
}
123122

124123
func TestClusterOperationsReturnActionContextErrors(t *testing.T) {

0 commit comments

Comments
 (0)