func (tc *testContext) ensureTestRunnerRoleBinding() error {
	rb := rbac.RoleBinding{
		TypeMeta:   meta.TypeMeta{},
		ObjectMeta: meta.ObjectMeta{Name: tc.workloadNamespace},
		Subjects: []rbac.Subject{{
			Kind:      "ServiceAccount",
			APIGroup:  "",
			Name:      tc.workloadNamespace,
			Namespace: tc.workloadNamespace,
		}},
		RoleRef: rbac.RoleRef{
			APIGroup: "rbac.authorization.k8s.io",
			Kind:     "Role",
			Name:     tc.workloadNamespace,
		},
	}
	_, err := tc.client.K8s.RbacV1().RoleBindings(tc.workloadNamespace).Create(context.TODO(), &rb, meta.CreateOptions{})
	if err != nil && !apierrors.IsAlreadyExists(err) {
		return errors.Wrap(err, "unable to create role")
	}
	return nil
}
// ensureTestRunnerRoleBinding ensures the proper RoleBinding exists, a requirement for SSHing into a Windows node
// noop if the RoleBinding already exists.
ensureTestRunnerRoleBinding ensures the proper RoleBinding exists, a requirement for SSHing into a Windows node
noop if the RoleBinding already exists.
// ensureTestRunnerRoleBinding ensures the proper RoleBinding exists a requirement for SSHing into a Windows node // noop if the RoleBinding already exists .
func (tc *testContext) ensureTestRunnerRoleBinding() error {
	rb := rbac.RoleBinding{
		TypeMeta:   meta.TypeMeta{},
		ObjectMeta: meta.ObjectMeta{Name: tc.workloadNamespace},
		Subjects: []rbac.Subject{{
			Kind:      "ServiceAccount",
			APIGroup:  "",
			Name:      tc.workloadNamespace,
			Namespace: tc.workloadNamespace,
		}},
		RoleRef: rbac.RoleRef{
			APIGroup: "rbac.authorization.k8s.io",
			Kind:     "Role",
			Name:     tc.workloadNamespace,
		},
	}
	_, err := tc.client.K8s.RbacV1().RoleBindings(tc.workloadNamespace).Create(context.TODO(), &rb, meta.CreateOptions{})
	if err != nil && !apierrors.IsAlreadyExists(err) {
		return errors.Wrap(err, "unable to create role")
	}
	return nil
}
func ( tc * testContext ) ensureTestRunnerRoleBinding ( ) error { rb := rbac . RoleBinding { TypeMeta : meta . TypeMeta { } , ObjectMeta : meta . ObjectMeta { Name : tc . workloadNamespace } , Subjects : [ ] rbac . Subject { { Kind : " " , APIGroup : " " , Name : tc . workloadNamespace , Namespace : tc . workloadNamespace , } } , RoleRef : rbac . RoleRef { APIGroup : " " , Kind : " " , Name : tc . workloadNamespace , } , } _ , err := tc . client . K8s . RbacV1 ( ) . RoleBindings ( tc . workloadNamespace ) . Create ( context . TODO ( ) , & rb , meta . CreateOptions { } ) if err != nil && ! apierrors . IsAlreadyExists ( err ) { return errors . Wrap ( err , " " ) } return nil }
ensureTestRunnerRoleBinding ensures the proper RoleBinding exists, a requirement for SSHing into a Windows node
noop if the RoleBinding already exists.
ensureTestRunnerRoleBinding ensures the proper RoleBinding exists a requirement for SSHing into a Windows node noop if the RoleBinding already exists .