mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Fix unit tests
This commit is contained in:
parent
7378b5e690
commit
479b300227
@ -1260,6 +1260,11 @@ func verifyActions(t *testing.T, expected, actual *podActions, desc string) {
|
||||
actual.ContainersToKill[k] = info
|
||||
}
|
||||
}
|
||||
|
||||
if expected.ContainersToUpdate == nil && actual.ContainersToUpdate != nil {
|
||||
// No need to distinguish empty and nil maps for the test.
|
||||
expected.ContainersToUpdate = map[v1.ResourceName][]containerToUpdateInfo{}
|
||||
}
|
||||
assert.Equal(t, expected, actual, desc)
|
||||
}
|
||||
|
||||
|
@ -179,6 +179,7 @@ func NewManager(kubeClient clientset.Interface, podManager PodManager, podDeleti
|
||||
podDeletionSafety: podDeletionSafety,
|
||||
podStartupLatencyHelper: podStartupLatencyHelper,
|
||||
stateFileDirectory: stateFileDirectory,
|
||||
state: state.NewNoopStateCheckpoint(),
|
||||
}
|
||||
}
|
||||
|
||||
@ -202,9 +203,6 @@ func isPodStatusByKubeletEqual(oldStatus, status *v1.PodStatus) bool {
|
||||
}
|
||||
|
||||
func (m *manager) Start() {
|
||||
// Initialize m.state to no-op state checkpoint manager
|
||||
m.state = state.NewNoopStateCheckpoint()
|
||||
|
||||
// Create pod allocation checkpoint manager even if client is nil so as to allow local get/set of AllocatedResources & Resize
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling) {
|
||||
stateImpl, err := state.NewStateCheckpoint(m.stateFileDirectory, podStatusManagerStateFile)
|
||||
|
Loading…
Reference in New Issue
Block a user