Skip to content

Commit

Permalink
Fix: Used topo info in status instead of spec (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
powerfooI authored May 7, 2024
1 parent 14bf993 commit d0c2143
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 35 deletions.
6 changes: 3 additions & 3 deletions internal/dashboard/business/oceanbase/obtenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ func buildOverviewFromApiType(t *v1alpha1.OBTenant) *response.OBTenantOverview {
rt.Locality = t.Status.TenantRecordInfo.Locality
rt.PrimaryZone = t.Status.TenantRecordInfo.PrimaryZone

for i := range t.Spec.Pools {
pool := t.Spec.Pools[i]
for i := range t.Status.Pools {
pool := t.Status.Pools[i]
replica := response.OBTenantReplica{
Zone: pool.Zone,
Zone: pool.ZoneList,
Priority: pool.Priority,
Type: pool.Type.Name,
}
Expand Down
16 changes: 5 additions & 11 deletions internal/dashboard/generated/swagger/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3302,7 +3302,7 @@ const docTemplate = `{
{
"enum": [
"FULL",
"INCR",
"INC",
"CLEAN",
"ARCHIVE"
],
Expand Down Expand Up @@ -4560,11 +4560,8 @@ const docTemplate = `{
"endTime": {
"type": "integer"
},
"instances": {
"type": "array",
"items": {
"$ref": "#/definitions/oceanbase.OBInstance"
}
"instance": {
"$ref": "#/definitions/oceanbase.OBInstance"
},
"keyword": {
"type": "string"
Expand Down Expand Up @@ -7226,11 +7223,8 @@ const docTemplate = `{
"silence.SilencerFilter": {
"type": "object",
"properties": {
"instances": {
"type": "array",
"items": {
"$ref": "#/definitions/oceanbase.OBInstance"
}
"instance": {
"$ref": "#/definitions/oceanbase.OBInstance"
},
"keyword": {
"type": "string"
Expand Down
16 changes: 5 additions & 11 deletions internal/dashboard/generated/swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -3295,7 +3295,7 @@
{
"enum": [
"FULL",
"INCR",
"INC",
"CLEAN",
"ARCHIVE"
],
Expand Down Expand Up @@ -4553,11 +4553,8 @@
"endTime": {
"type": "integer"
},
"instances": {
"type": "array",
"items": {
"$ref": "#/definitions/oceanbase.OBInstance"
}
"instance": {
"$ref": "#/definitions/oceanbase.OBInstance"
},
"keyword": {
"type": "string"
Expand Down Expand Up @@ -7219,11 +7216,8 @@
"silence.SilencerFilter": {
"type": "object",
"properties": {
"instances": {
"type": "array",
"items": {
"$ref": "#/definitions/oceanbase.OBInstance"
}
"instance": {
"$ref": "#/definitions/oceanbase.OBInstance"
},
"keyword": {
"type": "string"
Expand Down
14 changes: 5 additions & 9 deletions internal/dashboard/generated/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,8 @@ definitions:
properties:
endTime:
type: integer
instances:
items:
$ref: '#/definitions/oceanbase.OBInstance'
type: array
instance:
$ref: '#/definitions/oceanbase.OBInstance'
keyword:
type: string
serverity:
Expand Down Expand Up @@ -1926,10 +1924,8 @@ definitions:
- TypeCustomized
silence.SilencerFilter:
properties:
instances:
items:
$ref: '#/definitions/oceanbase.OBInstance'
type: array
instance:
$ref: '#/definitions/oceanbase.OBInstance'
keyword:
type: string
type: object
Expand Down Expand Up @@ -3998,7 +3994,7 @@ paths:
- description: backup job type
enum:
- FULL
- INCR
- INC
- CLEAN
- ARCHIVE
in: path
Expand Down
2 changes: 1 addition & 1 deletion internal/dashboard/handler/obtenant_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ func GetBackupPolicy(c *gin.Context) (*response.BackupPolicy, error) {
// @Failure 500 object response.APIResponse
// @Param namespace path string true "obtenant namespace"
// @Param name path string true "obtenant name"
// @Param type path string true "backup job type" Enums(FULL,INCR,CLEAN,ARCHIVE)
// @Param type path string true "backup job type" Enums(FULL,INC,CLEAN,ARCHIVE)
// @Param limit query int false "limit" default(10)
// @Router /api/v1/obtenants/{namespace}/{name}/backup/{type}/jobs [GET]
// @Security ApiKeyAuth
Expand Down

0 comments on commit d0c2143

Please sign in to comment.