Skip to content

Commit 732308d

Browse files
ybettank8s-ci-robot
authored andcommitted
Removing LastTransitionTime from the NMC status.
Since we are now checking if a node has rebooted using the node's `status.nodeInfo.bootID` then we don't need to compare the node's ready time and the NMC last recorded node ready time anymore. Signed-off-by: Yoni Bettan <[email protected]>
1 parent f8a14a8 commit 732308d

File tree

6 files changed

+2
-20
lines changed

6 files changed

+2
-20
lines changed

api/v1beta1/nodemodulesconfig_types.go

-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ type NodeModuleStatus struct {
6767
//+optional
6868
Config ModuleConfig `json:"config,omitempty"`
6969
//+optional
70-
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
71-
//+optional
7270
BootId string `json:"bootId,omitempty"`
7371
}
7472

api/v1beta1/zz_generated.deepcopy.go

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/kmm.sigs.x-k8s.io_nodemodulesconfigs.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,6 @@ spec:
369369
type: string
370370
type: object
371371
x-kubernetes-map-type: atomic
372-
lastTransitionTime:
373-
format: date-time
374-
type: string
375372
name:
376373
type: string
377374
namespace:

internal/controllers/nmc_reconciler.go

-6
Original file line numberDiff line numberDiff line change
@@ -573,12 +573,6 @@ func (h *nmcReconcilerHelperImpl) SyncStatus(ctx context.Context, nmcObj *kmmv1b
573573
status.ServiceAccountName = p.Spec.ServiceAccountName
574574
status.Tolerations = p.Spec.Tolerations
575575

576-
podLTT := GetContainerStatus(p.Status.ContainerStatuses, pod.WorkerContainerName).
577-
State.
578-
Terminated.
579-
FinishedAt
580-
581-
status.LastTransitionTime = podLTT
582576
status.BootId = node.Status.NodeInfo.BootID
583577

584578
nmc.SetModuleStatus(&nmcObj.Status.Modules, *status)

internal/controllers/nmc_reconciler_test.go

+2-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"errors"
66
"fmt"
77
"reflect"
8-
"time"
98

109
"github.com/kubernetes-sigs/kernel-module-management/internal/node"
1110
"github.com/kubernetes-sigs/kernel-module-management/internal/pod"
@@ -729,11 +728,8 @@ var _ = Describe("nmcReconcilerHelperImpl_ProcessModuleSpec", func() {
729728
}
730729
node := &v1.Node{}
731730

732-
now := metav1.Now()
733-
734731
status := &kmmv1beta1.NodeModuleStatus{
735-
Config: moduleConfig,
736-
LastTransitionTime: metav1.Time{Time: now.Add(-1 * time.Minute)},
732+
Config: moduleConfig,
737733
ModuleItem: kmmv1beta1.ModuleItem{
738734
Name: name,
739735
Namespace: namespace,
@@ -1258,8 +1254,7 @@ var _ = Describe("nmcReconcilerHelperImpl_SyncStatus", func() {
12581254
ServiceAccountName: serviceAccountName,
12591255
Tolerations: []v1.Toleration{testToleration},
12601256
},
1261-
Config: cfg,
1262-
LastTransitionTime: now,
1257+
Config: cfg,
12631258
}
12641259

12651260
Expect(nmc.Status.Modules[0]).To(BeComparableTo(expectedStatus))

internal/nmc/helper_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,6 @@ var _ = Describe("SetModuleStatus", func() {
405405
InsecurePull: true,
406406
InTreeModulesToRemove: []string{"intree"},
407407
},
408-
LastTransitionTime: metav1.Now(),
409408
}
410409

411410
It("should do nothing if the slice is nil", func() {

0 commit comments

Comments
 (0)