mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-19 08:40:42 +00:00
Make CPUManagerCheckpointV2 type an alias of CPUManagerCheckpoint
This change is to prevent problems when we remove the V1->V2 migration code in the future. Without this, the checksums of all checkpoints would be hashed with the name CPUManagerCheckpointV2 embedded inside of them, which is undesirable. We want the checkpoints to be hashed with the name CPUManagerCheckpoint instead.
This commit is contained in:
parent
5faf8f4c52
commit
b373121a14
@ -28,11 +28,17 @@ import (
|
||||
"k8s.io/kubernetes/pkg/kubelet/checkpointmanager/errors"
|
||||
)
|
||||
|
||||
// CPUManagerCheckpoint struct is used to store cpu/pod assignments in a checkpoint
|
||||
type CPUManagerCheckpoint = CPUManagerCheckpointV2
|
||||
|
||||
var _ checkpointmanager.Checkpoint = &CPUManagerCheckpointV1{}
|
||||
var _ checkpointmanager.Checkpoint = &CPUManagerCheckpointV2{}
|
||||
var _ checkpointmanager.Checkpoint = &CPUManagerCheckpoint{}
|
||||
|
||||
// CPUManagerCheckpoint struct is used to store cpu/pod assignments in a checkpoint in v2 format
|
||||
type CPUManagerCheckpoint struct {
|
||||
PolicyName string `json:"policyName"`
|
||||
DefaultCPUSet string `json:"defaultCpuSet"`
|
||||
Entries map[string]map[string]string `json:"entries,omitempty"`
|
||||
Checksum checksum.Checksum `json:"checksum"`
|
||||
}
|
||||
|
||||
// CPUManagerCheckpointV1 struct is used to store cpu/pod assignments in a checkpoint in v1 format
|
||||
type CPUManagerCheckpointV1 struct {
|
||||
@ -43,12 +49,7 @@ type CPUManagerCheckpointV1 struct {
|
||||
}
|
||||
|
||||
// CPUManagerCheckpointV2 struct is used to store cpu/pod assignments in a checkpoint in v2 format
|
||||
type CPUManagerCheckpointV2 struct {
|
||||
PolicyName string `json:"policyName"`
|
||||
DefaultCPUSet string `json:"defaultCpuSet"`
|
||||
Entries map[string]map[string]string `json:"entries,omitempty"`
|
||||
Checksum checksum.Checksum `json:"checksum"`
|
||||
}
|
||||
type CPUManagerCheckpointV2 = CPUManagerCheckpoint
|
||||
|
||||
// NewCPUManagerCheckpoint returns an instance of Checkpoint
|
||||
func NewCPUManagerCheckpoint() *CPUManagerCheckpoint {
|
||||
|
@ -54,7 +54,7 @@ func TestCheckpointStateRestore(t *testing.T) {
|
||||
"policyName": "none",
|
||||
"defaultCPUSet": "4-6",
|
||||
"entries": {},
|
||||
"checksum": 2655485041
|
||||
"checksum": 354655845
|
||||
}`,
|
||||
"none",
|
||||
containermap.ContainerMap{},
|
||||
@ -74,7 +74,7 @@ func TestCheckpointStateRestore(t *testing.T) {
|
||||
"container2": "1-3"
|
||||
}
|
||||
},
|
||||
"checksum": 3415933391
|
||||
"checksum": 3610638499
|
||||
}`,
|
||||
"none",
|
||||
containermap.ContainerMap{},
|
||||
@ -116,7 +116,7 @@ func TestCheckpointStateRestore(t *testing.T) {
|
||||
"policyName": "other",
|
||||
"defaultCPUSet": "1-3",
|
||||
"entries": {},
|
||||
"checksum": 698611581
|
||||
"checksum": 1394507217
|
||||
}`,
|
||||
"none",
|
||||
containermap.ContainerMap{},
|
||||
@ -129,7 +129,7 @@ func TestCheckpointStateRestore(t *testing.T) {
|
||||
"policyName": "none",
|
||||
"defaultCPUSet": "1.3",
|
||||
"entries": {},
|
||||
"checksum": 1966990140
|
||||
"checksum": 3021697696
|
||||
}`,
|
||||
"none",
|
||||
containermap.ContainerMap{},
|
||||
@ -147,7 +147,7 @@ func TestCheckpointStateRestore(t *testing.T) {
|
||||
"container2": "asd"
|
||||
}
|
||||
},
|
||||
"checksum": 3082925826
|
||||
"checksum": 962272150
|
||||
}`,
|
||||
"none",
|
||||
containermap.ContainerMap{},
|
||||
|
Loading…
Reference in New Issue
Block a user