@@ -21,6 +21,7 @@ import (
2121 apierr "k8s.io/apimachinery/pkg/api/errors"
2222 "k8s.io/apimachinery/pkg/api/resource"
2323 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
24+ "k8s.io/apimachinery/pkg/labels"
2425 "k8s.io/apimachinery/pkg/runtime"
2526 "k8s.io/apimachinery/pkg/runtime/schema"
2627 "k8s.io/client-go/kubernetes/fake"
@@ -7413,6 +7414,26 @@ func TestBuildRetryStrategyLocalScope(t *testing.T) {
74137414 assert .Equal (t , "6" , localScope [common .LocalVarRetriesLastDuration ])
74147415}
74157416
7417+ func TestGetContainerRuntimeExecutor (t * testing.T ) {
7418+ cancel , controller := newController ()
7419+ defer cancel ()
7420+ controller .Config .ContainerRuntimeExecutor = "pns"
7421+ controller .Config .ContainerRuntimeExecutors = config.ContainerRuntimeExecutors {
7422+ {
7423+ Name : "emissary" ,
7424+ Selector : metav1.LabelSelector {
7425+ MatchLabels : map [string ]string {
7426+ "workflows.argoproj.io/container-runtime-executor" : "emissary" ,
7427+ },
7428+ },
7429+ },
7430+ }
7431+ executor := controller .GetContainerRuntimeExecutor (labels.Set {})
7432+ assert .Equal (t , common .ContainerRuntimeExecutorPNS , executor )
7433+ executor = controller .GetContainerRuntimeExecutor (labels.Set {"workflows.argoproj.io/container-runtime-executor" : "emissary" })
7434+ assert .Equal (t , common .ContainerRuntimeExecutorEmissary , executor )
7435+ }
7436+
74167437var exitHandlerWithRetryNodeParam = `
74177438apiVersion: argoproj.io/v1alpha1
74187439kind: Workflow
0 commit comments