@@ -168,94 +168,13 @@ func NewRuntimeInstallCommand() *cobra.Command {
168
168
)
169
169
170
170
cmd := & cobra.Command {
171
- Use : "install [runtime_name]" ,
172
- Short : "Install a new Codefresh runtime" ,
173
- Example : util .Doc (`
174
- # To run this command you need to create a personal access token for your git provider
175
- # and provide it using:
176
-
177
- export GIT_TOKEN=<token>
178
-
179
- # or with the flag:
180
-
181
- --git-token <token>
182
-
183
- # Adds a new runtime
184
-
185
- <BIN> runtime install runtime-name --repo gitops_repo
186
- ` ),
187
- PreRunE : func (cmd * cobra.Command , args []string ) error {
188
- ctx := cmd .Context ()
189
-
190
- if len (args ) > 0 {
191
- installationOpts .RuntimeName = args [0 ]
192
- }
193
-
194
- if installationOpts .GatewayName != "" {
195
- installationOpts .useGatewayAPI = true
196
- }
197
-
198
- installationOpts .RuntimeNamespace = installationOpts .RuntimeName
199
- namespace := cmd .Flag ("namespace" ).Value .String ()
200
- if namespace != "" {
201
- installationOpts .RuntimeNamespace = namespace
202
- }
203
-
204
- createAnalyticsReporter (ctx , reporter .InstallFlow , installationOpts .DisableTelemetry )
205
-
206
- if accessMode != "" {
207
- installationOpts .AccessMode = platmodel .AccessMode (strings .ToUpper (accessMode ))
208
- if ! installationOpts .AccessMode .IsValid () {
209
- return fmt .Errorf ("invalid access-mode %s, must be one of: ingress|tunnel" , accessMode )
210
- }
211
-
212
- if installationOpts .AccessMode == platmodel .AccessModeTunnel && installationOpts .IngressHost != "" {
213
- return fmt .Errorf ("ingress host can't be set when access mode is Tunnel" )
214
- }
215
- }
216
-
217
- err := runtimeInstallCommandPreRunHandler (cmd , installationOpts )
218
- handleCliStep (reporter .InstallPhasePreCheckFinish , "Finished pre installation checks" , err , true , false )
219
- if err != nil {
220
- if errors .Is (err , promptui .ErrInterrupt ) {
221
- return fmt .Errorf ("installation canceled by user" )
222
- }
223
-
224
- util .CheckNetworkErr (err )
225
-
226
- return util .DecorateErrorWithDocsLink (fmt .Errorf ("pre installation error: %w" , err ), store .Get ().RequirementsLink )
227
- }
228
-
229
- finalParameters := map [string ]string {
230
- "Codefresh context" : cfConfig .GetCurrentContext ().Name ,
231
- "Kube context" : installationOpts .kubeContext ,
232
- "Runtime name" : installationOpts .RuntimeName ,
233
- "Runtime namespace" : installationOpts .RuntimeNamespace ,
234
- "Repository URL" : installationOpts .InsCloneOpts .Repo ,
235
- "Ingress class" : installationOpts .IngressClass ,
236
- "Installing demo resources" : strconv .FormatBool (installationOpts .InstallDemoResources ),
237
- "Git provider" : string (installationOpts .gitProvider .Type ()),
238
- }
239
-
240
- if installationOpts .AccessMode == platmodel .AccessModeTunnel {
241
- finalParameters ["Tunnel URL" ] = installationOpts .IngressHost
242
- finalParameters ["Access mode" ] = "Codefresh tunnel-based"
243
- } else {
244
- finalParameters ["Ingress host" ] = installationOpts .IngressHost
245
- finalParameters ["Internal ingress host" ] = installationOpts .InternalIngressHost
246
- finalParameters ["Access mode" ] = "Ingress-based"
247
- }
248
-
249
- if err := getApprovalFromUser (ctx , finalParameters , "runtime install" ); err != nil {
250
- return err
251
- }
252
-
253
- return nil
254
- },
171
+ Use : "install [runtime_name]" ,
172
+ Deprecated : "We have transitioned our GitOps Runtimes from CLI-based to Helm-based installation." ,
255
173
RunE : func (cmd * cobra.Command , _ []string ) error {
256
- err := runRuntimeInstall (cmd , installationOpts )
257
- handleCliStep (reporter .InstallPhaseFinish , "Runtime installation phase finished" , err , false , false )
258
- return err
174
+ return errors .New (`We have transitioned our GitOps Runtimes from CLI-based to Helm-based installation.
175
+ As of January 30, 2024, CLI-based Runtimes are no longer supported.
176
+ If you're currently using CLI-based Hybrid GitOps Runtimes, we encourage you to migrate to Helm by following our migration guidelines (https://codefresh.io/docs/docs/installation/gitops/migrate-cli-runtimes-helm).
177
+ For Helm installation, review our documentation on installing Hybrid GitOps Runtimes (https://codefresh.io/docs/docs/installation/gitops/hybrid-gitops-helm-installation).` )
259
178
},
260
179
}
261
180
@@ -313,6 +232,75 @@ func NewRuntimeInstallCommand() *cobra.Command {
313
232
return cmd
314
233
}
315
234
235
+ func PreRunE (cmd * cobra.Command , args []string , installationOpts * RuntimeInstallOptions , accessMode string ) error {
236
+ ctx := cmd .Context ()
237
+
238
+ if len (args ) > 0 {
239
+ installationOpts .RuntimeName = args [0 ]
240
+ }
241
+
242
+ if installationOpts .GatewayName != "" {
243
+ installationOpts .useGatewayAPI = true
244
+ }
245
+
246
+ installationOpts .RuntimeNamespace = installationOpts .RuntimeName
247
+ namespace := cmd .Flag ("namespace" ).Value .String ()
248
+ if namespace != "" {
249
+ installationOpts .RuntimeNamespace = namespace
250
+ }
251
+
252
+ createAnalyticsReporter (ctx , reporter .InstallFlow , installationOpts .DisableTelemetry )
253
+
254
+ if accessMode != "" {
255
+ installationOpts .AccessMode = platmodel .AccessMode (strings .ToUpper (accessMode ))
256
+ if ! installationOpts .AccessMode .IsValid () {
257
+ return fmt .Errorf ("invalid access-mode %s, must be one of: ingress|tunnel" , accessMode )
258
+ }
259
+
260
+ if installationOpts .AccessMode == platmodel .AccessModeTunnel && installationOpts .IngressHost != "" {
261
+ return fmt .Errorf ("ingress host can't be set when access mode is Tunnel" )
262
+ }
263
+ }
264
+
265
+ err := runtimeInstallCommandPreRunHandler (cmd , installationOpts )
266
+ handleCliStep (reporter .InstallPhasePreCheckFinish , "Finished pre installation checks" , err , true , false )
267
+ if err != nil {
268
+ if errors .Is (err , promptui .ErrInterrupt ) {
269
+ return fmt .Errorf ("installation canceled by user" )
270
+ }
271
+
272
+ util .CheckNetworkErr (err )
273
+
274
+ return util .DecorateErrorWithDocsLink (fmt .Errorf ("pre installation error: %w" , err ), store .Get ().RequirementsLink )
275
+ }
276
+
277
+ finalParameters := map [string ]string {
278
+ "Codefresh context" : cfConfig .GetCurrentContext ().Name ,
279
+ "Kube context" : installationOpts .kubeContext ,
280
+ "Runtime name" : installationOpts .RuntimeName ,
281
+ "Runtime namespace" : installationOpts .RuntimeNamespace ,
282
+ "Repository URL" : installationOpts .InsCloneOpts .Repo ,
283
+ "Ingress class" : installationOpts .IngressClass ,
284
+ "Installing demo resources" : strconv .FormatBool (installationOpts .InstallDemoResources ),
285
+ "Git provider" : string (installationOpts .gitProvider .Type ()),
286
+ }
287
+
288
+ if installationOpts .AccessMode == platmodel .AccessModeTunnel {
289
+ finalParameters ["Tunnel URL" ] = installationOpts .IngressHost
290
+ finalParameters ["Access mode" ] = "Codefresh tunnel-based"
291
+ } else {
292
+ finalParameters ["Ingress host" ] = installationOpts .IngressHost
293
+ finalParameters ["Internal ingress host" ] = installationOpts .InternalIngressHost
294
+ finalParameters ["Access mode" ] = "Ingress-based"
295
+ }
296
+
297
+ if err := getApprovalFromUser (ctx , finalParameters , "runtime install" ); err != nil {
298
+ return err
299
+ }
300
+
301
+ return nil
302
+ }
303
+
316
304
func runtimeInstallCommandPreRunHandler (cmd * cobra.Command , opts * RuntimeInstallOptions ) error {
317
305
var err error
318
306
ctx := cmd .Context ()
@@ -643,7 +631,7 @@ func createRuntimeOnPlatform(ctx context.Context, opts *RuntimeInstallOptions, r
643
631
return runtimeCreationResponse .NewAccessToken , hex .EncodeToString (iv ), nil
644
632
}
645
633
646
- func runRuntimeInstall (cmd * cobra.Command , opts * RuntimeInstallOptions ) error {
634
+ func RunRuntimeInstall (cmd * cobra.Command , opts * RuntimeInstallOptions ) error {
647
635
ctx := cmd .Context ()
648
636
rt , err := preInstallationChecks (cmd , opts )
649
637
handleCliStep (reporter .InstallPhaseRunPreCheckFinish , "Pre run installation checks" , err , true , true )
0 commit comments