Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(openapi): add creationTime and modificationTime to policy specs #12006

Conversation

schogges
Copy link
Contributor

@schogges schogges commented Nov 11, 2024

Motivation

In order to further complete the openAPI specs, we need to add creationTime and modificationTime. These properties are already part of the response payload (see context below). Since the GUI project started to generate the TypeScript types from the specs, there is a high demand in having complete specs to avoid manual backfilling.

Implementation information

Added modificationTime and creationTime to tools/policy-gen/templates/schema.yaml. Afterwards ran make check.

Context

Example Payloads
  {
   "type": "MeshMetric",
   "mesh": "default",
   "name": "otel-metrics.kuma-system",
   "creationTime": "2024-11-05T13:50:03Z",
   "modificationTime": "2024-11-05T13:50:03Z",
   "labels": {
    "k8s.kuma.io/namespace": "kuma-system",
    "kuma.io/display-name": "otel-metrics",
    "kuma.io/mesh": "default",
    "kuma.io/policy-role": "system"
   },
   "spec": {
    "targetRef": {
     "kind": "Mesh"
    },
    "default": {
     "backends": [
      {
       "type": "OpenTelemetry",
       "openTelemetry": {
        "endpoint": "opentelemetry-collector.mesh-observability.svc:4317"
       }
      }
     ]
    }
   }
  }
  {
   "type": "HostnameGenerator",
   "name": "local-mesh-external-service-45zv4bv8cv5v8444.kuma-system",
   "creationTime": "2024-11-05T09:48:59Z",
   "modificationTime": "2024-11-05T09:48:59Z",
   "labels": {
    "k8s.kuma.io/namespace": "kuma-system",
    "kuma.io/display-name": "local-mesh-external-service",
    "kuma.io/env": "kubernetes",
    "kuma.io/mesh": "",
    "kuma.io/origin": "zone",
    "kuma.io/zone": "east"
   },
   "spec": {
    "selector": {
     "meshExternalService": {
      "matchLabels": {
       "kuma.io/origin": "zone"
      }
     }
    },
    "template": "{{ .DisplayName }}.extsvc.mesh.local"
   }
  }

@schogges schogges requested a review from a team as a code owner November 11, 2024 11:30
@schogges schogges requested review from michaelbeaumont and bartsmykla and removed request for a team November 11, 2024 11:30
@schogges schogges force-pushed the feat/tools/policy-gen/templates/schema/add_modification_and_creation_times branch from 5d3f1b6 to 081e22d Compare November 11, 2024 11:36
Copy link
Contributor

@michaelbeaumont michaelbeaumont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah LGTM

@michaelbeaumont michaelbeaumont merged commit e8aceb5 into kumahq:master Nov 11, 2024
13 checks passed
@michaelbeaumont michaelbeaumont changed the title feat(tools/policy-gen/templates/schema): add creationTime and modificationTime to policy specs feat(openapi): add creationTime and modificationTime to policy specs Nov 11, 2024
@schogges schogges deleted the feat/tools/policy-gen/templates/schema/add_modification_and_creation_times branch November 11, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants