-
Notifications
You must be signed in to change notification settings - Fork 88
/
types.go
84 lines (74 loc) · 1.44 KB
/
types.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package reporting
import (
"github.com/replicatedhq/kots/pkg/store"
storetypes "github.com/replicatedhq/kots/pkg/store/types"
kotsv1beta1 "github.com/replicatedhq/kotskinds/apis/kots/v1beta1"
"k8s.io/client-go/kubernetes"
)
type Distribution int64
const (
UnknownDistribution Distribution = iota
AKS
DigitalOcean
EKS
GKE
GKEAutoPilot
K0s
K3s
Kind
Kurl
MicroK8s
Minikube
OKE
OpenShift
RKE2
Tanzu
)
type Reporter interface {
SubmitAppInfo(appID string) error
SubmitPreflightData(license *kotsv1beta1.License, appID string, clusterID string, sequence int64, skipPreflights bool, installStatus storetypes.DownstreamVersionStatus, isCLI bool, preflightStatus string, appStatus string) error
}
var reporter Reporter
type AirgapReporter struct {
clientset kubernetes.Interface
store store.Store
}
var _ Reporter = &AirgapReporter{}
type OnlineReporter struct {
}
var _ Reporter = &OnlineReporter{}
func (d Distribution) String() string {
switch d {
case AKS:
return "aks"
case DigitalOcean:
return "digital-ocean"
case EKS:
return "eks"
case GKE:
return "gke"
case GKEAutoPilot:
return "gke-autopilot"
case K0s:
return "k0s"
case K3s:
return "k3s"
case Kind:
return "kind"
case Kurl:
return "kurl"
case MicroK8s:
return "microk8s"
case Minikube:
return "minikube"
case OKE:
return "oke"
case OpenShift:
return "openshift"
case RKE2:
return "rke2"
case Tanzu:
return "tanzu"
}
return "unknown"
}