-
Notifications
You must be signed in to change notification settings - Fork 592
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
feat(meta): watch and reload license key from file #18768
Conversation
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
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
Signed-off-by: Bugen Zhao <[email protected]>
How about adding an error message for |
Oops. Missed this. Will refine in the following PR. |
@@ -192,6 +193,10 @@ pub struct MetaNodeOpts { | |||
#[override_opts(path = system.license_key)] | |||
pub license_key: Option<LicenseKey>, | |||
|
|||
/// The path of the license key file to be watched and hot-reloaded. | |||
#[clap(long, env = "RW_LICENSE_KEY_PATH")] |
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 found 🤣
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.
Discussed with @BugenZhao elsewhere, here's the conclusion: RW_LICENSE_KEY_PATH
will be kept instead of being changed to the RW_LICENSE_KEY_FILE
in the PR description.
Signed-off-by: Bugen Zhao [email protected]I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Add a CLI argument of
--license-key-file
for the meta node, which enables a background task to watch and reload license key from that file, simplifying license key rotation in Cloud.Some notes:
RW_LICENSE_KEY_PATH
.license_key
), initial configuration (system.license_key
), or theRW_LICENSE_KEY
environment variableis still possible but not recommended when usingwill be rejected when--license-key-file
, as it can easily get overwritten if the key file's content changes--license-key-file
is specified. (see refactor(meta): reject directly setting license key when it's managed by watching a file #18823)Added a unit test.
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
See description above.