Skip to content

Commit ccb5f26

Browse files
authored
fix(core): fix setting LastTransitionTime in condition if reason changed (#1543)
Signed-off-by: Valeriy Khorunzhin <[email protected]>
1 parent 1298be6 commit ccb5f26

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

images/virtualization-artifact/pkg/controller/conditions/builder.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ func SetCondition(c Conder, conditions *[]metav1.Condition) {
6666
if !newCondition.LastTransitionTime.IsZero() &&
6767
newCondition.LastTransitionTime.After(existingCondition.LastTransitionTime.Time) {
6868
existingCondition.LastTransitionTime = newCondition.LastTransitionTime
69+
} else {
70+
existingCondition.LastTransitionTime = metav1.NewTime(time.Now())
6971
}
7072
}
7173

tests/e2e/default_config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ logFilter:
4848
- "the server rejected our request due to an error in our request" # Err.
4949
- "failed to sync powerstate" # Msg.
5050
- "does not have a pvc reference" # "err": "kvvm head-345e7b6a-testcases-image-hotplug/head-345e7b6a-vm-image-hotplug spec volume vi-head-345e7b6a-vi-alpine-http does not have a pvc reference"
51-
- "lastTransitionTime: Required value" # Err.
5251
- "virtualmachineipaddressleases.virtualization.deckhouse.io "
5352
- "Failed to watch" # error if virtualization-controller restarts during tests. "msg": "Failed to watch", "err": "Get \"http://127.0.0.1:23915/apis/virtualization.deckhouse.io/v1alpha2/virtualmachinerestores?allowWatchBookmarks=true\u0026resourceVersion=709816257\u0026timeoutSeconds=310\u0026watch=true\": context canceled"
5453
- "leader election lost"

0 commit comments

Comments
 (0)