From 420b899dd5acac0720af1dc01d947dde3bbd629f Mon Sep 17 00:00:00 2001 From: Renan DelValle Date: Wed, 13 Feb 2019 15:40:17 -0800 Subject: [PATCH] goimports fix. --- job.go | 40 ++++++++++++++++++++-------------------- realis.go | 8 ++++---- updatejob.go | 2 +- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/job.go b/job.go index bfbfa81..e743ad2 100644 --- a/job.go +++ b/job.go @@ -88,9 +88,9 @@ func NewJob() Job { taskConfig.Job = jobKey taskConfig.Container = aurora.NewContainer() taskConfig.Container.Mesos = aurora.NewMesosContainer() - taskConfig.MesosFetcherUris = make([]*aurora.MesosFetcherURI,0) - taskConfig.Metadata = make([]*aurora.Metadata,0) - taskConfig.Constraints = make([]*aurora.Constraint,0) + taskConfig.MesosFetcherUris = make([]*aurora.MesosFetcherURI, 0) + taskConfig.Metadata = make([]*aurora.Metadata, 0) + taskConfig.Constraints = make([]*aurora.Constraint, 0) // Resources numCpus := aurora.NewResource() @@ -235,7 +235,7 @@ func (j *AuroraJob) TaskConfig() *aurora.TaskConfig { func (j *AuroraJob) AddURIs(extract bool, cache bool, values ...string) Job { for _, value := range values { j.jobConfig.TaskConfig.MesosFetcherUris = append(j.jobConfig.TaskConfig.MesosFetcherUris, - &aurora.MesosFetcherURI{Value: value, Extract: &extract, Cache: &cache,}) + &aurora.MesosFetcherURI{Value: value, Extract: &extract, Cache: &cache}) } return j } @@ -243,7 +243,7 @@ func (j *AuroraJob) AddURIs(extract bool, cache bool, values ...string) Job { // Adds a Mesos label to the job. Note that Aurora will add the // prefix "org.apache.aurora.metadata." to the beginning of each key. func (j *AuroraJob) AddLabel(key string, value string) Job { - j.jobConfig.TaskConfig.Metadata = append( j.jobConfig.TaskConfig.Metadata, &aurora.Metadata{Key: key, Value: value}) + j.jobConfig.TaskConfig.Metadata = append(j.jobConfig.TaskConfig.Metadata, &aurora.Metadata{Key: key, Value: value}) return j } @@ -267,7 +267,7 @@ func (j *AuroraJob) AddPorts(num int) Job { j.portCount += num for i := start; i < j.portCount; i++ { portName := "org.apache.aurora.port." + strconv.Itoa(i) - j.jobConfig.TaskConfig.Resources = append(j.jobConfig.TaskConfig.Resources,&aurora.Resource{NamedPort: &portName}) + j.jobConfig.TaskConfig.Resources = append(j.jobConfig.TaskConfig.Resources, &aurora.Resource{NamedPort: &portName}) } return j @@ -281,15 +281,15 @@ func (j *AuroraJob) AddPorts(num int) Job { func (j *AuroraJob) AddValueConstraint(name string, negated bool, values ...string) Job { j.jobConfig.TaskConfig.Constraints = append(j.jobConfig.TaskConfig.Constraints, &aurora.Constraint{ - Name: name, - Constraint: &aurora.TaskConstraint{ - Value: &aurora.ValueConstraint{ - Negated: negated, - Values: values, + Name: name, + Constraint: &aurora.TaskConstraint{ + Value: &aurora.ValueConstraint{ + Negated: negated, + Values: values, + }, + Limit: nil, }, - Limit: nil, - }, - }) + }) return j } @@ -300,12 +300,12 @@ func (j *AuroraJob) AddValueConstraint(name string, negated bool, values ...stri func (j *AuroraJob) AddLimitConstraint(name string, limit int32) Job { j.jobConfig.TaskConfig.Constraints = append(j.jobConfig.TaskConfig.Constraints, &aurora.Constraint{ - Name: name, - Constraint: &aurora.TaskConstraint{ - Value: nil, - Limit: &aurora.LimitConstraint{Limit: limit}, - }, - }) + Name: name, + Constraint: &aurora.TaskConstraint{ + Value: nil, + Limit: &aurora.LimitConstraint{Limit: limit}, + }, + }) return j } diff --git a/realis.go b/realis.go index 7719b08..1e568f3 100644 --- a/realis.go +++ b/realis.go @@ -26,8 +26,8 @@ import ( "net/http/cookiejar" "os" "path/filepath" - "sort" - "strings" + "sort" + "strings" "sync" "time" @@ -369,7 +369,7 @@ func NewRealisClient(options ...ClientOption) (Realis, error) { adminClient: aurora.NewAuroraAdminClientFactory(config.transport, config.protoFactory), logger: LevelLogger{Logger: config.logger, debug: config.debug, trace: config.trace}, lock: &sync.Mutex{}, - transport: config.transport}, nil + transport: config.transport}, nil } func GetDefaultClusterFromZKUrl(zkurl string) *Cluster { @@ -858,7 +858,7 @@ func (r *realisClient) RemoveInstances(key *aurora.JobKey, count int32) (*aurora } if len(instanceIds) < int(count) { - return nil, errors.Errorf("Insufficient active instances available for killing: "+ + return nil, errors.Errorf("Insufficient active instances available for killing: "+ " Instances to be killed %d Active instances %d", count, len(instanceIds)) } diff --git a/updatejob.go b/updatejob.go index c8161cd..7dd5523 100644 --- a/updatejob.go +++ b/updatejob.go @@ -58,7 +58,7 @@ func NewDefaultUpdateJob(config *aurora.TaskConfig) *UpdateJob { } // Mirrors defaults set by Pystachio - req.Settings.UpdateOnlyTheseInstances = make([]*aurora.Range,0) + req.Settings.UpdateOnlyTheseInstances = make([]*aurora.Range, 0) req.Settings.UpdateGroupSize = 1 req.Settings.WaitForBatchCompletion = false req.Settings.MinWaitInInstanceRunningMs = 45000