File tree 2 files changed +43
-0
lines changed
2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ package components
2
+
3
+ import (
4
+ "fmt"
5
+
6
+ "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/yaml"
7
+ "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
8
+ )
9
+
10
+ // The configuration for Flux.
11
+ type Flux struct {
12
+ Version string
13
+ }
14
+
15
+ // Install sets up Flux in the cluster.
16
+ func (component * Flux ) Install (
17
+ ctx * pulumi.Context ,
18
+ name string ,
19
+ ) ([]pulumi.Resource , error ) {
20
+ flux , err := yaml .NewConfigFile (ctx , name , & yaml.ConfigFileArgs {
21
+ File : fmt .Sprintf (
22
+ "https://github.com/fluxcd/flux2/releases/download/v%s/install.yaml" ,
23
+ component .Version ,
24
+ ),
25
+ })
26
+ if err != nil {
27
+ return nil , fmt .Errorf ("%w: %w" , errPulumi , err )
28
+ }
29
+
30
+ return []pulumi.Resource {flux }, nil
31
+ }
Original file line number Diff line number Diff line change @@ -58,6 +58,16 @@ func ProgramForLocalCluster(ctx *pulumi.Context) error {
58
58
os .Exit (1 )
59
59
}
60
60
61
+ flux , err := components .AddComponent (
62
+ ctx ,
63
+ "flux" ,
64
+ & components.Flux {Version : "2.3.0" },
65
+ )
66
+ if err != nil {
67
+ log .Println (err )
68
+ os .Exit (1 )
69
+ }
70
+
61
71
tektonPipelines , err := components .AddComponent (
62
72
ctx ,
63
73
"tekton-pipelines" ,
@@ -83,6 +93,7 @@ func ProgramForLocalCluster(ctx *pulumi.Context) error {
83
93
"tekton-dashboard" ,
84
94
& components.TektonDashboard {Version : "0.45.0" },
85
95
))
96
+
86
97
components .Check (components .AddComponent (
87
98
ctx ,
88
99
"rebuild-nativelink" ,
@@ -93,6 +104,7 @@ func ProgramForLocalCluster(ctx *pulumi.Context) error {
93
104
tektonTriggers ,
94
105
localSources ,
95
106
nixStore ,
107
+ flux ,
96
108
),
97
109
},
98
110
))
You can’t perform that action at this time.
0 commit comments