fix: correct stickler-ci issues
This commit is contained in:
@@ -1,12 +1,11 @@
|
|||||||
package resource
|
package resource
|
||||||
|
|
||||||
|
// A collection of resource constraints for apps
|
||||||
type Resource struct {
|
type Resource struct {
|
||||||
Cpu string `json:"cpu"`
|
CPU string `json:"cpu"`
|
||||||
Memory string `json:"memory"`
|
Memory string `json:"memory"`
|
||||||
MemorySwap string `json:"memory-swap"`
|
MemorySwap string `json:"memory-swap"`
|
||||||
Network string `json:"network"`
|
Network string `json:"network"`
|
||||||
NetworkIngress string `json:"network-ingress"`
|
NetworkIngress string `json:"network-ingress"`
|
||||||
NetworkEgress string `json:"network-egress"`
|
NetworkEgress string `json:"network-egress"`
|
||||||
}
|
}
|
||||||
|
|
||||||
const PluginName = "resource"
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ func main() {
|
|||||||
args.Parse(os.Args[2:])
|
args.Parse(os.Args[2:])
|
||||||
|
|
||||||
resources := resource.Resource{
|
resources := resource.Resource{
|
||||||
Cpu: *cpu,
|
CPU: *cpu,
|
||||||
Memory: *memory,
|
Memory: *memory,
|
||||||
MemorySwap: *memorySwap,
|
MemorySwap: *memorySwap,
|
||||||
Network: *network,
|
Network: *network,
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ func main() {
|
|||||||
args.Parse(os.Args[2:])
|
args.Parse(os.Args[2:])
|
||||||
|
|
||||||
resources := resource.Resource{
|
resources := resource.Resource{
|
||||||
Cpu: *cpu,
|
CPU: *cpu,
|
||||||
Memory: *memory,
|
Memory: *memory,
|
||||||
MemorySwap: *memorySwap,
|
MemorySwap: *memorySwap,
|
||||||
Network: *network,
|
Network: *network,
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ func setRequestType(args []string, processType string, r Resource, requestType s
|
|||||||
}
|
}
|
||||||
|
|
||||||
resources := map[string]string{
|
resources := map[string]string{
|
||||||
"cpu": r.Cpu,
|
"cpu": r.CPU,
|
||||||
"memory": r.Memory,
|
"memory": r.Memory,
|
||||||
"memory-swap": r.MemorySwap,
|
"memory-swap": r.MemorySwap,
|
||||||
"network": r.Network,
|
"network": r.Network,
|
||||||
@@ -63,7 +63,7 @@ func setRequestType(args []string, processType string, r Resource, requestType s
|
|||||||
}
|
}
|
||||||
|
|
||||||
property := fmt.Sprintf("%v.%v.%v", processType, requestType, key)
|
property := fmt.Sprintf("%v.%v.%v", processType, requestType, key)
|
||||||
err = common.PropertyWrite(PluginName, appName, property, value)
|
err = common.PropertyWrite("resource", appName, property, value)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user