You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit introduces a new Kubernetes condition type "Drifted" to
improve observability of Helm release drift detection.
Signed-off-by: Yasin Özel <yozel@nebius.com>
*conditions.TrueCondition(v2.DriftedCondition, v2.DriftDetectedReason, "Cluster state of release mock-ns/mock-release.v1 has drifted from the desired state:\nDeployment/something/mock removed"),
1737
+
},
1637
1738
},
1638
1739
{
1639
1740
name: "drifted release only triggers event if mode is warn",
*conditions.TrueCondition(v2.DriftedCondition, v2.DriftDetectedReason, "Cluster state of release mock-ns/mock-release.v1 has drifted from the desired state:\nDeployment/something/mock changed (0 additions, 1 changes, 0 removals)"),
1809
+
},
1810
+
},
1811
+
{
1812
+
name: "drifted release sets Drifted condition if mode is warn",
*conditions.TrueCondition(v2.DriftedCondition, v2.DriftDetectedReason, "Cluster state of release mock-ns/mock-release.v1 has drifted from the desired state:\nDeployment/something/mock changed (0 additions, 1 changes, 0 removals)"),
# Bug Report: Test Name Doesn't Match Mode Setting
2
+
3
+
## Location
4
+
File: `internal/reconcile/atomic_release_test.go`
5
+
Line: 1642
6
+
7
+
## Description
8
+
9
+
The test case named `"drifted release only triggers event if mode is warn"` sets the drift detection mode to `DriftDetectionDisabled` instead of `DriftDetectionWarn`.
10
+
11
+
## Current Code
12
+
13
+
```go
14
+
{
15
+
name: "drifted release only triggers event if mode is warn",
16
+
spec: func(spec *v2.HelmReleaseSpec) {
17
+
spec.DriftDetection = &v2.DriftDetection{
18
+
Mode: v2.DriftDetectionDisabled, // BUG: Should be DriftDetectionWarn
19
+
}
20
+
},
21
+
// ...
22
+
}
23
+
```
24
+
25
+
## Expected Code
26
+
27
+
```go
28
+
{
29
+
name: "drifted release only triggers event if mode is warn",
30
+
spec: func(spec *v2.HelmReleaseSpec) {
31
+
spec.DriftDetection = &v2.DriftDetection{
32
+
Mode: v2.DriftDetectionWarn, // FIXED
33
+
}
34
+
},
35
+
// ...
36
+
}
37
+
```
38
+
39
+
## Impact
40
+
41
+
The test name indicates it's testing "warn" mode behavior, but it's actually testing "disabled" mode. This means:
42
+
1. The warn mode + drift scenario is not properly tested
43
+
2. The test results may be misleading
44
+
45
+
## Recommended Fix
46
+
47
+
Change `v2.DriftDetectionDisabled` to `v2.DriftDetectionWarn` on line 1645.
0 commit comments