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