Skip to content

Commit 1517520

Browse files
committed
revert gofmted files
1 parent 6a85c20 commit 1517520

File tree

58 files changed

+150
-214
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+150
-214
lines changed

cmd/skaffold/app/exitcode.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,
1212
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
1716
package app
1817

1918
import (

cmd/skaffold/app/exitcode_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
Copyright 2021 The Skaffold Authors
2+
Copyright YEAR The Skaffold Authors
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ require (
4646
github.com/golang/glog v1.0.0
4747
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
4848
github.com/golang/protobuf v1.5.2
49-
github.com/google/go-cmp v0.5.7
49+
github.com/google/go-cmp v0.5.8
5050
github.com/google/go-containerregistry v0.8.1-0.20220209165246-a44adc326839
5151
github.com/google/go-github v17.0.0+incompatible
5252
github.com/google/ko v0.11.2

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
11661166
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
11671167
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
11681168
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
1169+
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
1170+
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
11691171
github.com/google/go-containerregistry v0.0.0-20191010200024-a3d713f9b7f8/go.mod h1:KyKXa9ciM8+lgMXwOVsXi7UxGrsf9mM61Mzs+xKUrKE=
11701172
github.com/google/go-containerregistry v0.1.2/go.mod h1:GPivBPgdAyd2SU+vf6EpsgOtWDuPqjW0hJZt4rNdTZ4=
11711173
github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0=

integration/debug_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ func TestDebugEventsRPC_NoStatusCheck(t *testing.T) {
245245
waitForDebugEvent(t, client, rpcAddr)
246246
}
247247

248-
// nolint add lint back after https://github.com/GoogleContainerTools/skaffold/issues/7405
248+
//nolint add lint back after https://github.com/GoogleContainerTools/skaffold/issues/7405
249249
func waitForDebugEvent(t *testing.T, client *NSKubernetesClient, rpcAddr string) {
250250
client.WaitForPodsReady()
251251

integration/deploy_cloudrun_test.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,
1212
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
1716
package integration
1817

1918
import (
@@ -44,7 +43,6 @@ func TestDeployCloudRun(t *testing.T) {
4443
}
4544

4645
// TODO: remove nolint when test is unskipped
47-
//
4846
//nolint:unused
4947
func getRunService(ctx context.Context, project, region, service string) (*run.Service, error) {
5048
crclient, err := run.NewService(ctx, gcp.ClientOptions(ctx)...)
@@ -57,7 +55,6 @@ func getRunService(ctx context.Context, project, region, service string) (*run.S
5755
}
5856

5957
// TODO: remove nolint when test is unskipped
60-
//
6158
//nolint:unused
6259
func checkReady(svc *run.Service) error {
6360
var ready *run.GoogleCloudRunV1Condition

integration/deploy_test.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,14 @@ func TestDeployWithoutWorkspaces(t *testing.T) {
191191
}
192192

193193
// Copies a file or directory tree. There are 2x3 cases:
194-
// 1. If _src_ is a file,
195-
// 1. and _dst_ exists and is a file then _src_ is copied into _dst_
196-
// 2. and _dst_ exists and is a directory, then _src_ is copied as _dst/$(basename src)_
197-
// 3. and _dst_ does not exist, then _src_ is copied as _dst_.
198-
// 2. If _src_ is a directory,
199-
// 1. and _dst_ exists and is a file, then return an error
200-
// 2. and _dst_ exists and is a directory, then src is copied as _dst/$(basename src)_
201-
// 3. and _dst_ does not exist, then src is copied as _dst/src[1:]_.
194+
// 1. If _src_ is a file,
195+
// 1. and _dst_ exists and is a file then _src_ is copied into _dst_
196+
// 2. and _dst_ exists and is a directory, then _src_ is copied as _dst/$(basename src)_
197+
// 3. and _dst_ does not exist, then _src_ is copied as _dst_.
198+
// 2. If _src_ is a directory,
199+
// 1. and _dst_ exists and is a file, then return an error
200+
// 2. and _dst_ exists and is a directory, then src is copied as _dst/$(basename src)_
201+
// 3. and _dst_ does not exist, then src is copied as _dst/src[1:]_.
202202
func copyFiles(dst, src string) error {
203203
if util.IsFile(src) {
204204
switch {

integration/run_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ const (
3636
// Note: `custom-buildx` is not included as it depends on having a
3737
// `skaffold-builder` builder configured and a registry to push to.
3838
// TODO: remove nolint once we've reenabled integration tests
39-
//
4039
//nolint:golint,unused
4140
var tests = []struct {
4241
description string

pkg/diag/version/version.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,
1212
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
1716
package version
1817

1918
import (

pkg/skaffold/build/kaniko/args_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,
1212
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
1716
package kaniko
1817

1918
import (

pkg/skaffold/build/scheduler_test.go

+4-6
Original file line numberDiff line numberDiff line change
@@ -384,12 +384,10 @@ func TestInOrderForArgs(t *testing.T) {
384384

385385
// setDependencies constructs a graph of artifact dependencies using the map as an adjacency list representation of indices in the artifacts array.
386386
// For example:
387-
//
388-
// m = {
389-
// 0 : {1, 2},
390-
// 2 : {3},
391-
// }
392-
//
387+
// m = {
388+
// 0 : {1, 2},
389+
// 2 : {3},
390+
// }
393391
// implies that a[0] artifact depends on a[1] and a[2]; and a[2] depends on a[3].
394392
func setDependencies(a []*latest.Artifact, d map[int][]int) {
395393
for k, dep := range d {

pkg/skaffold/debug/cnb.go

+21-21
Original file line numberDiff line numberDiff line change
@@ -72,34 +72,34 @@ func hasCNBLauncherEntrypoint(ic ImageConfiguration) bool {
7272
// execution environment as configured by the various buildpacks, and then hands off to the
7373
// configured launch. The CNB launcher supports three types of launches:
7474
//
75-
// 1. _predefined processes_ are named sets of command+arguments (similar to a container image's
76-
// ENTRYPOINT/CMD). Processes are created by the buildpacks, and oftentimes there is a
77-
// buildpack that parses a user's `Procfile` and turns those contents into processes.
78-
// There are two types of process definitions:
79-
// - *direct*: these are passed uninterpreted to os.exec; the command is resolved in PATH
80-
// Note that in practice we see direct-style definitions that execute `/bin/sh -c ...`
81-
// - *script*: the command is treated as a shell script and passed to `sh -c`, and any remaining
82-
// arguments on the container command-line are added to the shell and so become available
83-
// as positional arguments (see https://github.com/buildpacks/lifecycle/issues/218#issuecomment-567091462).
84-
// For example: `sh -c 'echo $0 $1 $2 $3' arg0 arg1 arg2 arg3` => `arg0 arg1 arg2 arg3`.
85-
// 2. _direct execs_: the user can provide a command-line which is treated like a _direct process_.
86-
// 3. _shell scripts_: the user can provide a shell script as the first argument and any
87-
// remaining arguments are available as positional arguments like _script processes_.
75+
// 1. _predefined processes_ are named sets of command+arguments (similar to a container image's
76+
// ENTRYPOINT/CMD). Processes are created by the buildpacks, and oftentimes there is a
77+
// buildpack that parses a user's `Procfile` and turns those contents into processes.
78+
// There are two types of process definitions:
79+
// - *direct*: these are passed uninterpreted to os.exec; the command is resolved in PATH
80+
// Note that in practice we see direct-style definitions that execute `/bin/sh -c ...`
81+
// - *script*: the command is treated as a shell script and passed to `sh -c`, and any remaining
82+
// arguments on the container command-line are added to the shell and so become available
83+
// as positional arguments (see https://github.com/buildpacks/lifecycle/issues/218#issuecomment-567091462).
84+
// For example: `sh -c 'echo $0 $1 $2 $3' arg0 arg1 arg2 arg3` => `arg0 arg1 arg2 arg3`.
85+
// 2. _direct execs_: the user can provide a command-line which is treated like a _direct process_.
86+
// 3. _shell scripts_: the user can provide a shell script as the first argument and any
87+
// remaining arguments are available as positional arguments like _script processes_.
8888
//
8989
// Script-style launches support referencing environment variables since they are expanded by the shell.
9090
//
9191
// Configuring the launch depends on the CNB Platform API version being used, which is determined by
9292
// the builder's lifecycle version, which is itself determined by the pack used to create a builder.
9393
// - In Platform API 0.3 (pack 0.12 and earlier / lifecycle 0.8 and earlier) the image entrypoint
9494
// is set to `/cnb/lifecycle/launcher`. The launch is determined by:
95-
// 1. If there are arguments:
96-
// 1. If there is a single argument and it matches a process type, then the corresponding
97-
// process is launched.
98-
// 2. If the first argument is `--` then the remaining arguments are treated as a _direct exec_.
99-
// 3. Otherwise the first argument is treated as a shell script launch with the first
100-
// argument as the script and remaining arguments are positional arguments to the script.
101-
// 2. If there are no arguments, a process type is taken from the `CNB_PROCESS_TYPE`
102-
// environment variable, defaulting to `web`.
95+
// 1. If there are arguments:
96+
// 1. If there is a single argument and it matches a process type, then the corresponding
97+
// process is launched.
98+
// 2. If the first argument is `--` then the remaining arguments are treated as a _direct exec_.
99+
// 3. Otherwise the first argument is treated as a shell script launch with the first
100+
// argument as the script and remaining arguments are positional arguments to the script.
101+
// 2. If there are no arguments, a process type is taken from the `CNB_PROCESS_TYPE`
102+
// environment variable, defaulting to `web`.
103103
// - In Platform API 0.4 (pack 0.13 / lifecycle 0.9) the process types are turned into executables
104104
// found in `/cnb/process/`, and the image entrypoint is set to the corresponding executable for
105105
// the default process type. `CNB_PROCESS_TYPE` is ignored in this situation. A different process

pkg/skaffold/debug/transform.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ be debuggable, we record this metadata using as a JSON object keyed by the conta
3939
Kubernetes requires that containers within a podspec are uniquely named.
4040
For example, a pod with two containers named `microservice` and `adapter` may be:
4141
42-
debug.cloud.google.com/config: '{
43-
"microservice":{"artifact":"node-example","runtime":"nodejs","ports":{"devtools":9229}},
44-
"adapter":{"artifact":"java-example","runtime":"jvm","ports":{"jdwp":5005}}
45-
}'
42+
debug.cloud.google.com/config: '{
43+
"microservice":{"artifact":"node-example","runtime":"nodejs","ports":{"devtools":9229}},
44+
"adapter":{"artifact":"java-example","runtime":"jvm","ports":{"jdwp":5005}}
45+
}'
4646
4747
Each configuration is itself a JSON object of type `types.ContainerDebugConfiguration`, with an
4848
`artifact` recording the corresponding artifact's `image` in the skaffold.yaml,

pkg/skaffold/deploy/cloudrun/accessor.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,
1212
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
1716
package cloudrun
1817

1918
import (

pkg/skaffold/deploy/cloudrun/accessor_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,
1212
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
1716
package cloudrun
1817

1918
import (

pkg/skaffold/deploy/cloudrun/cloudrun.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,
1212
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
1716
package cloudrun
1817

1918
import "fmt"

pkg/skaffold/deploy/cloudrun/deploy.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,
1212
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
1716
package cloudrun
1817

1918
import (

pkg/skaffold/deploy/cloudrun/deploy_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,
1212
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
1716
package cloudrun
1817

1918
import (

pkg/skaffold/deploy/cloudrun/status.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,

pkg/skaffold/deploy/cloudrun/status_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,
1212
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
1716
package cloudrun
1817

1918
import (

pkg/skaffold/deploy/docker/port/port.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ func (pm *PortManager) Stop() {
7474
}
7575

7676
/*
77-
allocatePorts converts PortForwardResources into docker.PortSet objects, and combines them with
78-
pre-configured debug bindings into one docker.PortMap. The debug bindings will have their
79-
requested host ports validated against the port tracker, and modified if a port collision is found.
77+
allocatePorts converts PortForwardResources into docker.PortSet objects, and combines them with
78+
pre-configured debug bindings into one docker.PortMap. The debug bindings will have their
79+
requested host ports validated against the port tracker, and modified if a port collision is found.
8080
81-
These ports are added to the provided container configuration's port set, and the bindings
82-
are returned to be passed to ContainerCreate on Deploy to expose container ports on the host.
81+
These ports are added to the provided container configuration's port set, and the bindings
82+
are returned to be passed to ContainerCreate on Deploy to expose container ports on the host.
8383
*/
8484
func (pm *PortManager) AllocatePorts(containerName string, pf []*latest.PortForwardResource, cfg *container.Config, debugBindings nat.PortMap) (nat.PortMap, error) {
8585
pm.lock.Lock()

pkg/skaffold/filemon/changes_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,
1212
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
1716
package filemon
1817

1918
import (

pkg/skaffold/helm/bin.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func PrepareSkaffoldFilter(h Client, builds []graph.Artifact) (skaffoldBinary st
8585
return
8686
}
8787

88-
// generateSkaffoldFilter creates a `skaffold filter command-line for applying the various
88+
// generateSkaffoldFilter creates a `skaffold filter`` command-line for applying the various
8989
// Skaffold manifest filters, such a debugging, image replacement, and applying labels.
9090
func generateSkaffoldFilter(h Client, buildsFile string) []string {
9191
args := []string{"filter", "--kube-context", h.KubeContext()}

0 commit comments

Comments
 (0)