Skip to content

Commit 9e467fb

Browse files
committed
reconcile: tweak event messages
This in an attempt to maintain compatability with earlier documented inclusion and exclusion lists for Alerts, like the following: ``` eventSources: - kind: HelmRelease name: demo inclusionList: - ".*.upgrade.*succeeded.*" ``` Signed-off-by: Hidde Beydals <hidde@hhh.computer>
1 parent 92ff87b commit 9e467fb

14 files changed

+37
-37
lines changed

internal/reconcile/atomic_release_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func TestAtomicRelease_Reconcile(t *testing.T) {
177177
Type: v2.ReleasedCondition,
178178
Status: metav1.ConditionTrue,
179179
Reason: v2.InstallSucceededReason,
180-
Message: "Installed release",
180+
Message: "Helm install succeeded",
181181
},
182182
{
183183
Type: v2.TestSuccessCondition,

internal/reconcile/install.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ func (r *Install) Type() ReconcilerType {
108108

109109
const (
110110
// fmtInstallFailure is the message format for an installation failure.
111-
fmtInstallFailure = "Install of release %s/%s with chart %s@%s failed: %s"
111+
fmtInstallFailure = "Helm install failed for release %s/%s with chart %s@%s: %s"
112112
// fmtInstallSuccess is the message format for a successful installation.
113-
fmtInstallSuccess = "Installed release %s with chart %s"
113+
fmtInstallSuccess = "Helm install succeeded for release %s with chart %s"
114114
)
115115

116116
// failure records the failure of a Helm installation action in the status of

internal/reconcile/install_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ func TestInstall_Reconcile(t *testing.T) {
8989
chart: testutil.BuildChart(),
9090
expectConditions: []metav1.Condition{
9191
*conditions.TrueCondition(meta.ReadyCondition, v2.InstallSucceededReason,
92-
"Installed release"),
92+
"Helm install succeeded"),
9393
*conditions.TrueCondition(v2.ReleasedCondition, v2.InstallSucceededReason,
94-
"Installed release"),
94+
"Helm install succeeded"),
9595
},
9696
expectCurrent: func(releases []*helmrelease.Release) *v2.Snapshot {
9797
return release.ObservedToSnapshot(release.ObserveRelease(releases[0]))
@@ -159,9 +159,9 @@ func TestInstall_Reconcile(t *testing.T) {
159159
chart: testutil.BuildChart(),
160160
expectConditions: []metav1.Condition{
161161
*conditions.TrueCondition(meta.ReadyCondition, v2.InstallSucceededReason,
162-
"Installed release"),
162+
"Helm install succeeded"),
163163
*conditions.TrueCondition(v2.ReleasedCondition, v2.InstallSucceededReason,
164-
"Installed release"),
164+
"Helm install succeeded"),
165165
},
166166
expectCurrent: func(releases []*helmrelease.Release) *v2.Snapshot {
167167
return release.ObservedToSnapshot(release.ObserveRelease(releases[1]))
@@ -188,9 +188,9 @@ func TestInstall_Reconcile(t *testing.T) {
188188
chart: testutil.BuildChart(),
189189
expectConditions: []metav1.Condition{
190190
*conditions.TrueCondition(meta.ReadyCondition, v2.InstallSucceededReason,
191-
"Installed release"),
191+
"Helm install succeeded"),
192192
*conditions.TrueCondition(v2.ReleasedCondition, v2.InstallSucceededReason,
193-
"Installed release"),
193+
"Helm install succeeded"),
194194
},
195195
expectCurrent: func(releases []*helmrelease.Release) *v2.Snapshot {
196196
return release.ObservedToSnapshot(release.ObserveRelease(releases[0]))

internal/reconcile/rollback_remediation.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ func (r *RollbackRemediation) Type() ReconcilerType {
125125
const (
126126
// fmtRollbackRemediationFailure is the message format for a rollback
127127
// remediation failure.
128-
fmtRollbackRemediationFailure = "Rollback to previous release %s with chart %s failed: %s"
128+
fmtRollbackRemediationFailure = "Helm rollback to previous release %s with chart %s failed: %s"
129129
// fmtRollbackRemediationSuccess is the message format for a successful
130130
// rollback remediation.
131-
fmtRollbackRemediationSuccess = "Rolled back to previous release %s with chart %s"
131+
fmtRollbackRemediationSuccess = "Helm rollback to previous release %s with chart %s succeeded"
132132
)
133133

134134
// failure records the failure of a Helm rollback action in the status of the

internal/reconcile/rollback_remediation_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ func TestRollbackRemediation_Reconcile(t *testing.T) {
113113
}
114114
},
115115
expectConditions: []metav1.Condition{
116-
*conditions.FalseCondition(meta.ReadyCondition, v2.RollbackSucceededReason, "Rolled back to"),
117-
*conditions.TrueCondition(v2.RemediatedCondition, v2.RollbackSucceededReason, "Rolled back to"),
116+
*conditions.FalseCondition(meta.ReadyCondition, v2.RollbackSucceededReason, "succeeded"),
117+
*conditions.TrueCondition(v2.RemediatedCondition, v2.RollbackSucceededReason, "succeeded"),
118118
},
119119
expectCurrent: func(releases []*helmrelease.Release) *v2.Snapshot {
120120
return release.ObservedToSnapshot(release.ObserveRelease(releases[2]))

internal/reconcile/test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ func (r *Test) Type() ReconcilerType {
121121

122122
const (
123123
// fmtTestPending is the message format used when awaiting tests to be run.
124-
fmtTestPending = "Release %s with chart %s is awaiting tests"
124+
fmtTestPending = "Helm release %s with chart %s is awaiting tests"
125125
// fmtTestFailure is the message format for a test failure.
126-
fmtTestFailure = "Test for release %s with chart %s failed: %s"
126+
fmtTestFailure = "Helm test failed for release %s with chart %s: %s"
127127
// fmtTestSuccess is the message format for a successful test.
128-
fmtTestSuccess = "Tests for release %s with chart %s succeeded: %s"
128+
fmtTestSuccess = "Helm test succeeded for release %s with chart %s: %s"
129129
)
130130

131131
// failure records the failure of a Helm test action in the status of the given

internal/reconcile/uninstall.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ func (r *Uninstall) Type() ReconcilerType {
142142

143143
const (
144144
// fmtUninstallFailed is the message format for an uninstall failure.
145-
fmtUninstallFailure = "Uninstall of release %s with chart %s failed: %s"
145+
fmtUninstallFailure = "Helm uninstall failed for release %s with chart %s: %s"
146146
// fmtUninstallSuccess is the message format for a successful uninstall.
147-
fmtUninstallSuccess = "Uninstalled release %s with chart %s"
147+
fmtUninstallSuccess = "Helm uninstall succeeded for release %s with chart %s"
148148
)
149149

150150
// failure records the failure of a Helm uninstall action in the status of the

internal/reconcile/uninstall_remediation.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ func (r *UninstallRemediation) Type() ReconcilerType {
132132
const (
133133
// fmtUninstallRemediationFailure is the message format for an uninstall
134134
// remediation failure.
135-
fmtUninstallRemediationFailure = "Uninstall remediation for release %s with chart %s failed: %s"
135+
fmtUninstallRemediationFailure = "Helm uninstall remediation for release %s with chart %s failed: %s"
136136
// fmtUninstallRemediationSuccess is the message format for a successful
137137
// uninstall remediation.
138-
fmtUninstallRemediationSuccess = "Uninstall remediation for release %s with chart %s succeeded"
138+
fmtUninstallRemediationSuccess = "Helm uninstall remediation for release %s with chart %s succeeded"
139139
)
140140

141141
// success records the success of a Helm uninstall remediation action in the

internal/reconcile/uninstall_remediation_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func TestUninstallRemediation_Reconcile(t *testing.T) {
109109
},
110110
expectConditions: []metav1.Condition{
111111
*conditions.TrueCondition(v2.RemediatedCondition, v2.UninstallSucceededReason,
112-
"Uninstall remediation for release"),
112+
"succeeded"),
113113
},
114114
expectCurrent: func(releases []*helmrelease.Release) *v2.Snapshot {
115115
return release.ObservedToSnapshot(release.ObserveRelease(releases[0]))

internal/reconcile/uninstall_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ func TestUninstall_Reconcile(t *testing.T) {
107107
},
108108
expectConditions: []metav1.Condition{
109109
*conditions.FalseCondition(meta.ReadyCondition, v2.UninstallSucceededReason,
110-
"Uninstalled release"),
110+
"succeeded"),
111111
*conditions.FalseCondition(v2.ReleasedCondition, v2.UninstallSucceededReason,
112-
"Uninstalled release"),
112+
"succeeded"),
113113
},
114114
expectCurrent: func(releases []*helmrelease.Release) *v2.Snapshot {
115115
return release.ObservedToSnapshot(release.ObserveRelease(releases[0]))

internal/reconcile/unlock.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ func (r *Unlock) Type() ReconcilerType {
115115

116116
const (
117117
// fmtUnlockFailure is the message format for an unlock failure.
118-
fmtUnlockFailure = "Unlock of release %s with chart %s in %s state failed: %s"
118+
fmtUnlockFailure = "Unlock of Helm release %s with chart %s in %s state failed: %s"
119119
// fmtUnlockSuccess is the message format for a successful unlock.
120-
fmtUnlockSuccess = "Unlocked release %s with chart %s in %s state"
120+
fmtUnlockSuccess = "Unlocked Helm release %s with chart %s in %s state"
121121
)
122122

123123
// failure records the failure of an unlock action in the status of the given

internal/reconcile/unlock_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ func TestUnlock_Reconcile(t *testing.T) {
104104
}
105105
},
106106
expectConditions: []metav1.Condition{
107-
*conditions.FalseCondition(meta.ReadyCondition, "PendingRelease", "Unlocked release"),
108-
*conditions.FalseCondition(v2.ReleasedCondition, "PendingRelease", "Unlocked release"),
107+
*conditions.FalseCondition(meta.ReadyCondition, "PendingRelease", "Unlocked Helm release"),
108+
*conditions.FalseCondition(v2.ReleasedCondition, "PendingRelease", "Unlocked Helm release"),
109109
},
110110
expectCurrent: func(releases []*helmrelease.Release) *v2.Snapshot {
111111
return release.ObservedToSnapshot(release.ObserveRelease(releases[0]))
@@ -139,8 +139,8 @@ func TestUnlock_Reconcile(t *testing.T) {
139139
},
140140
wantErr: mockUpdateErr,
141141
expectConditions: []metav1.Condition{
142-
*conditions.FalseCondition(meta.ReadyCondition, "PendingRelease", "Unlock of release"),
143-
*conditions.FalseCondition(v2.ReleasedCondition, "PendingRelease", "Unlock of release"),
142+
*conditions.FalseCondition(meta.ReadyCondition, "PendingRelease", "in pending-rollback state failed: storage update error"),
143+
*conditions.FalseCondition(v2.ReleasedCondition, "PendingRelease", "in pending-rollback state failed: storage update error"),
144144
},
145145
expectCurrent: func(releases []*helmrelease.Release) *v2.Snapshot {
146146
return release.ObservedToSnapshot(release.ObserveRelease(releases[0]))

internal/reconcile/upgrade.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ func (r *Upgrade) Type() ReconcilerType {
108108

109109
const (
110110
// fmtUpgradeFailure is the message format for an upgrade failure.
111-
fmtUpgradeFailure = "Upgrade of release %s/%s with chart %s@%s failed: %s"
111+
fmtUpgradeFailure = "Helm upgrade failed for release %s/%s with chart %s@%s: %s"
112112
// fmtUpgradeSuccess is the message format for a successful upgrade.
113-
fmtUpgradeSuccess = "Upgraded release %s with chart %s"
113+
fmtUpgradeSuccess = "Helm upgrade succeeded for release %s with chart %s"
114114
)
115115

116116
// failure records the failure of a Helm upgrade action in the status of the

internal/reconcile/upgrade_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ func TestUpgrade_Reconcile(t *testing.T) {
111111
}
112112
},
113113
expectConditions: []metav1.Condition{
114-
*conditions.TrueCondition(meta.ReadyCondition, v2.UpgradeSucceededReason, "Upgraded release"),
115-
*conditions.TrueCondition(v2.ReleasedCondition, v2.UpgradeSucceededReason, "Upgraded release"),
114+
*conditions.TrueCondition(meta.ReadyCondition, v2.UpgradeSucceededReason, "Helm upgrade succeeded"),
115+
*conditions.TrueCondition(v2.ReleasedCondition, v2.UpgradeSucceededReason, "Helm upgrade succeeded"),
116116
},
117117
expectCurrent: func(releases []*helmrelease.Release) *v2.Snapshot {
118118
return release.ObservedToSnapshot(release.ObserveRelease(releases[1]))
@@ -261,8 +261,8 @@ func TestUpgrade_Reconcile(t *testing.T) {
261261
}
262262
},
263263
expectConditions: []metav1.Condition{
264-
*conditions.TrueCondition(meta.ReadyCondition, v2.UpgradeSucceededReason, "Upgraded release"),
265-
*conditions.TrueCondition(v2.ReleasedCondition, v2.UpgradeSucceededReason, "Upgraded release"),
264+
*conditions.TrueCondition(meta.ReadyCondition, v2.UpgradeSucceededReason, "Helm upgrade succeeded"),
265+
*conditions.TrueCondition(v2.ReleasedCondition, v2.UpgradeSucceededReason, "Helm upgrade succeeded"),
266266
},
267267
expectCurrent: func(releases []*helmrelease.Release) *v2.Snapshot {
268268
return release.ObservedToSnapshot(release.ObserveRelease(releases[1]))
@@ -303,9 +303,9 @@ func TestUpgrade_Reconcile(t *testing.T) {
303303
},
304304
expectConditions: []metav1.Condition{
305305
*conditions.TrueCondition(meta.ReadyCondition, v2.UpgradeSucceededReason,
306-
"Upgraded release"),
306+
"Helm upgrade succeeded"),
307307
*conditions.TrueCondition(v2.ReleasedCondition, v2.UpgradeSucceededReason,
308-
"Upgraded release"),
308+
"Helm upgrade succeeded"),
309309
},
310310
expectCurrent: func(releases []*helmrelease.Release) *v2.Snapshot {
311311
return release.ObservedToSnapshot(release.ObserveRelease(releases[2]))

0 commit comments

Comments
 (0)