From e033bd1b63c189b3a630e109c4caf4a49749a006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E7=B4=AB=E8=B6=85?= <5364766+auditoreyzc@user.noreply.gitee.com> Date: Mon, 13 Jan 2025 16:56:14 +0800 Subject: [PATCH] =?UTF-8?q?flowjob=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cores/services.rs | 1 + src/db/db.rs | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/cores/services.rs b/src/cores/services.rs index 974fb28..f3c85da 100644 --- a/src/cores/services.rs +++ b/src/cores/services.rs @@ -108,6 +108,7 @@ static GLOBAL_HASHMAP: LazyLock>> = LazyLock::new( map.insert("nodes".to_string(), "Node".to_string()); map.insert("jobs".to_string(), "Job".to_string()); map.insert("cronjobs".to_string(), "CronJob".to_string()); + map.insert("flowjobs".to_string(), "FlowJob".to_string()); map.insert("events".to_string(), "Event".to_string()); Mutex::new(map) }); diff --git a/src/db/db.rs b/src/db/db.rs index c2a3639..c621d71 100644 --- a/src/db/db.rs +++ b/src/db/db.rs @@ -101,6 +101,30 @@ fn resource_templates() -> HashMap<&'static str, (bool, Value)> { }), ), ); + templates.insert( + "flowjobs", + ( + true, + json!({ + "apiVersion": "batch/v1", + "kind": "FlowJob", + "metadata": { + "name": "string", + "labels": "object" + }, + "spec": { + "template": { + "metadata": { + "labels": "object" + }, + "spec": { + // todo! + } + } + } + }), + ), + ); templates.insert( "jobs", ( -- Gitee