cloudfoundry / cloudfoundry/cf-java-client

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

オープン
#1,044 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug client triaged
主要言語
Java
スター
334
フォーク
319
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

cloudfoundry-operations/src/main/java/org/cloudfoundry/operations/services/DefaultServices.java の515-517行目から始め、サービス定義とサービスプランの更新可否フィールドを、リンク先の OSB および Cloud Foundry API の定義と比較します。既存のサービスインスタンス更新フローと、そのテストがあれば確認します。サービス定義が更新不可であるという理由だけで、有効なプラン更新が拒否されなくなれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
api
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。