Skip to content

Commit

Permalink
Properly escalate the message from Runnable Conditions (#1154)
Browse files Browse the repository at this point in the history
  • Loading branch information
idoru authored Feb 16, 2023
1 parent 97cd626 commit 4c5b600
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
7 changes: 4 additions & 3 deletions pkg/conditions/runnable_conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ func StampedObjectConditionUnknown() metav1.Condition {

func StampedObjectConditionKnown(condition *metav1.Condition) metav1.Condition {
return metav1.Condition{
Type: v1alpha1.StampedObjectCondition,
Status: condition.Status,
Reason: v1alpha1.SucceededStampedObjectConditionReason,
Type: v1alpha1.StampedObjectCondition,
Status: condition.Status,
Reason: v1alpha1.SucceededStampedObjectConditionReason,
Message: condition.Message,
}
}
14 changes: 8 additions & 6 deletions tests/integration/runnable/runnable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -895,9 +895,10 @@ var _ = Describe("Stamping a resource on Runnable Creation", func() {
),
MatchFields(IgnoreExtras,
Fields{
"Type": Equal("StampedObjectCondition"),
"Status": Equal(metav1.ConditionFalse),
"Reason": Equal("SucceededCondition"),
"Type": Equal("StampedObjectCondition"),
"Status": Equal(metav1.ConditionFalse),
"Reason": Equal("SucceededCondition"),
"Message": Equal("not a happy first stamped object"),
},
),
MatchFields(IgnoreExtras,
Expand Down Expand Up @@ -1005,9 +1006,10 @@ var _ = Describe("Stamping a resource on Runnable Creation", func() {
),
MatchFields(IgnoreExtras,
Fields{
"Type": Equal("StampedObjectCondition"),
"Status": Equal(metav1.ConditionTrue),
"Reason": Equal("SucceededCondition"),
"Type": Equal("StampedObjectCondition"),
"Status": Equal(metav1.ConditionTrue),
"Reason": Equal("SucceededCondition"),
"Message": Equal("happy second stamped object"),
},
),
MatchFields(IgnoreExtras,
Expand Down

0 comments on commit 4c5b600

Please sign in to comment.