reporting

package
v1.121.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReportSecretNameFormat = "kotsadm-%s-report"
	ReportSecretKey        = "report"
	ReportEventLimit       = 4000
	ReportSizeLimit        = 1 * 1024 * 1024 // 1MB
)

Variables

This section is empty.

Functions

func AppendReport added in v1.104.0

func AppendReport(clientset kubernetes.Interface, namespace string, appSlug string, report Report) error

func EncodeReport added in v1.104.0

func EncodeReport(r Report) ([]byte, error)

func GetReportingInfo

func GetReportingInfo(appID string) *types.ReportingInfo

func GetReportingInfoHeaders added in v1.103.2

func GetReportingInfoHeaders(reportingInfo *types.ReportingInfo) map[string]string

func Init

func Init() error

func InjectReportingInfoHeaders

func InjectReportingInfoHeaders(req *http.Request, reportingInfo *types.ReportingInfo)

func WaitAndReportPreflightChecks added in v1.98.0

func WaitAndReportPreflightChecks(appID string, sequence int64, isSkipPreflights bool, isCLI bool) error

Types

type AirgapReporter added in v1.98.0

type AirgapReporter struct {
	// contains filtered or unexported fields
}

func (*AirgapReporter) SubmitAppInfo added in v1.98.0

func (r *AirgapReporter) SubmitAppInfo(appID string) error

func (*AirgapReporter) SubmitPreflightData added in v1.98.0

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

type Distribution added in v1.100.3

type Distribution int64
const (
	UnknownDistribution Distribution = iota
	AKS
	DigitalOcean
	EKS
	GKE
	GKEAutoPilot
	K0s
	K3s
	Kind
	Kurl
	MicroK8s
	Minikube
	OKE
	OpenShift
	RKE2
	Tanzu
	EmbeddedCluster
)

func GetDistribution added in v1.100.3

func GetDistribution(clientset kubernetes.Interface) Distribution

func (Distribution) String added in v1.100.3

func (d Distribution) String() string

type InstanceReport added in v1.104.0

type InstanceReport struct {
	Events []InstanceReportEvent `json:"events"`
}

func BuildInstanceReport added in v1.104.0

func BuildInstanceReport(licenseID string, reportingInfo *types.ReportingInfo) *InstanceReport

func (*InstanceReport) AppendEvents added in v1.104.0

func (r *InstanceReport) AppendEvents(report Report) error

func (*InstanceReport) GetEventLimit added in v1.104.0

func (r *InstanceReport) GetEventLimit() int

func (*InstanceReport) GetMtx added in v1.104.0

func (r *InstanceReport) GetMtx() *sync.Mutex

func (*InstanceReport) GetSecretKey added in v1.104.0

func (r *InstanceReport) GetSecretKey() string

func (*InstanceReport) GetSecretName added in v1.104.0

func (r *InstanceReport) GetSecretName(appSlug string) string

func (*InstanceReport) GetSizeLimit added in v1.104.1

func (r *InstanceReport) GetSizeLimit() int

func (*InstanceReport) GetType added in v1.104.0

func (r *InstanceReport) GetType() ReportType

type InstanceReportEvent added in v1.104.0

type InstanceReportEvent struct {
	ReportedAt                int64  `json:"reported_at"`
	LicenseID                 string `json:"license_id"`
	InstanceID                string `json:"instance_id"`
	ClusterID                 string `json:"cluster_id"`
	AppStatus                 string `json:"app_status"`
	IsKurl                    bool   `json:"is_kurl"`
	KurlNodeCountTotal        int    `json:"kurl_node_count_total"`
	KurlNodeCountReady        int    `json:"kurl_node_count_ready"`
	K8sVersion                string `json:"k8s_version"`
	K8sDistribution           string `json:"k8s_distribution,omitempty"`
	UserAgent                 string `json:"user_agent"`
	KotsInstallID             string `json:"kots_install_id,omitempty"`
	KurlInstallID             string `json:"kurl_install_id,omitempty"`
	EmbeddedClusterID         string `json:"embedded_cluster_id,omitempty"`
	EmbeddedClusterVersion    string `json:"embedded_cluster_version,omitempty"`
	IsGitOpsEnabled           bool   `json:"is_gitops_enabled"`
	GitOpsProvider            string `json:"gitops_provider"`
	SnapshotProvider          string `json:"snapshot_provider"`
	SnapshotFullSchedule      string `json:"snapshot_full_schedule"`
	SnapshotFullTTL           string `json:"snapshot_full_ttl"`
	SnapshotPartialSchedule   string `json:"snapshot_partial_schedule"`
	SnapshotPartialTTL        string `json:"snapshot_partial_ttl"`
	DownstreamChannelID       string `json:"downstream_channel_id,omitempty"`
	DownstreamChannelSequence uint64 `json:"downstream_channel_sequence,omitempty"`
	DownstreamChannelName     string `json:"downstream_channel_name,omitempty"`
	DownstreamSequence        *int64 `json:"downstream_sequence,omitempty"`
	DownstreamSource          string `json:"downstream_source,omitempty"`
	InstallStatus             string `json:"install_status,omitempty"`
	PreflightState            string `json:"preflight_state,omitempty"`
	SkipPreflights            bool   `json:"skip_preflights"`
	ReplHelmInstalls          int    `json:"repl_helm_installs"`
	NativeHelmInstalls        int    `json:"native_helm_installs"`
}

type OnlineReporter added in v1.98.0

type OnlineReporter struct {
}

func (*OnlineReporter) SubmitAppInfo added in v1.98.0

func (r *OnlineReporter) SubmitAppInfo(appID string) error

func (*OnlineReporter) SubmitPreflightData added in v1.98.0

func (r *OnlineReporter) SubmitPreflightData(license *kotsv1beta1.License, appID string, clusterID string, sequence int64, skipPreflights bool, installStatus storetypes.DownstreamVersionStatus, isCLI bool, preflightStatus string, appStatus string) error

type PreflightReport added in v1.104.0

type PreflightReport struct {
	Events []PreflightReportEvent `json:"events"`
}

func (*PreflightReport) AppendEvents added in v1.104.0

func (r *PreflightReport) AppendEvents(report Report) error

func (*PreflightReport) GetEventLimit added in v1.104.0

func (r *PreflightReport) GetEventLimit() int

func (*PreflightReport) GetMtx added in v1.104.0

func (r *PreflightReport) GetMtx() *sync.Mutex

func (*PreflightReport) GetSecretKey added in v1.104.0

func (r *PreflightReport) GetSecretKey() string

func (*PreflightReport) GetSecretName added in v1.104.0

func (r *PreflightReport) GetSecretName(appSlug string) string

func (*PreflightReport) GetSizeLimit added in v1.104.1

func (r *PreflightReport) GetSizeLimit() int

func (*PreflightReport) GetType added in v1.104.0

func (r *PreflightReport) GetType() ReportType

type PreflightReportEvent added in v1.104.0

type PreflightReportEvent struct {
	ReportedAt      int64  `json:"reported_at"`
	LicenseID       string `json:"license_id"`
	InstanceID      string `json:"instance_id"`
	ClusterID       string `json:"cluster_id"`
	Sequence        int64  `json:"sequence"`
	SkipPreflights  bool   `json:"skip_preflights"`
	InstallStatus   string `json:"install_status"`
	IsCLI           bool   `json:"is_cli"`
	PreflightStatus string `json:"preflight_status"`
	AppStatus       string `json:"app_status"`
	UserAgent       string `json:"user_agent"`
}

type Report added in v1.104.0

type Report interface {
	GetType() ReportType
	GetSecretName(appSlug string) string
	GetSecretKey() string
	AppendEvents(report Report) error
	GetEventLimit() int
	GetMtx() *sync.Mutex
}

func DecodeReport added in v1.104.0

func DecodeReport(encodedData []byte, reportType ReportType) (Report, error)

type ReportType added in v1.104.0

type ReportType string
const (
	ReportTypeInstance  ReportType = "instance"
	ReportTypePreflight ReportType = "preflight"
)

type Reporter added in v1.98.0

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
}

func GetReporter added in v1.98.0

func GetReporter() Reporter

type SnapshotReport added in v1.104.3

type SnapshotReport struct {
	Provider        string
	FullSchedule    string
	FullTTL         string
	PartialSchedule string
	PartialTTL      string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL