syntax = "proto3";

// If you make any changes make sure you run: make regenerate-proto

package gitlab.agent.entity.agentk;

option go_package = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v18/pkg/entity/agentk";

import "buf/validate/validate.proto";

// AgentkMeta contains information about agentk.
message Meta {
  // Version of the binary.
  string version = 1 [json_name = "version", (buf.validate.field).string = {max_bytes: 50}];
  // Short commit sha of the binary. (deprecated in favor of git_ref)
  string commit_id = 2 [json_name = "commit_id", (buf.validate.field).string = {max_bytes: 255}, deprecated = true];
  // Namespace of the Pod running the binary.
  string pod_namespace = 3 [json_name = "pod_namespace", (buf.validate.field).string = {min_len: 1, max_bytes: 63}];
  // Name of the Pod running the binary.
  string pod_name = 4 [json_name = "pod_name", (buf.validate.field).string = {min_len: 1, max_bytes: 255}];
  // Version of the Kubernetes cluster.
  KubernetesVersion kubernetes_version = 5 [json_name = "kubernetes_version"];
  // Git Reference of the binary. SHA, tag, or empty.
  string git_ref = 6 [json_name = "git_ref", (buf.validate.field).string = {max_bytes: 255}];
  // Extra telemetry data to report to GitLab.
  map<string, string> extra_telemetry_data = 7 [
    json_name = "extra_telemetry_data",
    (buf.validate.field).map.max_pairs = 8,
    (buf.validate.field).map.keys = {
      string: {
        min_len: 3
        max_len: 64
      }
    },
    (buf.validate.field).map.values = {
      string: {
        max_len: 255
      }
    }
  ];
}

// Version information of the Kubernetes cluster.
message KubernetesVersion {
  // Major version of the Kubernetes cluster.
  string major = 1 [json_name = "major", (buf.validate.field).string = {max_bytes: 20}];
  // Minor version of the Kubernetes cluster.
  string minor = 2 [json_name = "minor", (buf.validate.field).string = {max_bytes: 20}];
  // Git version of the Kubernetes cluster.
  string git_version = 3 [json_name = "git_version", (buf.validate.field).string = {max_bytes: 255}];
  // Platform of the Kubernetes cluster.
  string platform = 4 [json_name = "platform", (buf.validate.field).string = {max_bytes: 255}];
}
