goimports all files

this will allow us to start enforcing formatting on PR checks

Signed-off-by: Taylor Silva <tasilva@vmware.com>
This commit is contained in:
Taylor Silva 2021-10-08 12:50:28 -04:00
parent f93ce8f4cf
commit 133437ccd8
91 changed files with 234 additions and 197 deletions

View File

@ -2,9 +2,10 @@ package accessor_test
import (
"errors"
"github.com/concourse/concourse/atc/atcfakes"
"net/http"
"github.com/concourse/concourse/atc/atcfakes"
"github.com/concourse/concourse/atc"
"github.com/concourse/concourse/atc/api/accessor/accessorfakes"
"github.com/concourse/concourse/atc/db/dbfakes"

View File

@ -3,12 +3,13 @@ package buildserver_test
import (
"encoding/json"
"errors"
. "github.com/concourse/concourse/atc/testhelpers"
"io"
"net/http"
"net/http/httptest"
"time"
. "github.com/concourse/concourse/atc/testhelpers"
"code.cloudfoundry.org/lager/lagertest"
. "github.com/concourse/concourse/atc/api/buildserver"
"github.com/concourse/concourse/atc/db"

View File

@ -1,14 +1,15 @@
package resourceserver
import (
"code.cloudfoundry.org/lager"
"encoding/json"
"fmt"
"github.com/concourse/concourse/atc"
"github.com/google/jsonapi"
"io"
"net/http"
"code.cloudfoundry.org/lager"
"github.com/concourse/concourse/atc"
"github.com/google/jsonapi"
"github.com/concourse/concourse/atc/db"
)
@ -37,8 +38,8 @@ func (s *Server) ClearResourceCache(pipeline db.Pipeline) http.Handler {
if !found {
logger.Debug("could-not-find-resource", lager.Data{
"resource": resourceName,
"version": version,
"resource": resourceName,
"version": version,
})
w.Header().Set("Content-Type", jsonapi.MediaType)
w.WriteHeader(http.StatusNotFound)
@ -87,4 +88,4 @@ func (s *Server) writeJSONResponse(w http.ResponseWriter, obj interface{}) {
return
}
}
}

View File

@ -1,10 +1,11 @@
package builds
import (
"code.cloudfoundry.org/lager"
"context"
"sync"
"code.cloudfoundry.org/lager"
"code.cloudfoundry.org/lager/lagerctx"
"github.com/concourse/concourse/atc/db"
"github.com/concourse/concourse/atc/metric"

View File

@ -1,12 +1,13 @@
package builds_test
import (
"code.cloudfoundry.org/lager/lagertest"
"context"
"io/ioutil"
"testing"
"time"
"code.cloudfoundry.org/lager/lagertest"
"github.com/concourse/concourse/atc/builds"
"github.com/concourse/concourse/atc/builds/buildsfakes"
"github.com/concourse/concourse/atc/component"

View File

@ -9,4 +9,3 @@ type Component interface {
Reload() (bool, error)
UpdateLastRan() error
}

View File

@ -5,8 +5,8 @@ import (
"io"
"sync"
"github.com/concourse/concourse/worker/baggageclaim"
"github.com/concourse/concourse/atc/compression"
"github.com/concourse/concourse/worker/baggageclaim"
)
type FakeCompression struct {

View File

@ -499,8 +499,8 @@ func validateDisplay(c atc.Config) ([]atc.ConfigWarning, error) {
func detectCycle(j atc.JobConfig, visited map[string]int, pipelineConfig atc.Config) error {
const (
nonVisited = 0
semiVisited = 1
nonVisited = 0
semiVisited = 1
alreadyVisited = 2
)
visited[j.Name] = semiVisited

View File

@ -2274,13 +2274,13 @@ var _ = Describe("ValidateConfig", func() {
},
Jobs: atc.JobConfigs{
{
Name: "some-job-1",
Name: "some-job-1",
PlanSequence: []atc.Step{
{
Config: &atc.GetStep{
Name: "some-input",
Resource: "some-resource",
Passed: []string{"some-job-1"},
Passed: []string{"some-job-1"},
},
},
},
@ -2308,54 +2308,53 @@ var _ = Describe("ValidateConfig", func() {
},
Jobs: atc.JobConfigs{
{
Name: "some-job-1",
Name: "some-job-1",
PlanSequence: []atc.Step{
{
Config: &atc.GetStep{
Name: "some-input",
Resource: "some-resource",
Passed: []string{"some-job-2"},
Passed: []string{"some-job-2"},
},
},
},
},
{
Name: "some-job-2",
Name: "some-job-2",
PlanSequence: []atc.Step{
{
Config: &atc.GetStep{
Name: "some-input",
Resource: "some-resource",
Passed: []string{"some-job-3"},
Passed: []string{"some-job-3"},
},
},
},
},
{
Name: "some-job-3",
Name: "some-job-3",
PlanSequence: []atc.Step{
{
Config: &atc.GetStep{
Name: "some-input",
Resource: "some-resource",
Passed: []string{"some-job-4"},
Passed: []string{"some-job-4"},
},
},
},
},
{
Name: "some-job-4",
Name: "some-job-4",
PlanSequence: []atc.Step{
{
Config: &atc.GetStep{
Name: "some-input",
Resource: "some-resource",
Passed: []string{"some-job-2"},
Passed: []string{"some-job-2"},
},
},
},
},
},
}
})
@ -2379,31 +2378,31 @@ var _ = Describe("ValidateConfig", func() {
},
Jobs: atc.JobConfigs{
{
Name: "some-job-1",
Name: "some-job-1",
PlanSequence: []atc.Step{
{
Config: &atc.GetStep{
Name: "some-input",
Resource: "some-resource",
Passed: []string{"some-job-2"},
Passed: []string{"some-job-2"},
},
},
},
},
{
Name: "some-job-2",
Name: "some-job-2",
PlanSequence: []atc.Step{
{
Config: &atc.GetStep{
Name: "some-input",
Resource: "some-resource",
Passed: []string{"some-job-3", "some-job-4"},
Passed: []string{"some-job-3", "some-job-4"},
},
},
},
},
{
Name: "some-job-3",
Name: "some-job-3",
PlanSequence: []atc.Step{
{
Config: &atc.GetStep{
@ -2414,18 +2413,17 @@ var _ = Describe("ValidateConfig", func() {
},
},
{
Name: "some-job-4",
Name: "some-job-4",
PlanSequence: []atc.Step{
{
Config: &atc.GetStep{
Name: "some-input",
Resource: "some-resource",
Passed: []string{"some-job-3"},
Passed: []string{"some-job-3"},
},
},
},
},
},
}
})

View File

@ -2,6 +2,7 @@ package dummy
import (
"fmt"
"github.com/concourse/concourse/atc/creds"
flags "github.com/jessevdk/go-flags"
)

View File

@ -1,10 +1,11 @@
package vault
import (
"code.cloudfoundry.org/lager"
"sync"
"time"
"code.cloudfoundry.org/lager"
"github.com/cenkalti/backoff"
)

View File

@ -2,9 +2,10 @@ package db
import (
"database/sql"
"github.com/patrickmn/go-cache"
"time"
"github.com/patrickmn/go-cache"
sq "github.com/Masterminds/squirrel"
)

View File

@ -371,22 +371,22 @@ func (b *build) Schema() string { return b.schema }
func (b *build) PrivatePlan() atc.Plan { return b.privatePlan }
func (b *build) PublicPlan() *json.RawMessage { return b.publicPlan }
func (b *build) HasPlan() bool { return string(*b.publicPlan) != "{}" }
func (b *build) CreateTime() time.Time { return b.createTime }
func (b *build) StartTime() time.Time { return b.startTime }
func (b *build) EndTime() time.Time { return b.endTime }
func (b *build) ReapTime() time.Time { return b.reapTime }
func (b *build) Comment() string { return b.comment }
func (b *build) Status() BuildStatus { return b.status }
func (b *build) IsScheduled() bool { return b.scheduled }
func (b *build) IsDrained() bool { return b.drained }
func (b *build) IsRunning() bool { return !b.completed }
func (b *build) IsAborted() bool { return b.aborted }
func (b *build) IsCompleted() bool { return b.completed }
func (b *build) InputsReady() bool { return b.inputsReady }
func (b *build) RerunOf() int { return b.rerunOf }
func (b *build) RerunOfName() string { return b.rerunOfName }
func (b *build) RerunNumber() int { return b.rerunNumber }
func (b *build) CreatedBy() *string { return b.createdBy }
func (b *build) CreateTime() time.Time { return b.createTime }
func (b *build) StartTime() time.Time { return b.startTime }
func (b *build) EndTime() time.Time { return b.endTime }
func (b *build) ReapTime() time.Time { return b.reapTime }
func (b *build) Comment() string { return b.comment }
func (b *build) Status() BuildStatus { return b.status }
func (b *build) IsScheduled() bool { return b.scheduled }
func (b *build) IsDrained() bool { return b.drained }
func (b *build) IsRunning() bool { return !b.completed }
func (b *build) IsAborted() bool { return b.aborted }
func (b *build) IsCompleted() bool { return b.completed }
func (b *build) InputsReady() bool { return b.inputsReady }
func (b *build) RerunOf() int { return b.rerunOf }
func (b *build) RerunOfName() string { return b.rerunOfName }
func (b *build) RerunNumber() int { return b.rerunNumber }
func (b *build) CreatedBy() *string { return b.createdBy }
func (b *build) isNewerThanLastCheckOf(input Resource) bool {
return b.createTime.After(input.LastCheckEndTime())

View File

@ -1,13 +1,14 @@
package db
import (
"code.cloudfoundry.org/lager"
"database/sql"
"encoding/json"
"fmt"
"strconv"
"time"
"code.cloudfoundry.org/lager"
sq "github.com/Masterminds/squirrel"
"github.com/concourse/concourse/atc/db/lock"
)

View File

@ -13,7 +13,7 @@ import (
var _ = Describe("BuildFactory", func() {
var (
team db.Team
team db.Team
)
BeforeEach(func() {

View File

@ -1,11 +1,15 @@
package db
import (
"code.cloudfoundry.org/lager"
"database/sql"
"encoding/json"
"errors"
"fmt"
"strconv"
"strings"
"time"
"code.cloudfoundry.org/lager"
sq "github.com/Masterminds/squirrel"
"github.com/concourse/concourse/atc"
"github.com/concourse/concourse/atc/creds"
@ -16,9 +20,6 @@ import (
"github.com/concourse/concourse/vars"
"github.com/lib/pq"
"go.opentelemetry.io/otel/propagation"
"strconv"
"strings"
"time"
)
// inMemoryCheckBuildForApi implements db.BuildForAPI. It handles API operations

View File

@ -1,11 +1,12 @@
package db_test
import (
"code.cloudfoundry.org/lager"
"context"
"fmt"
"time"
"code.cloudfoundry.org/lager"
"github.com/concourse/concourse/atc"
"github.com/concourse/concourse/atc/db"
"github.com/concourse/concourse/atc/db/lock"

View File

@ -105,20 +105,20 @@ var _ = Describe("Build", func() {
Expect(build.Comment()).To(Equal(comment))
})
It("has run state id", func(){
It("has run state id", func() {
Expect(build.RunStateID()).To(Equal(fmt.Sprintf("build:%v", build.ID())))
})
It("all associated teams should be only the team itself", func(){
It("all associated teams should be only the team itself", func() {
Expect(build.AllAssociatedTeamNames()).To(HaveLen(1))
Expect(build.AllAssociatedTeamNames()[0]).To(Equal(build.TeamName()))
})
It("has resource cache user", func(){
It("has resource cache user", func() {
Expect(build.ResourceCacheUser()).To(Equal(db.ForBuild(build.ID())))
})
It("has container owner", func(){
It("has container owner", func() {
Expect(build.ContainerOwner("some-plan")).To(Equal(db.NewBuildStepContainerOwner(build.ID(), "some-plan", build.TeamID())))
})

View File

@ -1,11 +1,12 @@
package db_test
import (
"code.cloudfoundry.org/lager"
"context"
"fmt"
"time"
"code.cloudfoundry.org/lager"
"github.com/concourse/concourse/atc"
"github.com/concourse/concourse/atc/db"
"github.com/concourse/concourse/atc/db/dbfakes"

View File

@ -2,6 +2,7 @@ package db_test
import (
"context"
sq "github.com/Masterminds/squirrel"
"github.com/concourse/concourse/atc"
"github.com/concourse/concourse/atc/db"
@ -17,7 +18,7 @@ var _ = Describe("Check Lifecycle", func() {
plan atc.Plan
scopeOfDefaultResource db.ResourceConfigScope
scopeOfDefaultResourceType db.ResourceConfigScope
scopeOfDefaultPrototype db.ResourceConfigScope
scopeOfDefaultPrototype db.ResourceConfigScope
)
BeforeEach(func() {

View File

@ -2,9 +2,10 @@ package db_test
import (
"context"
"github.com/concourse/concourse/atc/util"
"time"
"github.com/concourse/concourse/atc/util"
sq "github.com/Masterminds/squirrel"
"github.com/concourse/concourse/atc"
"github.com/concourse/concourse/atc/db"

View File

@ -23,4 +23,3 @@ func (n *FallbackStrategy) Decrypt(text string, nonce *string) ([]byte, error) {
}
return n.fallback.Decrypt(text, nonce)
}

View File

@ -52,4 +52,3 @@ var _ = Describe("Encryption Key with Fallback", func() {
})
})
})

View File

@ -109,4 +109,3 @@ var _ = Describe("Migrate job ids to build image resource caches", func() {
})
})
})

View File

@ -97,7 +97,7 @@ func newNoopNotifier() Notifier {
}
type noopNotifier struct {
notify chan struct{}
notify chan struct{}
}
func (notifier *noopNotifier) Notify() <-chan struct{} {

View File

@ -2,6 +2,7 @@ package db
import (
"database/sql"
sq "github.com/Masterminds/squirrel"
"github.com/concourse/concourse/atc"

View File

@ -125,22 +125,22 @@ type prototype struct {
lastCheckEndTime time.Time
}
func (p *prototype) ID() int { return p.id }
func (p *prototype) TeamID() int { return p.teamID }
func (p *prototype) TeamName() string { return p.teamName }
func (p *prototype) Name() string { return p.name }
func (p *prototype) Type() string { return p.type_ }
func (p *prototype) Privileged() bool { return p.privileged }
func (p *prototype) CheckEvery() *atc.CheckEvery { return p.checkEvery }
func (p *prototype) CheckTimeout() string { return "" }
func (p *prototype) LastCheckStartTime() time.Time { return p.lastCheckStartTime }
func (p *prototype) LastCheckEndTime() time.Time { return p.lastCheckEndTime }
func (p *prototype) Source() atc.Source { return p.source }
func (p *prototype) Defaults() atc.Source { return p.defaults }
func (p *prototype) Params() atc.Params { return p.params }
func (p *prototype) Tags() atc.Tags { return p.tags }
func (p *prototype) ResourceConfigID() int { return p.resourceConfigID }
func (p *prototype) ResourceConfigScopeID() int { return p.resourceConfigScopeID }
func (p *prototype) ID() int { return p.id }
func (p *prototype) TeamID() int { return p.teamID }
func (p *prototype) TeamName() string { return p.teamName }
func (p *prototype) Name() string { return p.name }
func (p *prototype) Type() string { return p.type_ }
func (p *prototype) Privileged() bool { return p.privileged }
func (p *prototype) CheckEvery() *atc.CheckEvery { return p.checkEvery }
func (p *prototype) CheckTimeout() string { return "" }
func (p *prototype) LastCheckStartTime() time.Time { return p.lastCheckStartTime }
func (p *prototype) LastCheckEndTime() time.Time { return p.lastCheckEndTime }
func (p *prototype) Source() atc.Source { return p.source }
func (p *prototype) Defaults() atc.Source { return p.defaults }
func (p *prototype) Params() atc.Params { return p.params }
func (p *prototype) Tags() atc.Tags { return p.tags }
func (p *prototype) ResourceConfigID() int { return p.resourceConfigID }
func (p *prototype) ResourceConfigScopeID() int { return p.resourceConfigScopeID }
func (p *prototype) Version() atc.Version { return p.version }
func (p *prototype) CurrentPinnedVersion() atc.Version { return nil }

View File

@ -87,4 +87,4 @@ func paramsHash(p atc.Params) string {
}
return mapHash(atc.Params{})
}
}

View File

@ -1,13 +1,14 @@
package db_test
import (
"time"
sq "github.com/Masterminds/squirrel"
"github.com/concourse/concourse/atc"
"github.com/concourse/concourse/atc/db"
"github.com/lib/pq"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"time"
)
var _ = Describe("ResourceCache", func() {

View File

@ -3,10 +3,11 @@ package db_test
import (
"context"
"encoding/json"
"github.com/concourse/concourse/atc/util"
"strconv"
"time"
"github.com/concourse/concourse/atc/util"
"github.com/concourse/concourse/atc"
"github.com/concourse/concourse/atc/db"
"github.com/concourse/concourse/atc/db/dbtest"

View File

@ -285,4 +285,4 @@ func (d *checkDelegate) pipeline() (db.Pipeline, error) {
d.cachedPipeline = pipeline
return d.cachedPipeline, nil
}
}

View File

@ -127,4 +127,3 @@ func (d *getDelegate) UpdateResourceVersion(log lager.Logger, resourceName strin
func (d *getDelegate) ResourceCacheUser() db.ResourceCacheUser {
return d.build.ResourceCacheUser()
}

View File

@ -15,16 +15,16 @@ func NewSetPipelineStepDelegate(
planID atc.PlanID,
state exec.RunState,
clock clock.Clock,
policyChecker policy.Checker,
policyChecker policy.Checker,
) *setPipelineStepDelegate {
return &setPipelineStepDelegate{
buildStepDelegate{
build: build,
planID: planID,
clock: clock,
state: state,
stdout: nil,
stderr: nil,
build: build,
planID: planID,
clock: clock,
state: state,
stdout: nil,
stderr: nil,
policyChecker: policyChecker,
},
}

View File

@ -98,12 +98,12 @@ var _ = Describe("RetryErrorStep", func() {
Expect(message).To(Equal(fmt.Sprintf("%s, will retry ...", cause.Error())))
})
Context("when build aborted", func(){
BeforeEach(func(){
Context("when build aborted", func() {
BeforeEach(func() {
cancel()
})
It("should not retry", func(){
It("should not retry", func() {
Expect(runErr).To(Equal(cause))
})
})

View File

@ -53,7 +53,7 @@ type PolicyCheckResult interface {
}
type internalPolicyCheckResult struct {
allowed bool
allowed bool
messages []string
}
@ -72,7 +72,7 @@ func (r internalPolicyCheckResult) Messages() []string {
// PassedPolicyCheck creates a generic passed check
func PassedPolicyCheck() PolicyCheckResult {
return internalPolicyCheckResult{
allowed: true,
allowed: true,
messages: []string{""},
}
}

View File

@ -10,9 +10,9 @@ import (
var _ = Describe("Policy checker", func() {
var (
checker policy.Checker
filter policy.Filter
err error
checker policy.Checker
filter policy.Filter
err error
fakeResult *policyfakes.FakePolicyCheckResult
)
@ -101,7 +101,7 @@ var _ = Describe("Policy checker", func() {
}))
})
It("return the same result the agent returns", func(){
It("return the same result the agent returns", func() {
Expect(checkErr).ToNot(HaveOccurred())
Expect(output).To(Equal(fakeResult))
})

View File

@ -15,4 +15,4 @@ type ConfigResponse struct {
type ClearResourceCacheResponse struct {
CachesRemoved int64 `json:"caches_removed"`
}
}

View File

@ -3,8 +3,9 @@ package testhelpers
import (
"encoding/json"
"fmt"
"github.com/onsi/gomega/types"
"net/http"
"github.com/onsi/gomega/types"
)
func IncludeHeaderEntries(expected map[string]string) types.GomegaMatcher {

View File

@ -8,7 +8,7 @@ type SequenceGenerator interface {
type seqGenerator struct {
current int
lock sync.Mutex
lock sync.Mutex
}
func NewSequenceGenerator(start int) SequenceGenerator {
@ -22,6 +22,6 @@ func (g *seqGenerator) Next() int {
defer g.lock.Unlock()
next := g.current
g.current ++
g.current++
return next
}

View File

@ -2,10 +2,11 @@ package wrappa_test
import (
"fmt"
. "github.com/concourse/concourse/atc/testhelpers"
"net/http"
"net/http/httptest"
. "github.com/concourse/concourse/atc/testhelpers"
"github.com/concourse/concourse/atc/wrappa"
. "github.com/onsi/ginkgo"

View File

@ -2,18 +2,19 @@ package commands
import (
"fmt"
"github.com/concourse/concourse/go-concourse/concourse"
"strconv"
"github.com/concourse/concourse/go-concourse/concourse"
"github.com/concourse/concourse/atc"
"github.com/concourse/concourse/fly/commands/internal/flaghelpers"
"github.com/concourse/concourse/fly/rc"
)
type AbortBuildCommand struct {
Job flaghelpers.JobFlag `short:"j" long:"job" value-name:"PIPELINE/JOB" description:"Name of a job to cancel"`
Build string `short:"b" long:"build" required:"true" description:"If job is specified: build number to cancel. If job not specified: build id"`
Team flaghelpers.TeamFlag `long:"team" description:"Name of the team to which the pipeline belongs, if different from the target default"`
Job flaghelpers.JobFlag `short:"j" long:"job" value-name:"PIPELINE/JOB" description:"Name of a job to cancel"`
Build string `short:"b" long:"build" required:"true" description:"If job is specified: build number to cancel. If job not specified: build id"`
Team flaghelpers.TeamFlag `long:"team" description:"Name of the team to which the pipeline belongs, if different from the target default"`
}
func (command *AbortBuildCommand) Execute([]string) error {

View File

@ -66,4 +66,3 @@ func (command *CheckResourceCommand) Execute(args []string) error {
return nil
}

View File

@ -3,6 +3,7 @@ package commands
import (
"encoding/json"
"fmt"
"github.com/vito/go-interact/interact"
"github.com/concourse/concourse/atc"

View File

@ -12,7 +12,7 @@ import (
type DestroyPipelineCommand struct {
Pipeline flaghelpers.PipelineFlag `short:"p" long:"pipeline" required:"true" description:"Pipeline to destroy"`
SkipInteractive bool `short:"n" long:"non-interactive" description:"Destroy the pipeline without confirmation"`
Team flaghelpers.TeamFlag `long:"team" description:"Name of the team to which the pipeline belongs, if different from the target default"`
Team flaghelpers.TeamFlag `long:"team" description:"Name of the team to which the pipeline belongs, if different from the target default"`
}
func (command *DestroyPipelineCommand) Validate() error {

View File

@ -35,7 +35,7 @@ type HijackCommand struct {
PositionalArgs struct {
Command []string `positional-arg-name:"command" description:"The command to run in the container (default: bash)"`
} `positional-args:"yes"`
Team flaghelpers.TeamFlag `long:"team" description:"Name of the team to which the container belongs, if different from the target default"`
Team flaghelpers.TeamFlag `long:"team" description:"Name of the team to which the container belongs, if different from the target default"`
}
func (command *HijackCommand) Execute([]string) error {

View File

@ -1,9 +1,10 @@
package flaghelpers
import (
"github.com/concourse/concourse/go-concourse/concourse"
"strings"
"github.com/concourse/concourse/go-concourse/concourse"
"github.com/concourse/concourse/fly/rc"
"github.com/jessevdk/go-flags"
)

View File

@ -3,10 +3,11 @@ package commands
import (
"errors"
"fmt"
"github.com/concourse/concourse/fly/commands/internal/flaghelpers"
"sort"
"strings"
"github.com/concourse/concourse/fly/commands/internal/flaghelpers"
"github.com/concourse/concourse/fly/commands/internal/displayhelpers"
"github.com/concourse/concourse/fly/rc"
"github.com/concourse/concourse/go-concourse/concourse"
@ -15,9 +16,9 @@ import (
var ErrMissingPipelineName = errors.New("Need to specify at least one pipeline name")
type OrderPipelinesCommand struct {
Alphabetical bool `short:"a" long:"alphabetical" description:"Order all pipelines alphabetically"`
Pipelines []string `short:"p" long:"pipeline" description:"Name of pipeline (can be specified multiple times to provide relative ordering)"`
Team flaghelpers.TeamFlag `long:"team" description:"Name of the team to which the pipelines belong, if different from the target default"`
Alphabetical bool `short:"a" long:"alphabetical" description:"Order all pipelines alphabetically"`
Pipelines []string `short:"p" long:"pipeline" description:"Name of pipeline (can be specified multiple times to provide relative ordering)"`
Team flaghelpers.TeamFlag `long:"team" description:"Name of the team to which the pipelines belong, if different from the target default"`
}
func (command *OrderPipelinesCommand) Execute(args []string) error {

View File

@ -28,9 +28,9 @@ type SetPipelineCommand struct {
YAMLVar []flaghelpers.YAMLVariablePairFlag `short:"y" long:"yaml-var" unquote:"false" value-name:"[NAME=YAML]" description:"Specify a YAML value to set for a variable in the pipeline"`
InstanceVars []flaghelpers.YAMLVariablePairFlag `short:"i" long:"instance-var" unquote:"false" hidden:"true" value-name:"[NAME=STRING]" description:"Specify a YAML value to set for an instance variable"`
VarsFrom []atc.PathFlag `short:"l" long:"load-vars-from" description:"Variable flag that can be used for filling in template values in configuration from a YAML file"`
VarsFrom []atc.PathFlag `short:"l" long:"load-vars-from" description:"Variable flag that can be used for filling in template values in configuration from a YAML file"`
Team flaghelpers.TeamFlag `long:"team" description:"Name of the team to which the pipeline belongs, if different from the target default"`
Team flaghelpers.TeamFlag `long:"team" description:"Name of the team to which the pipeline belongs, if different from the target default"`
}
func (command *SetPipelineCommand) Validate() ([]concourse.ConfigWarning, error) {

View File

@ -15,9 +15,9 @@ import (
)
type TriggerJobCommand struct {
Job flaghelpers.JobFlag `short:"j" long:"job" required:"true" value-name:"PIPELINE/JOB" description:"Name of a job to trigger"`
Watch bool `short:"w" long:"watch" description:"Start watching the build output"`
Team flaghelpers.TeamFlag `long:"team" description:"Name of the team to which the job belongs, if different from the target default"`
Job flaghelpers.JobFlag `short:"j" long:"job" required:"true" value-name:"PIPELINE/JOB" description:"Name of a job to trigger"`
Watch bool `short:"w" long:"watch" description:"Start watching the build output"`
Team flaghelpers.TeamFlag `long:"team" description:"Name of the team to which the job belongs, if different from the target default"`
}
func (command *TriggerJobCommand) Execute(args []string) error {

View File

@ -9,8 +9,8 @@ import (
)
type UnpauseJobCommand struct {
Job flaghelpers.JobFlag `short:"j" long:"job" required:"true" value-name:"PIPELINE/JOB" description:"Name of a job to unpause"`
Team flaghelpers.TeamFlag `long:"team" description:"Name of the team to which the job belongs, if different from the target default"`
Job flaghelpers.JobFlag `short:"j" long:"job" required:"true" value-name:"PIPELINE/JOB" description:"Name of a job to unpause"`
Team flaghelpers.TeamFlag `long:"team" description:"Name of the team to which the job belongs, if different from the target default"`
}
func (command *UnpauseJobCommand) Execute(args []string) error {

View File

@ -211,7 +211,6 @@ var _ = Describe("AbortBuild", func() {
Context("when the job id and the build id are specified", func() {
Context("when the job and the build exist", func() {
BeforeEach(func() {
expectedURL := "/api/v1/teams/diff-team/pipelines/my-pipeline/jobs/my-job/builds/3"

View File

@ -20,9 +20,9 @@ var _ = Describe("Fly CLI", func() {
var (
expectedQueryParams []string
expectedURL = "/api/v1/teams/main/pipelines/some-pipeline/resources/some-resource/cache"
stdin io.Writer
args []string
sess *gexec.Session
stdin io.Writer
args []string
sess *gexec.Session
)
BeforeEach(func() {
@ -58,7 +58,6 @@ var _ = Describe("Fly CLI", func() {
})
})
Context("when resource and a version are specified", func() {
JustBeforeEach(func() {
atcServer.AppendHandlers(
@ -121,7 +120,6 @@ var _ = Describe("Fly CLI", func() {
})
})
Context("when the resource does not exist", func() {
var expectedURL = "/api/v1/teams/main/pipelines/some-pipeline/resources/no-existing-resource/cache"
@ -135,7 +133,7 @@ var _ = Describe("Fly CLI", func() {
})
BeforeEach(func() {
args = append(args, "-r", "some-pipeline/no-existing-resource")
args = append(args, "-r", "some-pipeline/no-existing-resource")
})
It("writes that it did not exist", func() {

View File

@ -1276,7 +1276,7 @@ this is super secure
))
atcServer.RouteToHandler("GET", path_get, ghttp.RespondWithJSONEncoded(http.StatusOK,
atc.Pipeline{ID: 1, Name: "awesome-pipeline", Paused: false, TeamName: "main", ParentBuildID: 321, ParentJobID: 123}))
atc.Pipeline{ID: 1, Name: "awesome-pipeline", Paused: false, TeamName: "main", ParentBuildID: 321, ParentJobID: 123}))
config.Jobs[0].Name = "updated-name"
})

View File

@ -2,6 +2,10 @@ package integration_test
import (
"fmt"
"io"
"net/http"
"os/exec"
"github.com/concourse/concourse/atc"
"github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo"
@ -9,9 +13,6 @@ import (
"github.com/onsi/gomega/gbytes"
"github.com/onsi/gomega/gexec"
"github.com/onsi/gomega/ghttp"
"io"
"net/http"
"os/exec"
)
var _ = Describe("Fly CLI", func() {

View File

@ -39,7 +39,7 @@ var _ = Describe("Fly CLI", func() {
"other_team": {"owner"},
"test_team": {"owner", "viewer"},
},
"connector": "some-connector",
"connector": "some-connector",
"display_user_id": "test_id",
}),
),

View File

@ -1,3 +1,4 @@
//go:build !windows
// +build !windows
package pty

View File

@ -1,3 +1,4 @@
//go:build windows
// +build windows
package pty

View File

@ -1,3 +1,4 @@
//go:build !windows
// +build !windows
package pty

View File

@ -1,3 +1,4 @@
//go:build windows
// +build windows
package pty

View File

@ -1,4 +1,5 @@
//+build !windows
//go:build !windows
// +build !windows
package pty

View File

@ -1,4 +1,5 @@
//+build windows
//go:build windows
// +build windows
package pty

View File

@ -3,11 +3,12 @@ package concourse
import (
"bytes"
"encoding/json"
"net/http"
"net/url"
"github.com/concourse/concourse/atc"
"github.com/concourse/concourse/go-concourse/concourse/internal"
"github.com/tedsuo/rata"
"net/http"
"net/url"
)
func (team *team) Resource(pipelineRef atc.PipelineRef, resourceName string) (atc.Resource, bool, error) {
@ -53,7 +54,6 @@ func (team *team) ListResources(pipelineRef atc.PipelineRef) ([]atc.Resource, er
return resources, err
}
func (team *team) ClearResourceCache(pipelineRef atc.PipelineRef, ResourceName string, version atc.Version) (int64, error) {
params := rata.Params{
"team_name": team.Name(),
@ -87,4 +87,4 @@ func (team *team) ClearResourceCache(pipelineRef atc.PipelineRef, ResourceName s
} else {
return crcResponse.CachesRemoved, nil
}
}
}

View File

@ -122,9 +122,9 @@ var _ = Describe("ATC Handler Resource", func() {
Describe("ClearResourceCache", func() {
var (
expectedQueryParams []string
expectedURL = "/api/v1/teams/some-team/pipelines/some-pipeline/resources/some-resource/cache"
version = atc.Version{}
pipelineRef = atc.PipelineRef{Name: "some-pipeline"}
expectedURL = "/api/v1/teams/some-team/pipelines/some-pipeline/resources/some-resource/cache"
version = atc.Version{}
pipelineRef = atc.PipelineRef{Name: "some-pipeline"}
)
Context("when the API call succeeds", func() {

View File

@ -2,9 +2,10 @@ package concourse_test
import (
"errors"
"github.com/concourse/concourse/atc/api/teamserver"
"net/http"
"github.com/concourse/concourse/atc/api/teamserver"
"github.com/concourse/concourse/atc"
"github.com/concourse/concourse/go-concourse/concourse"
"github.com/concourse/concourse/go-concourse/concourse/internal"

View File

@ -18,17 +18,17 @@ func init() {
}
type SAMLFlags struct {
DisplayName string `long:"display-name" description:"The auth provider name displayed to users on the login page"`
SsoURL string `long:"sso-url" description:"(Required) SSO URL used for POST value"`
CACert flag.File `long:"ca-cert" description:"(Required) CA Certificate"`
EntityIssuer string `long:"entity-issuer" description:"Manually specify dex's Issuer value."`
SsoIssuer string `long:"sso-issuer" description:"Issuer value expected in the SAML response."`
UsernameAttr string `long:"username-attr" default:"name" description:"The user name indicates which claim to use to map an external user name to a Concourse user name."`
EmailAttr string `long:"email-attr" default:"email" description:"The email indicates which claim to use to map an external user email to a Concourse user email."`
GroupsAttr string `long:"groups-attr" default:"groups" description:"The groups key indicates which attribute to use to map external groups to Concourse teams."`
GroupsDelim string `long:"groups-delim" description:"If specified, groups are returned as string, this delimiter will be used to split the group string."`
NameIDPolicyFormat string `long:"name-id-policy-format" description:"Requested format of the NameID. The NameID value is is mapped to the ID Token 'sub' claim."`
InsecureSkipVerify bool `long:"skip-ssl-validation" description:"Skip SSL validation"`
DisplayName string `long:"display-name" description:"The auth provider name displayed to users on the login page"`
SsoURL string `long:"sso-url" description:"(Required) SSO URL used for POST value"`
CACert flag.File `long:"ca-cert" description:"(Required) CA Certificate"`
EntityIssuer string `long:"entity-issuer" description:"Manually specify dex's Issuer value."`
SsoIssuer string `long:"sso-issuer" description:"Issuer value expected in the SAML response."`
UsernameAttr string `long:"username-attr" default:"name" description:"The user name indicates which claim to use to map an external user name to a Concourse user name."`
EmailAttr string `long:"email-attr" default:"email" description:"The email indicates which claim to use to map an external user email to a Concourse user email."`
GroupsAttr string `long:"groups-attr" default:"groups" description:"The groups key indicates which attribute to use to map external groups to Concourse teams."`
GroupsDelim string `long:"groups-delim" description:"If specified, groups are returned as string, this delimiter will be used to split the group string."`
NameIDPolicyFormat string `long:"name-id-policy-format" description:"Requested format of the NameID. The NameID value is is mapped to the ID Token 'sub' claim."`
InsecureSkipVerify bool `long:"skip-ssl-validation" description:"Skip SSL validation"`
}
func (flag *SAMLFlags) Name() string {

View File

@ -1,9 +1,10 @@
package skycmd_test
import (
"testing"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"testing"
)
func TestDexServer(t *testing.T) {

View File

@ -2,11 +2,12 @@ package token_test
import (
"errors"
"github.com/concourse/concourse/atc/atcfakes"
"net/http"
"net/http/httptest"
"time"
"github.com/concourse/concourse/atc/atcfakes"
"code.cloudfoundry.org/lager/lagertest"
"github.com/concourse/concourse/atc/db"
"github.com/concourse/concourse/atc/db/dbfakes"

View File

@ -2,6 +2,7 @@ package testflight_test
import (
"fmt"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gbytes"

View File

@ -27,7 +27,7 @@ var _ = Describe("External Tasks", func() {
Context("when external task relies on template variables", func() {
var taskFileContents string
BeforeEach(func(){
BeforeEach(func() {
// we are testing an external task with two external variables - ((image_resource_type)) and ((echo_text))
taskFileContents = `---
platform: linux
@ -44,7 +44,6 @@ run:
JustBeforeEach(func() {
err := ioutil.WriteFile(
filepath.Join(fixture, "task.yml"),
[]byte(taskFileContents),
@ -140,7 +139,7 @@ echo_text: Hello World From Command Line
})
Context("when task vars are not used, task should get vars from var_sources", func() {
BeforeEach(func(){
BeforeEach(func() {
taskFileContents = `---
platform: linux

View File

@ -1,3 +1,4 @@
//go:build tools
// +build tools
package tools

View File

@ -1,23 +1,24 @@
package tsa
import (
"code.cloudfoundry.org/lager/lagerctx"
"context"
"errors"
"golang.org/x/crypto/ssh"
"net"
"time"
"code.cloudfoundry.org/lager/lagerctx"
"golang.org/x/crypto/ssh"
)
//
func KeepAlive(ctx context.Context, sshClient *ssh.Client, tcpConn *net.TCPConn, interval time.Duration, timeout time.Duration){
func KeepAlive(ctx context.Context, sshClient *ssh.Client, tcpConn *net.TCPConn, interval time.Duration, timeout time.Duration) {
logger := lagerctx.WithSession(ctx, "keepalive")
keepAliveTicker := time.NewTicker(interval)
for {
sendKeepAliveRequest := make(chan error,1)
go func (){
sendKeepAliveRequest := make(chan error, 1)
go func() {
defer close(sendKeepAliveRequest)
// ignore reply; server may just not have handled it, since there's no
// standard keepalive request name
@ -53,4 +54,4 @@ func KeepAlive(ctx context.Context, sshClient *ssh.Client, tcpConn *net.TCPConn,
return
}
}
}
}

View File

@ -6,9 +6,9 @@ import (
"net"
"time"
"golang.org/x/crypto/ssh"
"github.com/concourse/concourse/tsa"
"github.com/concourse/concourse/tsa/tsafakes"
"golang.org/x/crypto/ssh"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
@ -16,13 +16,13 @@ import (
var _ = Describe("KeepAlive", func() {
var (
ctx context.Context
ctx context.Context
sshClient *ssh.Client
fakeConn *tsafakes.FakeConn
tcpConn *net.TCPConn
fakeConn *tsafakes.FakeConn
tcpConn *net.TCPConn
)
BeforeEach(func(){
BeforeEach(func() {
ctx = context.Background()
fakeConn = &tsafakes.FakeConn{}
@ -35,31 +35,30 @@ var _ = Describe("KeepAlive", func() {
})
JustBeforeEach(func(){
go tsa.KeepAlive(ctx, sshClient, tcpConn, time.Millisecond * 50, time.Millisecond * 50)
JustBeforeEach(func() {
go tsa.KeepAlive(ctx, sshClient, tcpConn, time.Millisecond*50, time.Millisecond*50)
})
Context("when SendRequest fails", func(){
BeforeEach(func(){
Context("when SendRequest fails", func() {
BeforeEach(func() {
fakeConn.SendRequestReturns(false, []byte{}, errors.New("some foo error"))
})
It("closes the connection", func(){
It("closes the connection", func() {
Eventually(fakeConn.CloseCallCount).Should(Equal(1))
})
})
Context("when SendRequest times out", func(){
BeforeEach(func(){
fakeConn.SendRequestStub = func(name string, wantReply bool, payload []byte) (bool, []byte, error){
Context("when SendRequest times out", func() {
BeforeEach(func() {
fakeConn.SendRequestStub = func(name string, wantReply bool, payload []byte) (bool, []byte, error) {
time.Sleep(time.Millisecond * 500)
return true, []byte{}, nil
}
})
It("closes the connection", func(){
It("closes the connection", func() {
Eventually(fakeConn.CloseCallCount).Should(Equal(1))
})
})
})

View File

@ -1,13 +1,14 @@
package api
import (
"code.cloudfoundry.org/lager"
"errors"
"fmt"
"net"
"net/http"
"regexp"
"strings"
"code.cloudfoundry.org/lager"
)
var ErrGetP2pUrlFailed = errors.New("failed to get p2p url")

View File

@ -1,4 +1,5 @@
//+build linux
//go:build linux
// +build linux
package api_test

View File

@ -27,7 +27,7 @@ type BaggageclaimCommand struct {
DebugBindPort uint16 `long:"debug-bind-port" default:"7787" description:"Port on which to listen for the pprof debugger endpoints."`
P2pInterfaceNamePattern string `long:"p2p-interface-name-pattern" default:"eth0" description:"Regular expression to match a network interface for p2p streaming"`
P2pInterfaceFamily int `long:"p2p-interface-family" default:"4" choice:"4" choice:"6" description:"4 for IPv4 and 6 for IPv6"`
P2pInterfaceFamily int `long:"p2p-interface-family" default:"4" choice:"4" choice:"6" description:"4 for IPv4 and 6 for IPv6"`
VolumesDir flag.Dir `long:"volumes" required:"true" description:"Directory in which to place volume data."`

View File

@ -1,3 +1,4 @@
//go:build !linux
// +build !linux
package baggageclaimcmd

View File

@ -1,3 +1,4 @@
//go:build !windows
// +build !windows
// Package kernel provides helper function to get, parse and compare kernel

View File

@ -1,3 +1,4 @@
//go:build linux || freebsd || solaris || openbsd
// +build linux freebsd solaris openbsd
// Package kernel provides helper function to get, parse and compare kernel

View File

@ -1,3 +1,4 @@
//go:build !linux && !solaris
// +build !linux,!solaris
package kernel

View File

@ -1,3 +1,4 @@
//go:build !linux
// +build !linux
package uidgid

View File

@ -1,3 +1,4 @@
//go:build !linux
// +build !linux
package uidgid

View File

@ -1,4 +1,5 @@
//+build !windows
//go:build !windows
// +build !windows
package copy

View File

@ -1,3 +1,4 @@
//go:build !linux
// +build !linux
package driver

View File

@ -5,13 +5,14 @@ import (
"context"
"errors"
"fmt"
"github.com/concourse/go-archive/tgzfs"
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
"path/filepath"
"github.com/concourse/go-archive/tgzfs"
"github.com/concourse/concourse/worker/baggageclaim/uidgid/uidgidfakes"
"github.com/concourse/concourse/worker/baggageclaim/volume"
"github.com/concourse/concourse/worker/baggageclaim/volume/volumefakes"

View File

@ -1,3 +1,4 @@
//go:build !linux
// +build !linux
package volume

View File

@ -70,8 +70,6 @@ func (f fileStore) Append(name string, content []byte) error {
return nil
}
func (f fileStore) Delete(path string) error {
absPath := filepath.Join(f.root, path)

View File

@ -6,8 +6,8 @@ import (
"testing"
"github.com/concourse/concourse/worker/runtime"
"github.com/concourse/concourse/worker/runtime/runtimefakes"
"github.com/concourse/concourse/worker/runtime/libcontainerd/libcontainerdfakes"
"github.com/concourse/concourse/worker/runtime/runtimefakes"
"github.com/containerd/containerd"
"github.com/containerd/containerd/runtime/v2/runc/options"
"github.com/containerd/typeurl"

View File

@ -1,3 +1,4 @@
//go:build !windows
// +build !windows
package worker

View File

@ -1,3 +1,4 @@
//go:build linux
// +build linux
package workercmd

View File

@ -1,3 +1,4 @@
//go:build linux
// +build linux
package workercmd

View File

@ -1,3 +1,4 @@
//go:build !linux
// +build !linux
package workercmd