mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-12-24 16:57:27 +00:00
feat: Add cri proxy for e2e_node
add example of using CRI proxy fix: Invalid function call fix: Optimize getPodImagePullDuration fix: Return error if the CRI Proxy is undefined chore: add a document
This commit is contained in:
@@ -20,6 +20,8 @@ limitations under the License.
|
||||
package e2enode
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
libcontainercgroups "github.com/opencontainers/runc/libcontainer/cgroups"
|
||||
)
|
||||
|
||||
@@ -27,3 +29,21 @@ import (
|
||||
func IsCgroup2UnifiedMode() bool {
|
||||
return libcontainercgroups.IsCgroup2UnifiedMode()
|
||||
}
|
||||
|
||||
// addCRIProxyInjector registers an injector function for the CRIProxy.
|
||||
func addCRIProxyInjector(injector func(apiName string) error) error {
|
||||
if e2eCriProxy != nil {
|
||||
e2eCriProxy.AddInjector(injector)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("failed to add injector because the CRI Proxy is undefined")
|
||||
}
|
||||
|
||||
// resetCRIProxyInjector resets all injector functions for the CRIProxy.
|
||||
func resetCRIProxyInjector() error {
|
||||
if e2eCriProxy != nil {
|
||||
e2eCriProxy.ResetInjectors()
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("failed to reset injector because the CRI Proxy is undefined")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user