Open danail-branekov opened 4 days ago
Turns out that maybe this would not that trivial :(
Imagine the following scenario:
UPSI created with 0.11.0. The credentials secret referenced by the UPSI is in the old format
Korifi bumped to 0.12.0
CFServiceInstance.Spec.SecretName
resource still references the initial secret (in the old format)CFServiceInstance.Status.Credentials.Name
is set to the migrated secret with the -migrated
suffix). this migrated secret is in the new formatNow Korifi is bumped to the release candidate
CFServiceInstance
. It now no longer has the knowledge that this might be a pre 0.12.0 upsi, therefore jumps straight into validating the secret referenced by CFServiceInstance.Spec.SecretName
. As that secret is in the old format (see above), validation failsI have not tested yet, but I am pretty sure we would see the same error if we jump from 0.11.0 to the release candidate
In 0.12.0 we introduced support for objects in user-provided services credentials (https://github.com/cloudfoundry/korifi/issues/2900). When we have been working on that, we wanted to avoid workloads restart on korifi upgrade in order to ensure smooth upgrade path, and came up with some legacy support code.
With the upcoming release the smooth upgrade is not going to be possible as workloads have to restart, see
As there is no way around that, let's make use of it and get rid of the legacy secret format support:
https://github.com/cloudfoundry/korifi/blob/f9b24a36a90e5d614e2fa5abc243ae7dd2c87ace/controllers/controllers/services/instances/upsi/controller.go#L151-L183
https://github.com/cloudfoundry/korifi/blob/f9b24a36a90e5d614e2fa5abc243ae7dd2c87ace/controllers/controllers/services/bindings/upsi/controller.go#L90-L106
[x] Ensure that user provided services that have been created with 0.12.0 are fine
[ ] Ensure upsis created with 0.11.0 and reconciled by 0.12.0 are fine
[ ] Check the behaviour of bumping 0.11.0 straigh into the release candidate. If broken, make sure not to forget to document that 0.12.0 is a prerequisite for this release.