-
Couldn't load subscription status.
- Fork 293
Custom UEFI certificates - API change #5247
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
Custom UEFI certificates - API change #5247
Conversation
ae2452a to
49880ea
Compare
ocaml/xapi/xapi_pool.ml
Outdated
| let get_uefi_certificates ~__context ~self = | ||
| let custom_certs = Db.Pool.get_custom_uefi_certificates ~__context ~self in | ||
| match (!Xapi_globs.allow_custom_uefi_certs, custom_certs) with | ||
| | false, _ | true, "" -> |
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.
This suggests the empty string has a special meaning. Is this obvious for the user?
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.
In the design clearing the custom UEFI certificates would default back to using the default ones.
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.
Some docs can be added clarifying this clearing. An alternative could be to add an api function called Pool.clear_custom_uefi_certs
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.
If the empty string has special meaning, I would like to see that documented in the function that sets the string. Usually we try to avoid giving an empty string special meaning and use option values instead: it is more obvious that None has a special meaning.
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.
Note that this special meaning of an empty value is already present currently in Db.Pool.{set,}uefi_certificates. We just moved this to the new field, to keep the amount of changes to a minimum.
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've added in the doc of the setter the defaulting back when empty behavior. :)
bd6a757 to
7b54eb2
Compare
06adb4b to
693ac7a
Compare
9e420bd to
7bdc699
Compare
ocaml/xapi/xapi_pool.ml
Outdated
| let get_uefi_certificates ~__context ~self = | ||
| let custom_certs = Db.Pool.get_custom_uefi_certificates ~__context ~self in | ||
| match (!Xapi_globs.allow_custom_uefi_certs, custom_certs) with | ||
| | false, _ | true, "" -> |
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.
If the empty string has special meaning, I would like to see that documented in the function that sets the string. Usually we try to avoid giving an empty string special meaning and use option values instead: it is more obvious that None has a special meaning.
4822862 to
f0857b0
Compare
73447b6 to
d6eaf75
Compare
|
Late remarks:
Don't merge yet :) |
8fef70d to
ffd3d8b
Compare
|
I've added the |
ffd3d8b to
ce56312
Compare
46572aa to
a52663f
Compare
a52663f to
97473dd
Compare
|
last force push was to fix typos in the commit messages, everything is good and validated on our side so good for merge according to us! :) |
|
The format error does not concern my changes, not sure what to do 🤔 |
97473dd to
88c89e8
Compare
|
rebased on master for format change. |
|
How about a merge of this as a Christmas gift? 😉 |
ocaml/idl/datamodel_pool.ml
Outdated
| call ~name:"set_custom_uefi_certificates" ~lifecycle:[] | ||
| ~doc: | ||
| "Set custom UEFI certificates for a pool and all its hosts. Need \ | ||
| `allow-custom-uefi-verts` set to true in conf. If empty: default back \ |
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.
typo? "verts"?
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.
indeed! Fixed 😇
Signed-off-by: BenjiReis <benjamin.reis@vates.fr>
- `Pool.set/get_custom_uefi_certificates` - `Pool/Host.set_uefi_certificates` deprecated - `Pool.get_uefi_certificates` return the certificates used by the pool Signed-off-by: BenjiReis <benjamin.reis@vates.fr>
Signed-off-by: BenjiReis <benjamin.reis@vates.fr>
Signed-off-by: BenjiReis <benjamin.reis@vates.fr>
Signed-off-by: BenjiReis <benjamin.reis@vates.fr>
They'are also needed to fallback when custom are empty Signed-off-by: Benjamin Reis <benjamin.reis@vates.tech>
88c89e8 to
70e07d0
Compare
| ~lifecycle: | ||
| [ | ||
| (Published, "22.16.0", "") | ||
| ; (Deprecated, "23.32.0", "use set_custom_uefi_certificates instead") |
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.
This is the latest version
Solves: #5245