mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
fix validation tests
This commit is contained in:
parent
295e47f60b
commit
ff5a0ccb36
@ -247,20 +247,29 @@ func TestValidateManagedFieldsInvalid(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Operation: metav1.ManagedFieldsOperationUpdate,
|
Operation: metav1.ManagedFieldsOperationUpdate,
|
||||||
FieldsType: "RandomVersion",
|
FieldsType: "RandomVersion",
|
||||||
|
APIVersion: "v1",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Operation: "RandomOperation",
|
Operation: "RandomOperation",
|
||||||
FieldsType: "FieldsV1",
|
FieldsType: "FieldsV1",
|
||||||
|
APIVersion: "v1",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Operation is missing
|
// Operation is missing
|
||||||
FieldsType: "FieldsV1",
|
FieldsType: "FieldsV1",
|
||||||
|
APIVersion: "v1",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Operation: metav1.ManagedFieldsOperationUpdate,
|
Operation: metav1.ManagedFieldsOperationUpdate,
|
||||||
FieldsType: "FieldsV1",
|
FieldsType: "FieldsV1",
|
||||||
// Invalid fieldManager
|
// Invalid fieldManager
|
||||||
Manager: "field\nmanager",
|
Manager: "field\nmanager",
|
||||||
|
APIVersion: "v1",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Operation: metav1.ManagedFieldsOperationUpdate,
|
||||||
|
FieldsType: "FieldsV1",
|
||||||
|
// APIVersion missing
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,20 +286,24 @@ func TestValidateManagedFieldsInvalid(t *testing.T) {
|
|||||||
func TestValidateMangedFieldsValid(t *testing.T) {
|
func TestValidateMangedFieldsValid(t *testing.T) {
|
||||||
tests := []metav1.ManagedFieldsEntry{
|
tests := []metav1.ManagedFieldsEntry{
|
||||||
{
|
{
|
||||||
Operation: metav1.ManagedFieldsOperationUpdate,
|
Operation: metav1.ManagedFieldsOperationUpdate,
|
||||||
|
APIVersion: "v1",
|
||||||
// FieldsType is missing
|
// FieldsType is missing
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Operation: metav1.ManagedFieldsOperationUpdate,
|
Operation: metav1.ManagedFieldsOperationUpdate,
|
||||||
FieldsType: "FieldsV1",
|
FieldsType: "FieldsV1",
|
||||||
|
APIVersion: "v1",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Operation: metav1.ManagedFieldsOperationApply,
|
Operation: metav1.ManagedFieldsOperationApply,
|
||||||
FieldsType: "FieldsV1",
|
FieldsType: "FieldsV1",
|
||||||
|
APIVersion: "v1",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Operation: metav1.ManagedFieldsOperationApply,
|
Operation: metav1.ManagedFieldsOperationApply,
|
||||||
FieldsType: "FieldsV1",
|
FieldsType: "FieldsV1",
|
||||||
|
APIVersion: "v1",
|
||||||
Manager: "🍔",
|
Manager: "🍔",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user