@@ -18,6 +18,7 @@ package aggregated
1818
1919import (
2020 "bytes"
21+ "strings"
2122 "testing"
2223
2324 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -29,9 +30,11 @@ import (
2930)
3031
3132var (
32- apiSvcName = v1alpha1 .SchemeGroupVersion .Version + "." + v1alpha1 .GroupName
33- apiGroup = v1alpha1 .GroupName
34- apiVersion = v1alpha1 .SchemeGroupVersion .Version
33+ apiServerName = strings .Replace (v1alpha1 .GroupName , "." , "-" , - 1 ) + "-apiserver"
34+ crLabel = strings .Split (v1alpha1 .GroupName , "." )[0 ]
35+ apiSvcName = v1alpha1 .SchemeGroupVersion .Version + "." + v1alpha1 .GroupName
36+ apiGroup = v1alpha1 .GroupName
37+ apiVersion = v1alpha1 .SchemeGroupVersion .Version
3538)
3639
3740func TestCreateRBACObjects (t * testing.T ) {
@@ -76,6 +79,15 @@ func TestCreateRBACObjects(t *testing.T) {
7679 if createdRBACObj == nil {
7780 t .Errorf ("Failed to create RBAC Object" )
7881 }
82+ if createdRBACObj .ObjectMeta .Name != apiServerName {
83+ t .Errorf ("Unexpected API Server Created. Expected %v, got %v" , apiServerName , createdRBACObj .ObjectMeta .Name )
84+ }
85+ if createdRBACObj .ObjectMeta .Namespace != tc .opts .ClusterRegistryNamespace {
86+ t .Errorf ("Namespace contents do not match" )
87+ }
88+ if createdRBACObj .ObjectMeta .Labels ["app" ] != crLabel {
89+ t .Errorf ("Unexpected Label given to test instance. Expected %v, got %v" , crLabel , createdRBACObj .ObjectMeta .Labels ["app" ])
90+ }
7991 } else {
8092 if createdRBACObj != nil {
8193 t .Errorf ("Expected no RBAC Object but got: %v" , createdRBACObj )
0 commit comments