Merge branch 'apiserver' into merge

This commit is contained in:
Hongchao Deng
2021-11-22 17:25:50 +08:00
177 changed files with 25065 additions and 3350 deletions
+7 -1
View File
@@ -23,7 +23,7 @@ import (
#Delete: kube.#Delete
#ApplyApplication: #Steps & {
load: oam.#LoadComponets @step(1)
load: oam.#LoadComponetsInOrder @step(1)
components: #Steps & {
for name, c in load.value {
"\(name)": oam.#ApplyComponent & {
@@ -129,10 +129,16 @@ import (
#ConvertString: convert.#String
#DateToTimestamp: time.#DateToTimestamp
#TimestampToDate: time.#TimestampToDate
#SendEmail: email.#Send
#Load: oam.#LoadComponets
#LoadInOrder: oam.#LoadComponetsInOrder
#Steps: {
#do: "steps"
...
+13 -4
View File
@@ -26,7 +26,7 @@ import (
)
var (
//go:embed pkgs op.cue
//go:embed pkgs op.cue ql.cue
fs embed.FS
)
@@ -43,17 +43,26 @@ func GetPackages(tagTempl string) (map[string]string, error) {
return nil, err
}
pkgContent := string(opBytes) + "\n"
qlBytes, err := fs.ReadFile("ql.cue")
if err != nil {
return nil, err
}
opContent := string(opBytes) + "\n"
qlContent := string(qlBytes) + "\n"
for _, file := range files {
body, err := fs.ReadFile("pkgs/" + file.Name())
if err != nil {
return nil, err
}
pkgContent += fmt.Sprintf("%s: {\n%s\n}\n", strings.TrimSuffix(file.Name(), ".cue"), string(body))
pkgContent := fmt.Sprintf("%s: {\n%s\n}\n", strings.TrimSuffix(file.Name(), ".cue"), string(body))
opContent += pkgContent
qlContent += pkgContent
}
return map[string]string{
"vela/op": pkgContent + "\n" + tagTempl,
"vela/op": opContent + "\n" + tagTempl,
"vela/ql": qlContent + "\n" + tagTempl,
}, nil
}
+1
View File
@@ -27,6 +27,7 @@
matchingLabels?: {...}
}
list?: {...}
...
}
#Delete: {
+32
View File
@@ -0,0 +1,32 @@
#ListResourcesInApp: {
#do: "listResourcesInApp"
#provider: "query"
app: {
name: string
namespace: string
components?: [...string]
filter?: {
cluster?: string
clusterNamespace?: string
}
clusterNamespace?: string
enableHistoryQuery?: bool
}
...
}
#CollectPods: {
#do: "collectPods"
#provider: "query"
value: {...}
cluster: string
...
}
#SearchEvents: {
#do: "searchEvents"
#provider: "query"
value: {...}
cluster: string
...
}
+22
View File
@@ -0,0 +1,22 @@
#DateToTimestamp: {
#do: "timestamp"
#provider: "time"
date: string
layout: *"" | string
timestamp?: int64
...
}
#TimestampToDate: {
#do: "date"
#provider: "time"
timestamp: int64
layout: *"" | string
location: *"" | string
date?: string
...
}
+11
View File
@@ -0,0 +1,11 @@
#Read: kube.#Read
#List: kube.#List
#Delete: kube.#Delete
#ListResourcesInApp: query.#ListResourcesInApp
#CollectPods: query.#CollectPods
#SearchEvents: query.#SearchEvents