Skip to content

Commit

Permalink
Use clusercsidrivers as RelatedObjects
Browse files Browse the repository at this point in the history
  • Loading branch information
jsafrane committed Jul 28, 2020
1 parent 77fdba1 commit c3fb694
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions pkg/operator/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,18 @@ func RunOperator(ctx context.Context, controllerConfig *controllercmd.Controller
controllerConfig.EventRecorder,
)

relatedObjects := []configv1.ObjectReference{
{Resource: "namespaces", Name: operatorNamespace},
{Resource: "namespaces", Name: csoclients.CSIOperatorNamespace},
{Group: operatorv1.GroupName, Resource: "storages", Name: operatorclient.GlobalConfigName},
// Sync with operatorv1.CSIDriverName consts!
{Group: operatorv1.GroupName, Resource: "clustercsidrivers", Name: string(operatorv1.AWSEBSCSIDriver)},
// TODO: remove when the driver moves to csidriveroperator.CSIOperatorNamespace
{Resource: "namespaces", Name: "openshift-aws-ebs-csi-driver"},
}
clusterOperatorStatus := status.NewClusterOperatorStatusController(
clusterOperatorName,
[]configv1.ObjectReference{
{Resource: "namespaces", Name: operatorNamespace},
{Resource: "namespaces", Name: csoclients.CSIOperatorNamespace},
{Group: operatorv1.GroupName, Resource: "storages", Name: operatorclient.GlobalConfigName},
{Group: "csi.openshift.io", Resource: "awsebsdrivers", Name: operatorclient.GlobalConfigName},

// TODO: remove when the driver moves to csidriveroperator.CSIOperatorNamespace
{Resource: "namespaces", Name: "openshift-aws-ebs-csi-driver"},
},
relatedObjects,
clients.ConfigClientSet.ConfigV1(),
clients.ConfigInformers.Config().V1().ClusterOperators(),
clients.OperatorClient,
Expand Down

0 comments on commit c3fb694

Please sign in to comment.