func (tc *testContext) ensureTestRunnerRole() error {
	role := rbac.Role{
		TypeMeta:   meta.TypeMeta{},
		ObjectMeta: meta.ObjectMeta{Name: tc.workloadNamespace},
		Rules: []rbac.PolicyRule{
			{
				Verbs:         []string{"use"},
				APIGroups:     []string{"security.openshift.io"},
				Resources:     []string{"securitycontextconstraints"},
				ResourceNames: []string{"hostnetwork"},
			},
		},
	}
	_, err := tc.client.K8s.RbacV1().Roles(tc.workloadNamespace).Create(context.TODO(), &role, meta.CreateOptions{})
	if err != nil && !apierrors.IsAlreadyExists(err) {
		return errors.Wrap(err, "unable to create role")
	}
	return nil
}
// ensureTestRunnerRole ensures the proper Role exists, a requirement for SSHing into a Windows node
// noop if the Role already exists.
ensureTestRunnerRole ensures the proper Role exists, a requirement for SSHing into a Windows node
noop if the Role already exists.
// ensureTestRunnerRole ensures the proper Role exists a requirement for SSHing into a Windows node // noop if the Role already exists .
func (tc *testContext) ensureTestRunnerRole() error {
	role := rbac.Role{
		TypeMeta:   meta.TypeMeta{},
		ObjectMeta: meta.ObjectMeta{Name: tc.workloadNamespace},
		Rules: []rbac.PolicyRule{
			{
				Verbs:         []string{"use"},
				APIGroups:     []string{"security.openshift.io"},
				Resources:     []string{"securitycontextconstraints"},
				ResourceNames: []string{"hostnetwork"},
			},
		},
	}
	_, err := tc.client.K8s.RbacV1().Roles(tc.workloadNamespace).Create(context.TODO(), &role, meta.CreateOptions{})
	if err != nil && !apierrors.IsAlreadyExists(err) {
		return errors.Wrap(err, "unable to create role")
	}
	return nil
}
func ( tc * testContext ) ensureTestRunnerRole ( ) error { role := rbac . Role { TypeMeta : meta . TypeMeta { } , ObjectMeta : meta . ObjectMeta { Name : tc . workloadNamespace } , Rules : [ ] rbac . PolicyRule { { Verbs : [ ] string { " " } , APIGroups : [ ] string { " " } , Resources : [ ] string { " " } , ResourceNames : [ ] string { " " } , } , } , } _ , err := tc . client . K8s . RbacV1 ( ) . Roles ( tc . workloadNamespace ) . Create ( context . TODO ( ) , & role , meta . CreateOptions { } ) if err != nil && ! apierrors . IsAlreadyExists ( err ) { return errors . Wrap ( err , " " ) } return nil }
ensureTestRunnerRole ensures the proper Role exists, a requirement for SSHing into a Windows node
noop if the Role already exists.
ensureTestRunnerRole ensures the proper Role exists a requirement for SSHing into a Windows node noop if the Role already exists .