fix: correct stickler-ci issues

This commit is contained in:
Jose Diaz-Gonzalez
2019-03-13 17:57:25 -04:00
parent ab88dbb03d
commit 49e44ce59b
4 changed files with 6 additions and 7 deletions

View File

@@ -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"

View File

@@ -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,

View File

@@ -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,

View File

@@ -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
} }