mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-18 13:57:38 +00:00
DRA: test mismatched claim UIDs
This commit is contained in:
@@ -388,6 +388,7 @@ func getFakeNode() (*v1.Node, error) {
|
||||
func TestPrepareResources(t *testing.T) {
|
||||
claimName := claimName
|
||||
fakeKubeClient := fake.NewSimpleClientset()
|
||||
anotherClaimUID := types.UID("another-claim-uid")
|
||||
|
||||
for _, test := range []struct {
|
||||
description string
|
||||
@@ -546,6 +547,14 @@ func TestPrepareResources(t *testing.T) {
|
||||
},
|
||||
}},
|
||||
},
|
||||
{
|
||||
description: "claim UIDs mismatch",
|
||||
driverName: driverName,
|
||||
pod: genTestPod(),
|
||||
claim: genTestClaim(claimName, driverName, deviceName, podUID),
|
||||
claimInfo: genTestClaimInfo(anotherClaimUID, []string{podUID}, false),
|
||||
expectedErrMsg: fmt.Sprintf("old claim with same name %s/%s and different UID %s still exists", namespace, claimName, anotherClaimUID),
|
||||
},
|
||||
} {
|
||||
t.Run(test.description, func(t *testing.T) {
|
||||
tCtx := ktesting.Init(t)
|
||||
|
||||
Reference in New Issue
Block a user