@@ -36,6 +36,7 @@ import (
36
36
"github.com/replicatedhq/embedded-cluster/pkg/runtimeconfig"
37
37
"github.com/replicatedhq/embedded-cluster/pkg/spinner"
38
38
"github.com/replicatedhq/embedded-cluster/pkg/versions"
39
+ kotsv1beta1 "github.com/replicatedhq/kotskinds/apis/kots/v1beta1"
39
40
"github.com/sirupsen/logrus"
40
41
"github.com/spf13/cobra"
41
42
velerov1 "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
@@ -133,11 +134,13 @@ func runRestore(ctx context.Context, name string, flags InstallCmdFlags, rc runt
133
134
return err
134
135
}
135
136
137
+ var airgapInfo * kotsv1beta1.Airgap
136
138
if flags .isAirgap {
137
139
logrus .Debugf ("checking airgap bundle matches binary" )
138
140
139
141
// read file from path
140
- airgapInfo , err := airgap .AirgapInfoFromPath (flags .airgapBundle )
142
+ var err error
143
+ airgapInfo , err = airgap .AirgapInfoFromPath (flags .airgapBundle )
141
144
if err != nil {
142
145
return fmt .Errorf ("failed to get airgap bundle versions: %w" , err )
143
146
}
@@ -200,7 +203,7 @@ func runRestore(ctx context.Context, name string, flags InstallCmdFlags, rc runt
200
203
201
204
switch state {
202
205
case ecRestoreStateNew :
203
- err = runRestoreStepNew (ctx , name , flags , rc , & s3Store , skipStoreValidation )
206
+ err = runRestoreStepNew (ctx , name , flags , rc , & s3Store , skipStoreValidation , airgapInfo )
204
207
if err != nil {
205
208
return err
206
209
}
@@ -355,7 +358,7 @@ func runRestore(ctx context.Context, name string, flags InstallCmdFlags, rc runt
355
358
return nil
356
359
}
357
360
358
- func runRestoreStepNew (ctx context.Context , name string , flags InstallCmdFlags , rc runtimeconfig.RuntimeConfig , s3Store * s3BackupStore , skipStoreValidation bool ) error {
361
+ func runRestoreStepNew (ctx context.Context , name string , flags InstallCmdFlags , rc runtimeconfig.RuntimeConfig , s3Store * s3BackupStore , skipStoreValidation bool , airgapInfo * kotsv1beta1. Airgap ) error {
359
362
logrus .Debugf ("checking if k0s is already installed" )
360
363
err := verifyNoInstallation (name , "restore" )
361
364
if err != nil {
@@ -387,7 +390,7 @@ func runRestoreStepNew(ctx context.Context, name string, flags InstallCmdFlags,
387
390
}
388
391
389
392
logrus .Debugf ("running install preflights" )
390
- if err := runInstallPreflights (ctx , flags , rc , nil ); err != nil {
393
+ if err := runInstallPreflights (ctx , flags , rc , nil , airgapInfo ); err != nil {
391
394
if errors .Is (err , preflights .ErrPreflightsHaveFail ) {
392
395
return NewErrorNothingElseToAdd (err )
393
396
}
0 commit comments