Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Pydantic type representing meta Duration

Abierto
#2,764 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
api

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
7.7k
Forks
3.5k
Merge medio
1 d 9 h
PR fusionados (30 d)
25

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de kubernetes-client/python

Todos los issues de kubernetes-client/python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.