-
Notifications
You must be signed in to change notification settings - Fork 433
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
Add K8S and CF annotations to context object and CF bind resource #658
Add K8S and CF annotations to context object and CF bind resource #658
Conversation
✅ Hey gberche-orange! The commit authors and yourself have already signed the CLA. |
I’m concerned about: what will happen if a service-broker wants to support a 3rd platform (not CF and not K8S), and that platform has a slightly different concept? Will we have to add one or two more Another thing that I’ve noticed: |
thanks @waterlink for your review
The extension of the profile.md to additional platforms beyond CF and K8S does not seem specific to annotations. The current specs do not state whether new plaforms names can be sent without changing the specs to register their platform name.
I would expect service broker to only parse/handle context objects for platforms they are aware of, and either ignore or reject unsupported platform types as they would not be sure of what context keys to expect.
Yes, generally brokers can't make any assumptions about the user provided annotations that they will receive in the context objects. They may choose to document the annotations they support/expect/require (e.g. in their documentation page url specified in catalog), and ignore annotations they are unaware of. I can imagine that if a broker absolutely requires a mandatory inputs, it may offer its users to specify them at a higher level through annotations or explicitly through parameters that are documented in the catalog through associated Json schema. We'll have to see in the future if there is demand for brokers to publish their supported annotations directly in the catalog through additional json schemas (e.g. using a key |
@mattmcneeney the travis-ci build is apparently failing following your commit 275d5fa with the following message,
See build 524511401 for full traces. |
Ah! Thanks @gberche-orange - I'm on the case now... |
I believe this is fixed @gberche-orange if you can rebase this! |
Fixed typos spotted by travis-ci build & @waterlink review
41362b1
to
d4d072f
Compare
@gberche-orange Thank you for addressing my concerns! I still feel a bit weird about:
These seem to be terms for the same thing. So as a reader, my question: “Why they are not called the same thing (e.g. just Then my next thought is: “Oh, one comes from CF and another comes from K8S!” after reading a bit deeper. And then my further line of thinking is: “Okay if we need to distinguish between CF and K8S annotations, then why not call them And when I’m asking this question to myself, I can come up with one hypothesis with my current knowledge: “Maybe we don’t want to mention Can you please help me understand if my line of thought is correct or not, and where did I take the wrong turn? Other than that, the PR looks good to me! 👍 |
thanks @waterlink for your review, sorry I missed this question in my previous answers My rationales for keeping CF
|
@gberche-orange if we do make this key the same, then
|
@mattmcneeney any thoughts on CF |
I'm not sure I've quite followed this. Are we proposing that the |
Refined annotations examples to be compliant with K8S annotations keys
No. The CF context in this PR has an @waterlink is suggesting in #658 (comment) to instead name the both keys in CF context and K8S context as This creates an inconsistency in the CF context between I was keen to get your opinion on whether you prefer :
|
Fix typo in Bind Resource Object annotation
Ah I've got it, thank you! If possible, it would be good to use However, if this isn't possible, I'd probably vote for consistency across K8S and CF contexts, and call them both |
Specify that When present the annotations must be non-empty. The rationale for this is to: - optimize the payload by avoiding that platforms send empty annotations keys - simplify service authors work that don't need to handle inconsistent platform behaviors The specs however let platform choose the criteria for sending annotations (e.g. sensible defaults or user opt-in), and therefore annotations keys are still optional.
Use instance_annotations keys for both CF and K8S, to be consistent with the existing instance_name field.
thanks @mattmcneeney and @waterlink for inputs
I've applied this in 12b46c7 please note that I also pushed further commits to:
You may therefore need to approve again the PR with these changes. |
Note that the following CF resources that do not yet have annotation support implemented might need to be exposed in a future annotation-related PR:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gberche-orange From CF SAPI perspective, everything looks good to me.
@mattmcneeney, are there any other comments from you that are not addressed?
I feel like this has lingered for already 2 weeks without updates. I think the only thing that’s left is to get review approvals from OSBAPI team. Or am I missing something?
Also, Travis failure seem to be unrelated and seems to be an internet connectivity problem that Travis’ VM/container had. Someone who has permissions should re-trigger that. |
This OPTIONAL property holds an object with the annotations key/value pairs. If present, this property MUST be an object, with one or more properties as follows: | ||
|
||
``` | ||
"organization_annotations": { "prefix-here.org/name-here":"value-here" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gberche-orange In the OSBAPI call we’ve realised that CF won’t have the prefixes here.
Is there expectation that the annotation object will always need such prefixes?, or is it only for K8S example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hoping that the CF CAPI team would handle cloudfoundry/cloud_controller_ng#1335 bringing planned Cf/K8S consistency and that prefixes could be used to filter out private annotation keys as mentionned in #654 (comment) in a consistent way between CF and K8S:
As a 1st step, we can leverage K8S annotations naming conventions reproduced below to allow users to distinguish between public annotations (shared with all brokers) and private annotations (not shared with brokers):
I'm still waiting for CF CAPI response on this. The CF SAPI team could consider other alternative options for filtering private annotations though, and we could relax the CF examples in OSB API PR
Not sure if it fits into this PR or should be another one, but if we add instance annotations for K8S, I think we should also have the instance name in the context object. |
Looks like we're still waiting for the CF CAPI team to get back to us on this one? |
It looks like that to me. |
CF CAPI team just confirmed they will be prioritizing enforcing the K8S prefix conventions to CF annotations, see cloudfoundry/cloud_controller_ng#1335 (comment) |
@gberche-orange can this PR be merged before the associated CC change? @waterlink has kindly offered to take a look into this |
@mattmcneeney Yes, I believe this PR can be merged before user input validation by CF CC enforces the K8S prefix into the user-provided annotations. The examples in this PR will conform to future enforced model by both CF and K8S. thanks @waterlink ! |
@mattmcneeney @gberche-orange Yes, this can go forward, since this RFC was accepted in CAPI. |
@zrob Are you happy for us to merge this into the spec, knowing that the associated CC change is in the backlog somewhere? |
Sorry I'm behind the 8-ball on this proposal. Is the intent of this PR that ALL annotations of the various resources org,space,app be sent to a broker for every bind request? |
User story in SAPI backlog to track the implementation of this on CF side: https://www.pivotaltracker.com/n/projects/2105761/stories/166935990 |
thanks @waterlink ! Related updating scenarios 3 and 4, I wonder whether in the future changes to annotations (org/space/service-instance) should automatically trigger a PATCH Currently with cf cli 6.45 a
|
Refine cardinality of annotations object to accept updates clearing annotations Update version into which the feature was introduced from 2.15 to 2.16
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@blgm Do you know if there is a story in the SAPI backlog for this? Happy to approve but just want to make sure this work is tracked somewhere Edit: Sorry @blgm I just spotted this above: https://www.pivotaltracker.com/n/projects/2105761/stories/166935990 |
@mattmcneeney thanks for merging this PR! I notice this PR does not appear in the roadmap project for 2.16 https://github.com/openservicebrokerapi/servicebroker/projects/1 Would it make sense to associate this PR to the 2.16 milestone in the roadmap? |
Good spot, thanks @gberche-orange - project updated! |
thanks @mattmcneeney ! |
What is the problem this PR solves?
Addresses #654
Checklist:
servicebroker/swagger.yaml
Lines 676 to 681 in cc11bc5
servicebroker/openapi.yaml
Lines 854 to 856 in d1e1273