Make AuthorizationPolicy spec usable with controller-gen

Abierto
#3,363 1 comentario 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
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
go
Área
api

Línea de trabajo

Lee security/v1beta1/authorization_policy.pb.go, centrándote en la propiedad exportada ActionDetail y su método GetActionDetail existente. Reproduce el fallo con kubebuilder o controller-tools usando una spec de AuthorizationPolicy embebida y determina un enfoque que permita a controller-gen procesarla sin requerir un tipo copiado, teniendo en cuenta la compatibilidad para los consumidores de la propiedad pública.

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

Descripción

kind/enhancement

Describe the feature request

The AuthorizationPolicy spec (security/v1beta1/authorization_policy.pb.go) go type can't be used with controller-tools
If I try to create a CRD with kubebuilder / controller-tools that embeds an AuthorizationPolicy spec as part of my CRD object, I have to create my own copy of the existing type, which adds more work to translate it to an actual AuthorizationPolicy later on.

The reason this fails is that the type has an ActionDetail property which lacks any json tag.
This is because this property is not part of the CRD itself I believe. However, controller-tools at best allows to ignore private properties from a type but not public properties. So it fails to create the CRD object.

One option would be to make ActionDetail private (actionDetail - there is already a GetActionDetail method defined) but this is an interface change that would likely introduce breakages in existing code if they access that property directly

Describe alternatives you've considered

Alternative is to create a "copy" of the type and create methods to get an istio AuthorizationPolicy object out of the clone type

Affected product area (please put an X in all that apply)

[ ] Configuration Infrastructure
[ ] Docs
[ ] Installation
[ ] Networking
[ ] Performance and Scalability
[ ] Policies and Telemetry
[ ] Security
[ ] Test and Release
[ ] User Experience

Additional context

Lenguaje dominante
Go
Estrellas
523
Forks
623
Merge medio
5 d 20 h
PR fusionados (30 d)
4

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

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 istio/api

Todos los issues de istio/api

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.