File tree Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change 9
9
"fmt"
10
10
"io/ioutil"
11
11
"log"
12
- "os"
13
12
"strconv"
14
13
"time"
15
14
@@ -37,6 +36,7 @@ type DeployOptions struct {
37
36
ClusterNamespace string
38
37
TalosVersion string
39
38
KubernetesVersion string
39
+ TemplateFile string
40
40
Template []byte
41
41
ControlPlaneNodes int64
42
42
WorkerNodes int64
@@ -110,17 +110,7 @@ func WithKubernetesVersion(version string) DeployOption {
110
110
// WithTemplateFile load cluster template from the file.
111
111
func WithTemplateFile (path string ) DeployOption {
112
112
return func (o * DeployOptions ) error {
113
- f , err := os .Open (path )
114
- if err != nil {
115
- return err
116
- }
117
-
118
- defer f .Close () //nolint:errcheck
119
-
120
- o .Template , err = ioutil .ReadAll (f )
121
- if err != nil {
122
- return err
123
- }
113
+ o .TemplateFile = path
124
114
125
115
return nil
126
116
}
@@ -232,6 +222,10 @@ func (clusterAPI *Manager) DeployCluster(ctx context.Context, clusterName string
232
222
}
233
223
234
224
defer file .Close () //nolint:errcheck
225
+ } else if options .TemplateFile != "" {
226
+ templateOptions .URLSource = & client.URLSourceOptions {
227
+ URL : options .TemplateFile ,
228
+ }
235
229
}
236
230
237
231
vars , err := provider .ClusterVars (options .providerOptions )
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ type AWSDeployOptions struct {
73
73
VPCID string
74
74
Subnet string
75
75
CloudProviderVersion string
76
+ CalicoVersion string
76
77
ControlPlaneVolSize int64
77
78
NodeVolSize int64
78
79
}
@@ -87,6 +88,7 @@ func NewAWSDeployOptions() *AWSDeployOptions {
87
88
NodeMachineType : "t3.large" ,
88
89
NodeIAMProfile : "CAPI_AWS_Worker" ,
89
90
CloudProviderVersion : "v1.20.0-alpha.0" ,
91
+ CalicoVersion : "3.18" ,
90
92
}
91
93
}
92
94
@@ -182,6 +184,7 @@ func (s *AWSProvider) ClusterVars(opts interface{}) (Variables, error) {
182
184
"AWS_NODE_IAM_PROFILE" : deployOptions .NodeIAMProfile ,
183
185
"AWS_NODE_AMI_ID" : deployOptions .NodeAMIID ,
184
186
"AWS_CLOUD_PROVIDER_VERSION" : deployOptions .CloudProviderVersion ,
187
+ "CALICO_VERSION" : deployOptions .CalicoVersion ,
185
188
}
186
189
187
190
return vars , nil
You can’t perform that action at this time.
0 commit comments