Fix linting issues
An update of golangci-lint yielded new linting issues. This commit fixes them.
This commit is contained in:
@ -113,6 +113,8 @@ func createTaskGroup(job *nomadApi.Job, name string) *nomadApi.TaskGroup {
|
|||||||
return taskGroup
|
return taskGroup
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const portNumberBase = 10
|
||||||
|
|
||||||
func configureNetwork(taskGroup *nomadApi.TaskGroup, networkAccess bool, exposedPorts []uint16) {
|
func configureNetwork(taskGroup *nomadApi.TaskGroup, networkAccess bool, exposedPorts []uint16) {
|
||||||
if len(taskGroup.Tasks) == 0 {
|
if len(taskGroup.Tasks) == 0 {
|
||||||
// This function is only used internally and must be called as last step when configuring the task.
|
// This function is only used internally and must be called as last step when configuring the task.
|
||||||
@ -138,7 +140,7 @@ func configureNetwork(taskGroup *nomadApi.TaskGroup, networkAccess bool, exposed
|
|||||||
networkResource.Mode = "bridge"
|
networkResource.Mode = "bridge"
|
||||||
for _, portNumber := range exposedPorts {
|
for _, portNumber := range exposedPorts {
|
||||||
port := nomadApi.Port{
|
port := nomadApi.Port{
|
||||||
Label: strconv.FormatUint(uint64(portNumber), 10),
|
Label: strconv.FormatUint(uint64(portNumber), portNumberBase),
|
||||||
To: int(portNumber),
|
To: int(portNumber),
|
||||||
}
|
}
|
||||||
networkResource.DynamicPorts = append(networkResource.DynamicPorts, port)
|
networkResource.DynamicPorts = append(networkResource.DynamicPorts, port)
|
||||||
|
@ -171,9 +171,11 @@ func HTTPPutJSON(url string, body interface{}) (response *http.Response, err err
|
|||||||
return HTTPPut(url, reader)
|
return HTTPPut(url, reader)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const templateJobPriority = 100
|
||||||
|
|
||||||
func CreateTemplateJob() (base, job *nomadApi.Job) {
|
func CreateTemplateJob() (base, job *nomadApi.Job) {
|
||||||
base = nomadApi.NewBatchJob(tests.DefaultJobID, tests.DefaultJobID, "region-name", 100)
|
base = nomadApi.NewBatchJob(tests.DefaultJobID, tests.DefaultJobID, "region-name", templateJobPriority)
|
||||||
job = nomadApi.NewBatchJob(tests.DefaultJobID, tests.DefaultJobID, "region-name", 100)
|
job = nomadApi.NewBatchJob(tests.DefaultJobID, tests.DefaultJobID, "region-name", templateJobPriority)
|
||||||
configTaskGroup := nomadApi.NewTaskGroup("config", 0)
|
configTaskGroup := nomadApi.NewTaskGroup("config", 0)
|
||||||
configTaskGroup.Meta = make(map[string]string)
|
configTaskGroup.Meta = make(map[string]string)
|
||||||
configTaskGroup.Meta["prewarmingPoolSize"] = "0"
|
configTaskGroup.Meta["prewarmingPoolSize"] = "0"
|
||||||
|
Reference in New Issue
Block a user