File tree 1 file changed +12
-8
lines changed
components/ws-manager/cmd 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -200,14 +200,18 @@ var runCmd = &cobra.Command{
200
200
log .WithError (err ).Fatal (err , "unable to create controller" , "controller" , "Pod" )
201
201
}
202
202
203
- err = (& manager.VolumeSnapshotReconciler {
204
- Monitor : monitor ,
205
- Client : mgr .GetClient (),
206
- Log : ctrl .Log .WithName ("controllers" ).WithName ("VolumeSnapshot" ),
207
- Scheme : mgr .GetScheme (),
208
- }).SetupWithManager (mgr )
209
- if err != nil {
210
- log .WithError (err ).Fatal (err , "unable to create controller" , "controller" , "VolumeSnapshot" )
203
+ // enable the volume snapshot controller when the VolumeSnapshot CRD exists
204
+ _ , err = clientset .DiscoveryClient .ServerResourcesForGroupVersion (volumesnapshotv1 .SchemeGroupVersion .String ())
205
+ if err == nil {
206
+ err = (& manager.VolumeSnapshotReconciler {
207
+ Monitor : monitor ,
208
+ Client : mgr .GetClient (),
209
+ Log : ctrl .Log .WithName ("controllers" ).WithName ("VolumeSnapshot" ),
210
+ Scheme : mgr .GetScheme (),
211
+ }).SetupWithManager (mgr )
212
+ if err != nil {
213
+ log .WithError (err ).Fatal (err , "unable to create controller" , "controller" , "VolumeSnapshot" )
214
+ }
211
215
}
212
216
213
217
if cfg .PProf .Addr != "" {
You can’t perform that action at this time.
0 commit comments