Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Pydantic type representing meta Duration

Ouverte
#2,764 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
48/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
python
Domaine
api

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
Python
Étoiles
7.7k
Forks
3.5k
Merge moyen
1 j 9 h
PR mergées (30 j)
25

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de kubernetes-client/python

Toutes les issues de kubernetes-client/python

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.