Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Pydantic type representing meta Duration

Offen
#2,764 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
api

Rechercherichtung

Start by reading the Pydantic custom resource support added in release 37 and the existing functions in kubernetes.util.duration. Identify how custom types are serialized and deserialized through model_dump/model_verify and the CustomObjectsApi. Done means a Pydantic type can represent metav1.Duration across that path, with type hints for the duration functions.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

kind/feature

What is the feature and why do you need it:
The Pydantic dependency in 37.0.0 made it possible to define custom models to represent custom resources.

In release 37 a Pydantic model representing custom objects can be defined and via model_dump/model_verify can be passed through the CustomObjectsApi.

A number of these use types not available in the K8s API such a metav1.Duration such as in Velero. This gets serialized to and from openapi spec string to the struct by golang and as such cannot be easily handled via openapi spec.

Before the Pydantic incorporation in 37 there was not a possibility to add in custom models compatible with the Python k8s client parser.

Describe the solution you'd like to see:
A Pydantic meta Duration type that serializes/deserializes such an object.

Typehinting of the kubernetes.util.duration functions.

Vorherrschende Sprache
Python
Sterne
7.7k
Forks
3.5k
Ø Merge
1 T. 9 Std.
Gemergte PRs (30 T.)
25

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus kubernetes-client/python

Alle Issues in kubernetes-client/python

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.