@@ -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 )
@@ -57,6 +67,10 @@ func (s *Kustomizer) Run(ctx context.Context, ready chan<- struct{}, stopped cha
57
67
}
58
68
59
69
for _ , path := range kustomizationPaths {
70
+ // TODO: Should these happen in parallel?
71
+ // Or there's no need? Even if ai-model-serving blocks for 5 minutes,
72
+ // the manifests that come after should immediately be applied
73
+ // (unless they also depend on some webhook that isn't up yet).
60
74
s .handleKustomizationPath (ctx , path , "Applying" , applyKustomization )
61
75
}
62
76
0 commit comments