@@ -10,6 +10,7 @@ import (
10
10
features "github.com/openshift/api/features"
11
11
"github.com/openshift/machine-config-operator/cmd/common"
12
12
"github.com/openshift/machine-config-operator/internal/clients"
13
+ certrotationcontroller "github.com/openshift/machine-config-operator/pkg/controller/certrotation"
13
14
ctrlcommon "github.com/openshift/machine-config-operator/pkg/controller/common"
14
15
containerruntimeconfig "github.com/openshift/machine-config-operator/pkg/controller/container-runtime-config"
15
16
"github.com/openshift/machine-config-operator/pkg/controller/drain"
@@ -83,6 +84,18 @@ func runStartCmd(_ *cobra.Command, _ []string) {
83
84
ctrlctx .FeatureGateAccess ,
84
85
)
85
86
87
+ certrotationcontroller , err := certrotationcontroller .New (
88
+ ctrlctx .ClientBuilder .KubeClientOrDie ("cert-rotation-controller" ),
89
+ ctrlctx .ClientBuilder .ConfigClientOrDie ("cert-rotation-controller" ),
90
+ ctrlctx .ClientBuilder .MachineClientOrDie ("cert-rotation-controller" ),
91
+ ctrlctx .KubeMAOSharedInformer .Core ().V1 ().Secrets (),
92
+ ctrlctx .KubeNamespacedInformerFactory .Core ().V1 ().Secrets (),
93
+ ctrlctx .KubeNamespacedInformerFactory .Core ().V1 ().ConfigMaps (),
94
+ )
95
+ if err != nil {
96
+ klog .Fatalf ("unable to start cert rotation controller: %v" , err )
97
+ }
98
+
86
99
// Start the shared factory informers that you need to use in your controller
87
100
ctrlctx .InformerFactory .Start (ctrlctx .Stop )
88
101
ctrlctx .KubeInformerFactory .Start (ctrlctx .Stop )
@@ -150,6 +163,7 @@ func runStartCmd(_ *cobra.Command, _ []string) {
150
163
go c .Run (2 , ctrlctx .Stop )
151
164
}
152
165
go draincontroller .Run (5 , ctrlctx .Stop )
166
+ go certrotationcontroller .Run (ctx , 1 )
153
167
154
168
// wait here in this function until the context gets cancelled (which tells us when we are being shut down)
155
169
<- ctx .Done ()
0 commit comments