/
install_operator.go
50 lines (41 loc) · 1.03 KB
/
install_operator.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package install
import (
"time"
"github.com/syndesisio/syndesis/install/operator/pkg/util"
)
func (o *Install) installOperatorResources() error {
resources, err := o.render("assets/install/role.yml.tmpl")
if err != nil {
return err
}
oinstall, err := o.render("assets/install/operator_install.yml.tmpl")
if err != nil {
return err
}
resources = append(resources, oinstall...)
deployment, err := o.render("assets/install/operator_deployment.yml.tmpl")
if err != nil {
return err
}
resources = append(resources, deployment...)
if o.ejectedResources != nil {
o.ejectedResources = append(o.ejectedResources, resources...)
} else {
for _, res := range resources {
res.SetNamespace(o.Namespace)
}
err := o.install("operator was", resources)
if err != nil {
return err
}
client, err := o.ClientTools().DynamicClient()
if err != nil {
return err
}
_, err = util.WaitForDeploymentReady(o.Context, client, o.Namespace, "syndesis-operator", 2*time.Second)
if err != nil {
return err
}
}
return err
}