Skip to content

Add RuntimeHandlers and Images chain functions #8457

@tenzen-y

Description

@tenzen-y

What would you like to be cleaned:

Follow-up #8452 (comment)

I'd like to add RuntimeHandlers and Images to NodeWrapper:

type NodeWrapper struct {

Then try to use those in TASNodeHandler_Update test function:

"RuntimeHandler order changed": {
oldNode: func() *corev1.Node {
n := baseNode.Clone().Obj()
n.Status.RuntimeHandlers = []corev1.NodeRuntimeHandler{
{Name: "test-handler"},
{Name: "runc"},
}
return n
}(),
newNode: func() *corev1.Node {
n := baseNode.Clone().Obj()
n.Status.RuntimeHandlers = []corev1.NodeRuntimeHandler{
{Name: "runc"},
{Name: "test-handler"},
}
return n
}(),
wantChanged: nodeUnchanged,
},
"Images changed": {
oldNode: func() *corev1.Node {
n := baseNode.Clone().Obj()
n.Status.Images = []corev1.ContainerImage{
{Names: []string{"nginx:1.20"}, SizeBytes: 100},
}
return n
}(),
newNode: func() *corev1.Node {
n := baseNode.Clone().Obj()
n.Status.Images = []corev1.ContainerImage{
{Names: []string{"nginx:1.20"}, SizeBytes: 100},
{Names: []string{"postgres:13"}, SizeBytes: 200},
}
return n
}(),
wantChanged: nodeUnchanged,
},

Why is this needed:

To eliminate anonymous bypass functions from tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.priority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions