From 07c62be9ad6c6576ff1b281598a4042cbda1583a Mon Sep 17 00:00:00 2001 From: Francesco Cheinasso Date: Fri, 13 Oct 2023 13:17:53 +0200 Subject: [PATCH] Telemetry: security mode --- cmd/telemetry/main.go | 2 ++ deployments/liqo/templates/liqo-telemetry-cronjob.yaml | 1 + pkg/telemetry/builder.go | 1 + pkg/telemetry/types.go | 2 ++ 4 files changed, 6 insertions(+) diff --git a/cmd/telemetry/main.go b/cmd/telemetry/main.go index 55c560e037..300df69cc8 100644 --- a/cmd/telemetry/main.go +++ b/cmd/telemetry/main.go @@ -70,6 +70,7 @@ func main() { namespace := flag.String("namespace", "liqo", "the namespace where liqo is deployed") liqoVersion := flag.String("liqo-version", "", "the liqo version") kubernetesVersion := flag.String("kubernetes-version", "", "the kubernetes version") + securityMode := flag.String("security-mode", "", "the security mode of the cluster") dryRun := flag.Bool("dry-run", false, "if true, do not send the telemetry item and print it on stdout") flag.Var(&clusterLabels, consts.ClusterLabelsParameter, "The set of labels which characterizes the local cluster when exposed remotely as a virtual node") @@ -101,6 +102,7 @@ func main() { Namespace: *namespace, LiqoVersion: *liqoVersion, KubernetesVersion: *kubernetesVersion, + SecurityMode: *securityMode, ClusterLabels: clusterLabels.StringMap, } diff --git a/deployments/liqo/templates/liqo-telemetry-cronjob.yaml b/deployments/liqo/templates/liqo-telemetry-cronjob.yaml index 49c6a86252..b0d2b2a3b9 100644 --- a/deployments/liqo/templates/liqo-telemetry-cronjob.yaml +++ b/deployments/liqo/templates/liqo-telemetry-cronjob.yaml @@ -45,6 +45,7 @@ spec: - --liqo-version={{ include "liqo.version" . }} - --kubernetes-version={{ .Capabilities.KubeVersion.GitVersion }} - --namespace={{ .Release.Namespace }} + - --security-mode={{ .Values.securityConfig.securityType }} {{- if .Values.discovery.config.clusterLabels }} {{- $d := dict "commandName" "--cluster-labels" "dictionary" .Values.discovery.config.clusterLabels }} {{- include "liqo.concatenateMap" $d | nindent 14 }} diff --git a/pkg/telemetry/builder.go b/pkg/telemetry/builder.go index 936558f400..65f41ec852 100644 --- a/pkg/telemetry/builder.go +++ b/pkg/telemetry/builder.go @@ -45,6 +45,7 @@ func (c *Builder) ForgeTelemetryItem(ctx context.Context) (*Telemetry, error) { ClusterID: clusterIdentity.ClusterID, LiqoVersion: c.LiqoVersion, KubernetesVersion: c.KubernetesVersion, + SecurityMode: c.SecurityMode, Provider: c.getProvider(), PeeringInfo: c.getPeeringInfoSlice(ctx), NamespacesInfo: c.getNamespacesInfo(ctx), diff --git a/pkg/telemetry/types.go b/pkg/telemetry/types.go index 501937ef7c..323650a96b 100644 --- a/pkg/telemetry/types.go +++ b/pkg/telemetry/types.go @@ -55,6 +55,7 @@ type Telemetry struct { ClusterID string `json:"clusterID"` LiqoVersion string `json:"liqoVersion,omitempty"` KubernetesVersion string `json:"kubernetesVersion,omitempty"` + SecurityMode string `json:"securityMode,omitempty"` Provider string `json:"provider,omitempty"` PeeringInfo []PeeringInfo `json:"peeringInfo,omitempty"` NamespacesInfo []NamespaceInfo `json:"namespacesInfo,omitempty"` @@ -67,4 +68,5 @@ type Builder struct { LiqoVersion string KubernetesVersion string ClusterLabels map[string]string + SecurityMode string }