Change:
return pvc, nil } <del> // Create a PV and PVC based on the passed in nfs-server ip and namespace. // There are 4 combinations, 3 of which are supported here: //   1) prebind and create pvc first //   2) no prebind and create pvc first //   3) no prebind and create pv first // The case of prebinding and creating the pv first is not possible due to using a // *generated* name in the pvc, and thus not knowing the claim's name until after // it has been created. // **Note: this function complements makePersistentVolume() and fills in the remaining // name field in the pv's ClaimRef. func createPVandPVC(c *client.Client, serverIP, ns string, pvFirst, preBind bool) (*api.PersistentVolume, *api.PersistentVolumeClaim, error) { </del> <ins> // Create a PVC followed by the PV based on the passed in nfs-server ip and // namespace. If the "preBind" bool is true then pre-bind the PV to the PVC // via the PV's ClaimRef. Return the pv and pvc to reflect the created objects. // Note: the pv and pvc are returned back to the It() caller so that the //   AfterEach func can delete these objects if they are not nil. // Note: in the pre-bind case the real PVC name, which is generated, is not //   known until after the PVC is instantiated. This is why the pvc is created //   before the pv. func createPVCPV(c *client.Client, serverIP, ns string, preBind bool) (*api.PersistentVolume, *api.PersistentVolumeClaim, error) { </ins> var bindTo *api.PersistentVolumeClaim <del> var err error pvc := makePersistentVolumeClaim(ns) // pvc.Name not known yet </del> <ins> var preBindMsg string </ins> <del> bindTo = nil if preBind { // implies pvc *must* be created before the pv pvFirst = false </del> <ins> // make the pvc definition first pvc := makePersistentVolumeClaim(ns) if preBind { preBindMsg = " pre-bound" </ins> bindTo = pvc } <ins> // make the pv spec </ins> pv := makePersistentVolume(serverIP, bindTo) <del> if pvFirst { By("Creating the PV followed by the PVC") pv, err = createPV(c, pv) } else { By("Creating the PVC followed by the PV") pvc, err = createPVC(c, ns, pvc) } </del> <ins> By(fmt.Sprintf("Creating a PVC followed by a%s PV", preBindMsg)) // instantiate the pvc pvc, err := createPVC(c, ns, pvc) </ins> if err != nil { return nil, nil, err } <del> if pvFirst { pvc, err = createPVC(c, ns, pvc) if err != nil { return pv, nil, err } } else { // need to fill-in claimRef with pvc.Name </del> <ins> // instantiate the pvc, handle pre-binding by ClaimRef if needed if preBind { </ins> pv.Spec.ClaimRef.Name = pvc.Name <del> pv, err = createPV(c, pv) if err != nil { return nil, pvc, err } </del> <ins> } pv, err = createPV(c, pv) if err != nil { return nil, pvc, err } return pv, pvc, nil } // Create a PV followed by the PVC based on the passed in nfs-server ip and // namespace. If the "preBind" bool is true then pre-bind the PVC to the PV // via the PVC's VolumeName. Return the pv and pvc to reflect the created // objects. // Note: the pv and pvc are returned back to the It() caller so that the //   AfterEach func can delete these objects if they are not nil. // Note: in the pre-bind case the real PV name, which is generated, is not //   known until after the PV is instantiated. This is why the pv is created //   before the pvc. func createPVPVC(c *client.Client, serverIP, ns string, preBind bool) (*api.PersistentVolume, *api.PersistentVolumeClaim, error) { preBindMsg := "" if preBind { preBindMsg = " pre-bound" } By(fmt.Sprintf("Creating a PV followed by a%s PVC", preBindMsg)) // make the pv and pvc definitions pv := makePersistentVolume(serverIP, nil) pvc := makePersistentVolumeClaim(ns) // instantiate the pv pv, err := createPV(c, pv) if err != nil { return nil, nil, err } // instantiate the pvc, handle pre-binding by VolumeName if needed if preBind { pvc.Spec.VolumeName = pv.Name } pvc, err = createPVC(c, ns, pvc) if err != nil { return pv, nil, err </ins> } return pv, pvc, nil

Discussion:
Context: NodeSwap feature gate was recently . Currently, as per , swap is only supported with cgroup v2 - cgroup v1 is no longer supported. For this reason, we decided to fail kubelet if NodeSwap feature gate is enabled and the node runs with cgroup v1. This would help prevent any surprises for the user by failing as soon as possible. This effort is being implemented in this PR: The problem: Currently, swap jobs are running with cgroup v1. Swap tests were in a way that they first check on which environment they're being run (e.g. which cgroup version? is NodeSwap FG enabled? Which swapBehavior is defined? etc) and then expect the right behavior to take place. With v1, the tests expect the containers to be defined without swap access. While the tests pass, they are much less valuable, since all they check is that swap is disabled for v1 workloads. The tests would be much more valuable if they would run with v2, therefore actually ensure that proper swap limitations are configured. In addition, is dependent on these changes, since as of now the jobs immediately fail with this PR since kubelet fails on an environment with cgroup v1 and swap enabled. What needs to change: [x] CRI-O swap related jobs should be defined to run with cgroup v2 (e.g. ) [x] containerd swap related jobs should be defined to run with cgroup v2 (e.g. ). Future work: In the future, we might consider introducing more jobs to check swap. Ideally, both and would be tested, perhaps by periodic jobs.
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the label and provide further guidance. The label can be by org members by writing in a comment. <detailsInstructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
/sig node
/sig testing
/reopen
Reopened this issue. <detailsIn response to : /reopen Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details