cloudfoundry / cloudfoundry/cf-java-client

DefaultServices.updateInstance() rejects plan updates despites plan is updateable.

Abierto
#1,044 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

bug client triaged
Lenguaje dominante
Java
Estrellas
334
Forks
319
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

The OSB API states regarding a service offering metadata that its updateable flag can be overriden in plans.

https://github.com/openservicebrokerapi/servicebroker/blob/master/spec.md#service-offering-object

Response Field Type Description
[...]
plan_updateable boolean Whether the Service Offering supports upgrade/downgrade for Service Plans by default. Service Plans can override this field (see Service Plan). Please note that the misspelling of the attribute plan_updatable as plan_updateable was done by mistake. We have opted to keep that misspelling instead of fixing it and thus breaking backward compatibility. Defaults to false.

https://github.com/openservicebrokerapi/servicebroker/blob/master/spec.md#service-plan-object

Response Field Type Description
[...]
plan_updateable boolean Whether the Plan supports upgrade/downgrade/sidegrade to another version. This field is OPTIONAL. If specificed, this takes precedence over the Service Offering's plan_updateable field. If not specified, the default is derived from the Service Offering. Please note that the attribute is intentionally misspelled as plan_updateable for legacy reasons.

Unfortunately the CC API reuses the two fields, but isn't precise enough to state that plan.updateable override serviceoffering.plan_updateable

https://apidocs.cloudfoundry.org/12.42.0/services/retrieve_a_particular_service.html

Name Description Default Valid Values Example Values
plan_updateable A boolean describing that an instance of this service can be updated to a different plan false    

https://apidocs.cloudfoundry.org/12.42.0/service_plans/retrieve_a_particular_service_plan.html

"plan_updateable": true,

As a result, cf-java-client refuses service instance updates unless the service definition is updateable, regardless than the service plan is updateable.

https://github.com/cloudfoundry/cf-java-client/blob/8ec06b4cdd61dda0f0ba5e4d546651b880735faa/cloudfoundry-operations/src/main/java/org/cloudfoundry/operations/services/DefaultServices.java#L515-L517

Given that CloudFoundry itself likely performs the checks, is there any reason to also perform the check client-side ?

If there is a good reason, then the logic should be fixed to only reject when both serviceplan.plan_updateable=false and servicedefinition.plan_updateable=false

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

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.

Línea de trabajo

Comienza en cloudfoundry-operations/src/main/java/org/cloudfoundry/operations/services/DefaultServices.java, líneas 515-517, y compara los campos de actualizabilidad de la definición del servicio y del plan de servicio con las definiciones vinculadas de OSB y Cloud Foundry API. Revisa el flujo existente de actualización de instancias de servicio y sus pruebas, si las hay. Se considera terminado cuando las actualizaciones válidas del plan ya no se rechazan únicamente porque la definición del servicio no sea actualizable.

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

Evaluación

Stack tecnológico
java
Área
api
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.