@@ -401,16 +401,21 @@ func StartServer(ctx context.Context, log logr.Logger, tempDir string, p Params)
401
401
return fmt .Errorf ("could not parse auth methods: %w" , err )
402
402
}
403
403
404
- cobra .CheckErr (capiv1 .AddToScheme (clustersManagerScheme ))
405
- cobra .CheckErr (pacv2beta1 .AddToScheme (clustersManagerScheme ))
406
- cobra .CheckErr (pacv2beta2 .AddToScheme (clustersManagerScheme ))
407
- cobra .CheckErr (esv1beta1 .AddToScheme (clustersManagerScheme ))
408
- cobra .CheckErr (flaggerv1beta1 .AddToScheme (clustersManagerScheme ))
409
- cobra .CheckErr (pipelinev1alpha1 .AddToScheme (clustersManagerScheme ))
410
- cobra .CheckErr (tfctrl .AddToScheme (clustersManagerScheme ))
411
- cobra .CheckErr (gitopsv1alpha1 .AddToScheme (clustersManagerScheme ))
412
- cobra .CheckErr (clusterv1 .AddToScheme (clustersManagerScheme ))
413
- cobra .CheckErr (gapiv1 .AddToScheme (clustersManagerScheme ))
404
+ builder := runtime .NewSchemeBuilder (
405
+ capiv1 .AddToScheme ,
406
+ pacv2beta1 .AddToScheme ,
407
+ pacv2beta2 .AddToScheme ,
408
+ esv1beta1 .AddToScheme ,
409
+ flaggerv1beta1 .AddToScheme ,
410
+ pipelinev1alpha1 .AddToScheme ,
411
+ tfctrl .AddToScheme ,
412
+ gitopsv1alpha1 .AddToScheme ,
413
+ clusterv1 .AddToScheme ,
414
+ gapiv1 .AddToScheme ,
415
+ )
416
+ if err := builder .AddToScheme (clustersManagerScheme ); err != nil {
417
+ return err
418
+ }
414
419
415
420
mgmtCluster , err := cluster .NewSingleCluster (p .Cluster , rest , clustersManagerScheme , cluster .DefaultKubeConfigOptions ... )
416
421
if err != nil {
0 commit comments