@@ -121,6 +121,36 @@ func TestClusterManagerConfig(t *testing.T) {
121121 },
122122 expectedObjCnt : 9 ,
123123 },
124+ {
125+ name : "enable grpc " ,
126+ namespace : "multicluster-engine" ,
127+ chartConfig : func () * ClusterManagerChartConfig {
128+ config := NewDefaultClusterManagerChartConfig ()
129+ config .CreateBootstrapSA = true
130+ config .ClusterManager .RegistrationConfiguration .RegistrationDrivers = append (
131+ config .ClusterManager .RegistrationConfiguration .RegistrationDrivers , operatorv1.RegistrationDriverHub {
132+ AuthType : "grpc" ,
133+ GRPC : & operatorv1.GRPCRegistrationConfig {AutoApprovedIdentities : []string {"user:test" }},
134+ })
135+
136+ config .ClusterManager .ServerConfiguration = operatorv1.ServerConfiguration {
137+ EndpointsExposure : []operatorv1.EndpointExposure {
138+ {
139+ Usage : "" ,
140+ Protocol : "grpc" ,
141+ GRPC : & operatorv1.Endpoint {
142+ Type : "hostname" ,
143+ Hostname : & operatorv1.HostnameConfig {
144+ Host : "host.com" ,
145+ },
146+ },
147+ },
148+ },
149+ }
150+ return config
151+ },
152+ expectedObjCnt : 8 ,
153+ },
124154 }
125155
126156 for _ , c := range cases {
@@ -202,6 +232,14 @@ func TestClusterManagerConfig(t *testing.T) {
202232 t .Errorf ("failed to render auto approve users" )
203233 }
204234 }
235+ registrationDrivers := config .ClusterManager .RegistrationConfiguration .RegistrationDrivers
236+ for _ , driver := range registrationDrivers {
237+ if driver .AuthType == operatorv1 .GRPCAuthType {
238+ if len (config .ClusterManager .ServerConfiguration .EndpointsExposure ) == 0 {
239+ t .Errorf ("failed to render serverConfiguration" )
240+ }
241+ }
242+ }
205243 case * corev1.Secret :
206244 switch object .Name {
207245 case "open-cluster-management-image-pull-credentials" :
0 commit comments