Skip to content

Commit

Permalink
E2E: Expend the RT acronym to RealTime
Browse files Browse the repository at this point in the history
In order to make names more explicit,
expend the `RT` acronym to `RealTime`.

Signed-off-by: Orel Misan <[email protected]>
  • Loading branch information
orelmisan committed Dec 18, 2023
1 parent e66e770 commit ae7edc1
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions tests/checkup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
const (
testServiceAccountName = "realtime-checkup-sa"
testKiagnoseConfigMapAccessRoleName = "kiagnose-configmap-access"
testKubeVirtRTCheckerRoleName = "kubevirt-realtime-checker"
testKubeVirtRealTimeCheckerRoleName = "kubevirt-realtime-checker"
testConfigMapName = "realtime-checkup-config"
testCheckupJobName = "realtime-checkup"
)
Expand Down Expand Up @@ -121,8 +121,8 @@ func setupCheckupPermissions() {
checkupServiceAccount *corev1.ServiceAccount
kiagnoseConfigMapAccessRole *rbacv1.Role
kiagnoseConfigMapAccessRoleBinding *rbacv1.RoleBinding
kubeVirtRTCheckerRole *rbacv1.Role
kubeVirtRTCheckerRoleBinding *rbacv1.RoleBinding
kubeVirtRealTimeCheckerRole *rbacv1.Role
kubeVirtRealTimeCheckerRoleBinding *rbacv1.RoleBinding
)

checkupServiceAccount = newServiceAccount()
Expand Down Expand Up @@ -180,35 +180,38 @@ func setupCheckupPermissions() {
Expect(err).NotTo(HaveOccurred())
})

kubeVirtRTCheckerRole = newKubeVirtRTCheckerRole()
kubeVirtRTCheckerRole, err = client.RbacV1().Roles(testNamespace).Create(
kubeVirtRealTimeCheckerRole = newKubeVirtRealTimeCheckerRole()
kubeVirtRealTimeCheckerRole, err = client.RbacV1().Roles(testNamespace).Create(
context.Background(),
kubeVirtRTCheckerRole,
kubeVirtRealTimeCheckerRole,
metav1.CreateOptions{},
)
Expect(err).NotTo(HaveOccurred())

DeferCleanup(func() {
err = client.RbacV1().Roles(kubeVirtRTCheckerRole.Namespace).Delete(
err = client.RbacV1().Roles(kubeVirtRealTimeCheckerRole.Namespace).Delete(
context.Background(),
kubeVirtRTCheckerRole.Name,
kubeVirtRealTimeCheckerRole.Name,
metav1.DeleteOptions{},
)
Expect(err).NotTo(HaveOccurred())
})

kubeVirtRTCheckerRoleBinding = newRoleBinding(kubeVirtRTCheckerRole.Name, checkupServiceAccount.Name, kubeVirtRTCheckerRole.Name)
kubeVirtRTCheckerRoleBinding, err = client.RbacV1().RoleBindings(testNamespace).Create(
kubeVirtRealTimeCheckerRoleBinding = newRoleBinding(
kubeVirtRealTimeCheckerRole.Name,
checkupServiceAccount.Name,
kubeVirtRealTimeCheckerRole.Name,
)
kubeVirtRealTimeCheckerRoleBinding, err = client.RbacV1().RoleBindings(testNamespace).Create(
context.Background(),
kubeVirtRTCheckerRoleBinding,
kubeVirtRealTimeCheckerRoleBinding,
metav1.CreateOptions{},
)
Expect(err).NotTo(HaveOccurred())

DeferCleanup(func() {
err = client.RbacV1().RoleBindings(kubeVirtRTCheckerRoleBinding.Namespace).Delete(
err = client.RbacV1().RoleBindings(kubeVirtRealTimeCheckerRoleBinding.Namespace).Delete(
context.Background(),
kubeVirtRTCheckerRoleBinding.Name,
kubeVirtRealTimeCheckerRoleBinding.Name,
metav1.DeleteOptions{},
)
Expect(err).NotTo(HaveOccurred())
Expand Down Expand Up @@ -238,10 +241,10 @@ func newKiagnoseConfigMapAccessRole() *rbacv1.Role {
}
}

func newKubeVirtRTCheckerRole() *rbacv1.Role {
func newKubeVirtRealTimeCheckerRole() *rbacv1.Role {
return &rbacv1.Role{
ObjectMeta: metav1.ObjectMeta{
Name: testKubeVirtRTCheckerRoleName,
Name: testKubeVirtRealTimeCheckerRoleName,
},
Rules: []rbacv1.PolicyRule{
{
Expand Down

0 comments on commit ae7edc1

Please sign in to comment.