Skip to content

Commit

Permalink
Merge pull request #24 from Fedosin/secret_update
Browse files Browse the repository at this point in the history
Bug 1908998: add secret hash annotation hook to the controller
  • Loading branch information
openshift-merge-robot committed Jan 26, 2021
2 parents ebf0afc + 150d611 commit 117ce62
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/operator/starter.go
Expand Up @@ -28,12 +28,14 @@ const (
operatorName = "openstack-cinder-csi-driver-operator"
operandName = "openstack-cinder-csi-driver"
instanceName = "cinder.csi.openstack.org"
secretName = "openstack-cloud-credentials"
)

func RunOperator(ctx context.Context, controllerConfig *controllercmd.ControllerContext) error {
// Create clientsets and informers
kubeClient := kubeclient.NewForConfigOrDie(rest.AddUserAgent(controllerConfig.KubeConfig, operatorName))
kubeInformersForNamespaces := v1helpers.NewKubeInformersForNamespaces(kubeClient, defaultNamespace, "")
secretInformer := kubeInformersForNamespaces.InformersFor(defaultNamespace).Core().V1().Secrets()

// Create config clientset and informer. This is used to get the cluster ID
configClient := configclient.NewForConfigOrDie(rest.AddUserAgent(controllerConfig.KubeConfig, operatorName))
Expand Down Expand Up @@ -85,6 +87,7 @@ func RunOperator(ctx context.Context, controllerConfig *controllercmd.Controller
kubeClient,
kubeInformersForNamespaces.InformersFor(defaultNamespace),
nil,
csidrivercontrollerservicecontroller.WithSecretHashAnnotationHook(defaultNamespace, secretName, secretInformer),
csidrivercontrollerservicecontroller.WithObservedProxyDeploymentHook(),
).WithCSIDriverNodeService(
"OpenStackCinderDriverNodeServiceController",
Expand All @@ -93,7 +96,7 @@ func RunOperator(ctx context.Context, controllerConfig *controllercmd.Controller
kubeClient,
kubeInformersForNamespaces.InformersFor(defaultNamespace),
csidrivernodeservicecontroller.WithObservedProxyDaemonSetHook(),
).WithExtraInformers(configInformers.Config().V1().Proxies().Informer())
).WithExtraInformers(configInformers.Config().V1().Proxies().Informer(), secretInformer.Informer())

if err != nil {
return err
Expand Down

0 comments on commit 117ce62

Please sign in to comment.