mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Rename CdiDevices to CDIDevices in dramanager checkpoint
Signed-off-by: Kevin Klues <kklues@nvidia.com>
This commit is contained in:
parent
d34b0275a3
commit
273a8ffad1
@ -51,9 +51,9 @@ type ClaimInfoState struct {
|
||||
// PodUIDs is a set of pod UIDs that reference a resource
|
||||
PodUIDs sets.Set[string]
|
||||
|
||||
// CdiDevices is a list of CDI devices returned by the
|
||||
// CDIDevices is a list of CDI devices returned by the
|
||||
// GRPC API call NodePrepareResource
|
||||
CdiDevices []string
|
||||
CDIDevices []string
|
||||
}
|
||||
|
||||
type stateCheckpoint struct {
|
||||
|
@ -50,7 +50,7 @@ func TestCheckpointGetOrCreate(t *testing.T) {
|
||||
},
|
||||
{
|
||||
"Restore valid checkpoint",
|
||||
`{"version":"v1","entries":[{"DriverName":"test-driver.cdi.k8s.io","ClaimUID":"067798be-454e-4be4-9047-1aa06aea63f7","ClaimName":"example","Namespace":"default","PodUIDs":{"139cdb46-f989-4f17-9561-ca10cfb509a6":{}},"CdiDevices":["example.com/example=cdi-example"]}],"checksum":2939981547}`,
|
||||
`{"version":"v1","entries":[{"DriverName":"test-driver.cdi.k8s.io","ClaimUID":"067798be-454e-4be4-9047-1aa06aea63f7","ClaimName":"example","Namespace":"default","PodUIDs":{"139cdb46-f989-4f17-9561-ca10cfb509a6":{}},"CDIDevices":["example.com/example=cdi-example"]}],"checksum":2242470059}`,
|
||||
"",
|
||||
[]ClaimInfoState{{
|
||||
DriverName: "test-driver.cdi.k8s.io",
|
||||
@ -58,13 +58,13 @@ func TestCheckpointGetOrCreate(t *testing.T) {
|
||||
ClaimName: "example",
|
||||
Namespace: "default",
|
||||
PodUIDs: sets.New("139cdb46-f989-4f17-9561-ca10cfb509a6"),
|
||||
CdiDevices: []string{"example.com/example=cdi-example"},
|
||||
CDIDevices: []string{"example.com/example=cdi-example"},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"Restore checkpoint with invalid checksum",
|
||||
`{"version":"v1","entries":[{"DriverName":"test-driver.cdi.k8s.io","ClaimUID":"067798be-454e-4be4-9047-1aa06aea63f7","ClaimName":"example","Namespace":"default","PodUIDs":{"139cdb46-f989-4f17-9561-ca10cfb509a6":{}},"CdiDevices":["example.com/example=cdi-example"]}],"checksum":2939981548}`,
|
||||
`{"version":"v1","entries":[{"DriverName":"test-driver.cdi.k8s.io","ClaimUID":"067798be-454e-4be4-9047-1aa06aea63f7","ClaimName":"example","Namespace":"default","PodUIDs":{"139cdb46-f989-4f17-9561-ca10cfb509a6":{}},"CDIDevices":["example.com/example=cdi-example"]}],"checksum":2242470060}`,
|
||||
"checkpoint is corrupted",
|
||||
[]ClaimInfoState{},
|
||||
},
|
||||
@ -123,10 +123,10 @@ func TestCheckpointStateStore(t *testing.T) {
|
||||
ClaimName: "example",
|
||||
Namespace: "default",
|
||||
PodUIDs: sets.New("139cdb46-f989-4f17-9561-ca10cfb509a6"),
|
||||
CdiDevices: []string{"example.com/example=cdi-example"},
|
||||
CDIDevices: []string{"example.com/example=cdi-example"},
|
||||
}
|
||||
|
||||
expectedCheckpoint := `{"version":"v1","entries":[{"DriverName":"test-driver.cdi.k8s.io","ClaimUID":"067798be-454e-4be4-9047-1aa06aea63f7","ClaimName":"example","Namespace":"default","PodUIDs":{"139cdb46-f989-4f17-9561-ca10cfb509a6":{}},"CdiDevices":["example.com/example=cdi-example"]}],"checksum":2939981547}`
|
||||
expectedCheckpoint := `{"version":"v1","entries":[{"DriverName":"test-driver.cdi.k8s.io","ClaimUID":"067798be-454e-4be4-9047-1aa06aea63f7","ClaimName":"example","Namespace":"default","PodUIDs":{"139cdb46-f989-4f17-9561-ca10cfb509a6":{}},"CDIDevices":["example.com/example=cdi-example"]}],"checksum":2242470059}`
|
||||
|
||||
// create temp dir
|
||||
testingDir, err := os.MkdirTemp("", "dramanager_state_test")
|
||||
|
Loading…
Reference in New Issue
Block a user