-
Notifications
You must be signed in to change notification settings - Fork 88
/
preflight_airgap.go
30 lines (27 loc) · 1.1 KB
/
preflight_airgap.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package reporting
import (
"github.com/pkg/errors"
reportingtypes "github.com/replicatedhq/kots/pkg/api/reporting/types"
"github.com/replicatedhq/kots/pkg/buildversion"
"github.com/replicatedhq/kots/pkg/store"
storetypes "github.com/replicatedhq/kots/pkg/store/types"
kotsv1beta1 "github.com/replicatedhq/kotskinds/apis/kots/v1beta1"
)
func (r *AirgapReporter) SubmitPreflightData(license *kotsv1beta1.License, appID string, clusterID string, sequence int64, skipPreflights bool, installStatus storetypes.DownstreamVersionStatus, isCLI bool, preflightStatus string, appStatus string) error {
status := &reportingtypes.PreflightStatus{
InstanceID: appID,
ClusterID: clusterID,
Sequence: sequence,
SkipPreflights: skipPreflights,
InstallStatus: string(installStatus),
IsCLI: isCLI,
PreflightStatus: preflightStatus,
AppStatus: preflightStatus,
KOTSVersion: buildversion.Version(),
}
err := store.GetStore().SavePreflightReport(license.Spec.LicenseID, status)
if err != nil {
return errors.Wrap(err, "failed to save preflight report")
}
return nil
}