Skip to content

Commit

Permalink
add devbox monitor (#5086)
Browse files Browse the repository at this point in the history
  • Loading branch information
bxy4543 committed Sep 18, 2024
1 parent fad8188 commit 6507e53
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions controllers/pkg/resources/named.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ func NewResourceNamed(cr client.Object) *ResourceNamed {
case labels[TerminalIDLabelKey] != "" || (labels[label.AppManagedBy] == label.DefaultManagedBy && labels[label.AppPartOf] == "terminal"):
p._type = TERMINAL
p._name = ""
case labels[label.AppPartOf] == "devbox":
p._type = DevBox
p._name = labels[label.AppName]
case labels[AppLabelKey] != "":
p._type = APP
p._name = labels[AppLabelKey]
Expand Down
6 changes: 4 additions & 2 deletions controllers/pkg/resources/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ const (
cvm
appStore
dbBackup
devBox
)

const (
Expand All @@ -176,14 +177,15 @@ const (
CVM = "CLOUD-VM"
AppStore = "APP-STORE"
DBBackup = "DB-BACKUP"
DevBox = "DEV-BOX"
)

var AppType = map[string]uint8{
DB: db, APP: app, TERMINAL: terminal, JOB: job, OTHER: other, ObjectStorage: objectStorage, CVM: cvm, AppStore: appStore, DBBackup: dbBackup,
DB: db, APP: app, TERMINAL: terminal, JOB: job, OTHER: other, ObjectStorage: objectStorage, CVM: cvm, AppStore: appStore, DBBackup: dbBackup, DevBox: devBox,
}

var AppTypeReverse = map[uint8]string{
db: DB, app: APP, terminal: TERMINAL, job: JOB, other: OTHER, objectStorage: ObjectStorage, cvm: CVM, appStore: AppStore, dbBackup: DBBackup,
db: DB, app: APP, terminal: TERMINAL, job: JOB, other: OTHER, objectStorage: ObjectStorage, cvm: CVM, appStore: AppStore, dbBackup: DBBackup, devBox: DevBox,
}

// resource consumption
Expand Down

0 comments on commit 6507e53

Please sign in to comment.