File tree 2 files changed +14
-2
lines changed
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -209,7 +209,6 @@ func RunMicroshift(cfg *config.Config) error {
209
209
util .Must (m .AddService (controllers .NewInfrastructureServices (cfg )))
210
210
util .Must (m .AddService (controllers .NewClusterPolicyController (cfg )))
211
211
util .Must (m .AddService (controllers .NewVersionManager (cfg )))
212
- util .Must (m .AddService (kustomize .NewKustomizer (cfg )))
213
212
util .Must (m .AddService (node .NewKubeletServer (cfg )))
214
213
util .Must (m .AddService (loadbalancerservice .NewLoadbalancerServiceController (cfg )))
215
214
util .Must (m .AddService (controllers .NewKubeStorageVersionMigrator (cfg )))
@@ -273,6 +272,9 @@ func RunMicroshift(cfg *config.Config) error {
273
272
klog .Info ("service does not support sd_notify readiness messages" )
274
273
}
275
274
275
+ // After MicroShift's core becomes ready, run the kustomizer (delete and/or apply manifests).
276
+ kustomize .NewKustomizer (cfg ).RunStandalone (runCtx )
277
+
276
278
// Watch for SIGTERM to exit, now that we are ready.
277
279
<- sigTerm
278
280
klog .Info ("Interrupt received" )
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package kustomize
2
2
3
3
import (
4
4
"context"
5
+ "errors"
5
6
"fmt"
6
7
"os"
7
8
"time"
@@ -21,7 +22,7 @@ import (
21
22
22
23
const (
23
24
retryInterval = 10 * time .Second
24
- retryTimeout = 1 * time .Minute
25
+ retryTimeout = 10 * time .Minute
25
26
)
26
27
27
28
type Kustomizer struct {
@@ -39,6 +40,15 @@ func NewKustomizer(cfg *config.Config) *Kustomizer {
39
40
func (s * Kustomizer ) Name () string { return "kustomizer" }
40
41
func (s * Kustomizer ) Dependencies () []string { return []string {"kube-apiserver" } }
41
42
43
+ func (s * Kustomizer ) RunStandalone (ctx context.Context ) {
44
+ ready , stopped := make (chan struct {}), make (chan struct {})
45
+ go func () {
46
+ if err := s .Run (ctx , ready , stopped ); err != nil && ! errors .Is (err , context .Canceled ) {
47
+ klog .Errorf ("Kustomizer failed: %v" , err )
48
+ }
49
+ }()
50
+ }
51
+
42
52
func (s * Kustomizer ) Run (ctx context.Context , ready chan <- struct {}, stopped chan <- struct {}) error {
43
53
defer close (stopped )
44
54
defer close (ready )
You can’t perform that action at this time.
0 commit comments