-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Korifi API users should be able to provide JSON objects as user provided service parameters #2900
Comments
We got feedback from @vlast3k that some apps would fail when unmarshalling the parameters object if an extra property (such as In addition to that, Korifi adds a |
We had an alternative spike on the issue, see this commit
Pros:
Cons:
|
Previously Korifi supported plain `map[string]string` for UPSI credentials. This deviates from the CF API spec where credentials can be arbitrary objects. As credentials are stored in secrets which are glorified `map[string][]byte` we had to change the way we store the credentials object: * We marshal the credentials object into a byte array and store it under the `crdentials` key in the secret. We no longer use a secret key per every credentials value. The `CFServiceInstance.Spec.SecretName` references that credentials secret. * We introduce `CFServiceInstance.Status.Credentials` and `CFServiceInstance.Status.CredentialsObservedVersion` that aremanaged by the `CFServiceInstance` controller. Once the controller reconciles the service instance, it sets the secret name and its resource version into the new status fields. * The CFServiceBindingController reconciles the CFServiceInstance credentials secret into the flat format that is then used for the servicebinding.io binding. In case of a json object value to a key, the value is represented as a json string. * Existing bindings are not affected when upgrading Korifi. However, once the user updates the service instance credentials, the binding secret is rebuilt which causes statefulset restart. Further updates to the credentials will not cause additional restarts. fixes #2900 Co-authored-by: Danail Branekov <[email protected]>
Previously Korifi supported plain `map[string]string` for UPSI credentials. This deviates from the CF API spec where credentials can be arbitrary objects. As credentials are stored in secrets which are glorified `map[string][]byte` we had to change the way we store the credentials object: * We marshal the credentials object into a byte array and store it under the `crdentials` key in the secret. We no longer use a secret key per every credentials value. The `CFServiceInstance.Spec.SecretName` references that credentials secret. * We introduce `CFServiceInstance.Status.Credentials` and `CFServiceInstance.Status.CredentialsObservedVersion` that aremanaged by the `CFServiceInstance` controller. Once the controller reconciles the service instance, it sets the secret name and its resource version into the new status fields. * The CFServiceBindingController reconciles the CFServiceInstance credentials secret into the flat format that is then used for the servicebinding.io binding. In case of a json object value to a key, the value is represented as a json string. * Existing bindings are not affected when upgrading Korifi. However, once the user updates the service instance credentials, the binding secret is rebuilt which causes statefulset restart. Further updates to the credentials will not cause additional restarts. fixes #2900 Co-authored-by: Danail Branekov <[email protected]>
Previously Korifi supported plain `map[string]string` for UPSI credentials. This deviates from the CF API spec where credentials can be arbitrary objects. As credentials are stored in secrets which are glorified `map[string][]byte` we had to change the way we store the credentials object: * We marshal the credentials object into a byte array and store it under the `crdentials` key in the secret. We no longer use a secret key per every credentials value. The `CFServiceInstance.Spec.SecretName` references that credentials secret. * We introduce `CFServiceInstance.Status.Credentials` and `CFServiceInstance.Status.CredentialsObservedVersion` that aremanaged by the `CFServiceInstance` controller. Once the controller reconciles the service instance, it sets the secret name and its resource version into the new status fields. * The CFServiceBindingController reconciles the CFServiceInstance credentials secret into the flat format that is then used for the servicebinding.io binding. In case of a json object value to a key, the value is represented as a json string. * Existing bindings are not affected when upgrading Korifi. However, once the user updates the service instance credentials, the binding secret is rebuilt which causes statefulset restart. Further updates to the credentials will not cause additional restarts. fixes #2900 Co-authored-by: Danail Branekov <[email protected]>
Previously Korifi supported plain `map[string]string` for UPSI credentials. This deviates from the CF API spec where credentials can be arbitrary objects. As credentials are stored in secrets which are glorified `map[string][]byte` we had to change the way we store the credentials object: * We marshal the credentials object into a byte array and store it under the `crdentials` key in the secret. We no longer use a secret key per every credentials value. The `CFServiceInstance.Spec.SecretName` references that credentials secret. * We introduce `CFServiceInstance.Status.Credentials` and `CFServiceInstance.Status.CredentialsObservedVersion` that aremanaged by the `CFServiceInstance` controller. Once the controller reconciles the service instance, it sets the secret name and its resource version into the new status fields. * The CFServiceBindingController reconciles the CFServiceInstance credentials secret into the flat format that is then used for the servicebinding.io binding. In case of a json object value to a key, the value is represented as a json string. * Existing bindings are not affected when upgrading Korifi. However, once the user updates the service instance credentials, the binding secret is rebuilt which causes statefulset restart. Further updates to the credentials will not cause additional restarts. * We have created ADR 16 documenting how this works fixes #2900 Co-authored-by: Danail Branekov <[email protected]>
Previously Korifi supported plain `map[string]string` for UPSI credentials. This deviates from the CF API spec where credentials can be arbitrary objects. As credentials are stored in secrets which are glorified `map[string][]byte` we had to change the way we store the credentials object: * We marshal the credentials object into a byte array and store it under the `crdentials` key in the secret. We no longer use a secret key per every credentials value. The `CFServiceInstance.Spec.SecretName` references that credentials secret. * We introduce `CFServiceInstance.Status.Credentials` and `CFServiceInstance.Status.CredentialsObservedVersion` that aremanaged by the `CFServiceInstance` controller. Once the controller reconciles the service instance, it sets the secret name and its resource version into the new status fields. * The CFServiceBindingController reconciles the CFServiceInstance credentials secret into the flat format that is then used for the servicebinding.io binding. In case of a json object value to a key, the value is represented as a json string. * Existing bindings are not affected when upgrading Korifi. However, once the user updates the service instance credentials, the binding secret is rebuilt which causes statefulset restart. Further updates to the credentials will not cause additional restarts. * We have created ADR 16 documenting how this works fixes #2900 Co-authored-by: Danail Branekov <[email protected]>
rather than map[string]string Issue: #2900 Co-authored-by: Danail Branekov <[email protected]>
rather than map[string]string Issue: #2900 Co-authored-by: Danail Branekov <[email protected]>
rather than map[string]string Issue: #2900 Co-authored-by: Danail Branekov <[email protected]> Co-authored-by: Georgi Sabev <[email protected]>
…rvices Credentials in VCAP_SERVICES are objects
Previously Korifi supported plain `map[string]string` for UPSI credentials. This deviates from the CF API spec where credentials can be arbitrary objects. As credentials are stored in secrets which are glorified `map[string][]byte` we had to change the way we store the credentials object: * We marshal the credentials object into a byte array and store it under the `crdentials` key in the secret. We no longer use a secret key per every credentials value. The `CFServiceInstance.Spec.SecretName` references that credentials secret. * We introduce `CFServiceInstance.Status.Credentials` and `CFServiceInstance.Status.CredentialsObservedVersion` that aremanaged by the `CFServiceInstance` controller. Once the controller reconciles the service instance, it sets the secret name and its resource version into the new status fields. * The CFServiceBindingController reconciles the CFServiceInstance credentials secret into the flat format that is then used for the servicebinding.io binding. In case of a json object value to a key, the value is represented as a json string. * Existing bindings are not affected when upgrading Korifi. However, once the user updates the service instance credentials, the binding secret is rebuilt which causes statefulset restart. Further updates to the credentials will not cause additional restarts. * We have created ADR 16 documenting how this works fixes cloudfoundry#2900 Co-authored-by: Danail Branekov <[email protected]>
rather than map[string]string Issue: cloudfoundry#2900 Co-authored-by: Danail Branekov <[email protected]> Co-authored-by: Georgi Sabev <[email protected]>
According to the service credential binding and service instance documentation, the
parameters
request parameter isA JSON object that is passed to the service broker
. This means that users should be able to create a user provided service via the following command:On CF for VMs the command above succeeds:
However, on Korifi we get the following error:
The reason for this error is that we expect that the
parameters
field ismap[string]string
. In order to support parameters that are json object we should change that tomap[string]any
. We should ensure that we implement this in a backwards compatible manner, epscially with regards to existing user provided services and the secrets they use to store their parameters.See this slack discussion for more context
The text was updated successfully, but these errors were encountered: