Skip to content

Commit

Permalink
PMM-7652 Use uint64 for resources to avoid overflow (#706)
Browse files Browse the repository at this point in the history
We need to avoid overflow of disk sizie which is of type int64 so we use uint64 instead.
  • Loading branch information
Jan Prukner authored Mar 29, 2021
1 parent a754477 commit 60c2175
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 36 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* @atymchuk @BupycHuk

18 changes: 9 additions & 9 deletions api/managementpb/dbaas/dbaas.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions api/managementpb/dbaas/dbaas.proto
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ message ComputeResources {
// Resources contains Kubernetes cluster resources.
message Resources {
// Memory in bytes.
int64 memory_bytes = 1;
uint64 memory_bytes = 1;
// CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.
// See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.
int64 cpu_m = 2;
uint64 cpu_m = 2;
// Disk size in bytes.
int64 disk_size = 3;
uint64 disk_size = 3;
}
24 changes: 12 additions & 12 deletions api/managementpb/dbaas/json/dbaas.json
Original file line number Diff line number Diff line change
Expand Up @@ -1163,19 +1163,19 @@
"cpu_m": {
"description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 1
},
"disk_size": {
"description": "Disk size in bytes.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 2
},
"memory_bytes": {
"description": "Memory in bytes.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 0
}
},
Expand All @@ -1188,19 +1188,19 @@
"cpu_m": {
"description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 1
},
"disk_size": {
"description": "Disk size in bytes.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 2
},
"memory_bytes": {
"description": "Memory in bytes.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 0
}
},
Expand Down Expand Up @@ -1617,19 +1617,19 @@
"cpu_m": {
"description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 1
},
"disk_size": {
"description": "Disk size in bytes.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 2
},
"memory_bytes": {
"description": "Memory in bytes.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 0
}
},
Expand Down Expand Up @@ -2539,19 +2539,19 @@
"cpu_m": {
"description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 1
},
"disk_size": {
"description": "Disk size in bytes.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 2
},
"memory_bytes": {
"description": "Memory in bytes.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 0
}
},
Expand Down
24 changes: 12 additions & 12 deletions api/swagger/swagger-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -15866,19 +15866,19 @@
"memory_bytes": {
"description": "Memory in bytes.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 0
},
"cpu_m": {
"description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 1
},
"disk_size": {
"description": "Disk size in bytes.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 2
}
},
Expand All @@ -15891,19 +15891,19 @@
"memory_bytes": {
"description": "Memory in bytes.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 0
},
"cpu_m": {
"description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 1
},
"disk_size": {
"description": "Disk size in bytes.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 2
}
},
Expand Down Expand Up @@ -16320,19 +16320,19 @@
"memory_bytes": {
"description": "Memory in bytes.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 0
},
"cpu_m": {
"description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 1
},
"disk_size": {
"description": "Disk size in bytes.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 2
}
},
Expand Down Expand Up @@ -17242,19 +17242,19 @@
"memory_bytes": {
"description": "Memory in bytes.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 0
},
"cpu_m": {
"description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 1
},
"disk_size": {
"description": "Disk size in bytes.",
"type": "string",
"format": "int64",
"format": "uint64",
"x-order": 2
}
},
Expand Down

0 comments on commit 60c2175

Please sign in to comment.