Skip to content

Commit a009360

Browse files
committed
chore: enable reading lic from env
1 parent 9ea2499 commit a009360

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.github/workflows/reuse.linux.yml

+3
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ jobs:
120120
needs: [build, check]
121121
steps:
122122
- uses: actions/checkout@v4
123+
- uses: ./.github/actions/setup_license
124+
with:
125+
runner_provider: ${{ inputs.runner_provider }}
123126
- uses: ./.github/actions/test_metactl
124127
timeout-minutes: 10
125128

src/meta/service/src/meta_service/meta_node.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,19 @@ impl MetaNodeBuilder {
212212

213213
impl MetaNode {
214214
pub fn builder(config: &RaftConfig) -> MetaNodeBuilder {
215-
assert!(config.fake_ee_license);
216215
let ee_gate = if config.fake_ee_license {
217216
MetaServiceEnterpriseGate::new_testing()
218217
} else {
219-
MetaServiceEnterpriseGate::new(config.databend_enterprise_license.clone())
218+
// read env var QUERY_DATABEND_ENTERPRISE_LICENSE:
219+
// - if it is set, use it as the license.
220+
// - if it is not set, use the license in config.
221+
222+
let license = std::env::var("QUERY_DATABEND_ENTERPRISE_LICENSE");
223+
if let Ok(token) = license {
224+
MetaServiceEnterpriseGate::new(Some(token))
225+
} else {
226+
MetaServiceEnterpriseGate::new(config.databend_enterprise_license.clone())
227+
}
220228
};
221229

222230
let raft_config = MetaNode::new_raft_config(config);

0 commit comments

Comments
 (0)