Skip to content

Commit

Permalink
revert gofmted files
Browse files Browse the repository at this point in the history
  • Loading branch information
tejal29 committed Aug 16, 2022
1 parent 6b004b7 commit dd2027c
Show file tree
Hide file tree
Showing 56 changed files with 141 additions and 206 deletions.
3 changes: 1 addition & 2 deletions cmd/skaffold/app/exitcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package app

import (
Expand Down
1 change: 0 additions & 1 deletion cmd/skaffold/app/exitcode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package app

import (
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ require (
github.com/golang/glog v1.0.0
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
github.com/golang/protobuf v1.5.2
github.com/google/go-cmp v0.5.7
github.com/google/go-cmp v0.5.8
github.com/google/go-containerregistry v0.8.1-0.20220209165246-a44adc326839
github.com/google/go-github v17.0.0+incompatible
github.com/google/ko v0.11.2
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-containerregistry v0.0.0-20191010200024-a3d713f9b7f8/go.mod h1:KyKXa9ciM8+lgMXwOVsXi7UxGrsf9mM61Mzs+xKUrKE=
github.com/google/go-containerregistry v0.1.2/go.mod h1:GPivBPgdAyd2SU+vf6EpsgOtWDuPqjW0hJZt4rNdTZ4=
github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0=
Expand Down
2 changes: 1 addition & 1 deletion integration/debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func TestDebugEventsRPC_NoStatusCheck(t *testing.T) {
waitForDebugEvent(t, client, rpcAddr)
}

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

Expand Down
5 changes: 1 addition & 4 deletions integration/deploy_cloudrun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package integration

import (
Expand Down Expand Up @@ -44,7 +43,6 @@ func TestDeployCloudRun(t *testing.T) {
}

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

// TODO: remove nolint when test is unskipped
//
//nolint:unused
func checkReady(svc *run.Service) error {
var ready *run.GoogleCloudRunV1Condition
Expand Down
16 changes: 8 additions & 8 deletions integration/deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,14 @@ func TestDeployWithoutWorkspaces(t *testing.T) {
}

// Copies a file or directory tree. There are 2x3 cases:
// 1. If _src_ is a file,
// 1. and _dst_ exists and is a file then _src_ is copied into _dst_
// 2. and _dst_ exists and is a directory, then _src_ is copied as _dst/$(basename src)_
// 3. and _dst_ does not exist, then _src_ is copied as _dst_.
// 2. If _src_ is a directory,
// 1. and _dst_ exists and is a file, then return an error
// 2. and _dst_ exists and is a directory, then src is copied as _dst/$(basename src)_
// 3. and _dst_ does not exist, then src is copied as _dst/src[1:]_.
// 1. If _src_ is a file,
// 1. and _dst_ exists and is a file then _src_ is copied into _dst_
// 2. and _dst_ exists and is a directory, then _src_ is copied as _dst/$(basename src)_
// 3. and _dst_ does not exist, then _src_ is copied as _dst_.
// 2. If _src_ is a directory,
// 1. and _dst_ exists and is a file, then return an error
// 2. and _dst_ exists and is a directory, then src is copied as _dst/$(basename src)_
// 3. and _dst_ does not exist, then src is copied as _dst/src[1:]_.
func copyFiles(dst, src string) error {
if util.IsFile(src) {
switch {
Expand Down
1 change: 0 additions & 1 deletion integration/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const (
// Note: `custom-buildx` is not included as it depends on having a
// `skaffold-builder` builder configured and a registry to push to.
// TODO: remove nolint once we've reenabled integration tests
//
//nolint:golint,unused
var tests = []struct {
description string
Expand Down
3 changes: 1 addition & 2 deletions pkg/diag/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package version

import (
Expand Down
3 changes: 1 addition & 2 deletions pkg/skaffold/build/kaniko/args_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package kaniko

import (
Expand Down
10 changes: 4 additions & 6 deletions pkg/skaffold/build/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,10 @@ func TestInOrderForArgs(t *testing.T) {

// setDependencies constructs a graph of artifact dependencies using the map as an adjacency list representation of indices in the artifacts array.
// For example:
//
// m = {
// 0 : {1, 2},
// 2 : {3},
// }
//
// m = {
// 0 : {1, 2},
// 2 : {3},
// }
// implies that a[0] artifact depends on a[1] and a[2]; and a[2] depends on a[3].
func setDependencies(a []*latest.Artifact, d map[int][]int) {
for k, dep := range d {
Expand Down
42 changes: 21 additions & 21 deletions pkg/skaffold/debug/cnb.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,34 +72,34 @@ func hasCNBLauncherEntrypoint(ic ImageConfiguration) bool {
// execution environment as configured by the various buildpacks, and then hands off to the
// configured launch. The CNB launcher supports three types of launches:
//
// 1. _predefined processes_ are named sets of command+arguments (similar to a container image's
// ENTRYPOINT/CMD). Processes are created by the buildpacks, and oftentimes there is a
// buildpack that parses a user's `Procfile` and turns those contents into processes.
// There are two types of process definitions:
// - *direct*: these are passed uninterpreted to os.exec; the command is resolved in PATH
// Note that in practice we see direct-style definitions that execute `/bin/sh -c ...`
// - *script*: the command is treated as a shell script and passed to `sh -c`, and any remaining
// arguments on the container command-line are added to the shell and so become available
// as positional arguments (see https://github.com/buildpacks/lifecycle/issues/218#issuecomment-567091462).
// For example: `sh -c 'echo $0 $1 $2 $3' arg0 arg1 arg2 arg3` => `arg0 arg1 arg2 arg3`.
// 2. _direct execs_: the user can provide a command-line which is treated like a _direct process_.
// 3. _shell scripts_: the user can provide a shell script as the first argument and any
// remaining arguments are available as positional arguments like _script processes_.
// 1. _predefined processes_ are named sets of command+arguments (similar to a container image's
// ENTRYPOINT/CMD). Processes are created by the buildpacks, and oftentimes there is a
// buildpack that parses a user's `Procfile` and turns those contents into processes.
// There are two types of process definitions:
// - *direct*: these are passed uninterpreted to os.exec; the command is resolved in PATH
// Note that in practice we see direct-style definitions that execute `/bin/sh -c ...`
// - *script*: the command is treated as a shell script and passed to `sh -c`, and any remaining
// arguments on the container command-line are added to the shell and so become available
// as positional arguments (see https://github.com/buildpacks/lifecycle/issues/218#issuecomment-567091462).
// For example: `sh -c 'echo $0 $1 $2 $3' arg0 arg1 arg2 arg3` => `arg0 arg1 arg2 arg3`.
// 2. _direct execs_: the user can provide a command-line which is treated like a _direct process_.
// 3. _shell scripts_: the user can provide a shell script as the first argument and any
// remaining arguments are available as positional arguments like _script processes_.
//
// Script-style launches support referencing environment variables since they are expanded by the shell.
//
// Configuring the launch depends on the CNB Platform API version being used, which is determined by
// the builder's lifecycle version, which is itself determined by the pack used to create a builder.
// - In Platform API 0.3 (pack 0.12 and earlier / lifecycle 0.8 and earlier) the image entrypoint
// is set to `/cnb/lifecycle/launcher`. The launch is determined by:
// 1. If there are arguments:
// 1. If there is a single argument and it matches a process type, then the corresponding
// process is launched.
// 2. If the first argument is `--` then the remaining arguments are treated as a _direct exec_.
// 3. Otherwise the first argument is treated as a shell script launch with the first
// argument as the script and remaining arguments are positional arguments to the script.
// 2. If there are no arguments, a process type is taken from the `CNB_PROCESS_TYPE`
// environment variable, defaulting to `web`.
// 1. If there are arguments:
// 1. If there is a single argument and it matches a process type, then the corresponding
// process is launched.
// 2. If the first argument is `--` then the remaining arguments are treated as a _direct exec_.
// 3. Otherwise the first argument is treated as a shell script launch with the first
// argument as the script and remaining arguments are positional arguments to the script.
// 2. If there are no arguments, a process type is taken from the `CNB_PROCESS_TYPE`
// environment variable, defaulting to `web`.
// - In Platform API 0.4 (pack 0.13 / lifecycle 0.9) the process types are turned into executables
// found in `/cnb/process/`, and the image entrypoint is set to the corresponding executable for
// the default process type. `CNB_PROCESS_TYPE` is ignored in this situation. A different process
Expand Down
8 changes: 4 additions & 4 deletions pkg/skaffold/debug/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ be debuggable, we record this metadata using as a JSON object keyed by the conta
Kubernetes requires that containers within a podspec are uniquely named.
For example, a pod with two containers named `microservice` and `adapter` may be:
debug.cloud.google.com/config: '{
"microservice":{"artifact":"node-example","runtime":"nodejs","ports":{"devtools":9229}},
"adapter":{"artifact":"java-example","runtime":"jvm","ports":{"jdwp":5005}}
}'
debug.cloud.google.com/config: '{
"microservice":{"artifact":"node-example","runtime":"nodejs","ports":{"devtools":9229}},
"adapter":{"artifact":"java-example","runtime":"jvm","ports":{"jdwp":5005}}
}'
Each configuration is itself a JSON object of type `types.ContainerDebugConfiguration`, with an
`artifact` recording the corresponding artifact's `image` in the skaffold.yaml,
Expand Down
3 changes: 1 addition & 2 deletions pkg/skaffold/deploy/cloudrun/accessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package cloudrun

import (
Expand Down
3 changes: 1 addition & 2 deletions pkg/skaffold/deploy/cloudrun/accessor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package cloudrun

import (
Expand Down
3 changes: 1 addition & 2 deletions pkg/skaffold/deploy/cloudrun/cloudrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package cloudrun

import "fmt"
Expand Down
3 changes: 1 addition & 2 deletions pkg/skaffold/deploy/cloudrun/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package cloudrun

import (
Expand Down
3 changes: 1 addition & 2 deletions pkg/skaffold/deploy/cloudrun/deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package cloudrun

import (
Expand Down
2 changes: 1 addition & 1 deletion pkg/skaffold/deploy/cloudrun/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
3 changes: 1 addition & 2 deletions pkg/skaffold/deploy/cloudrun/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package cloudrun

import (
Expand Down
10 changes: 5 additions & 5 deletions pkg/skaffold/deploy/docker/port/port.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ func (pm *PortManager) Stop() {
}

/*
allocatePorts converts PortForwardResources into docker.PortSet objects, and combines them with
pre-configured debug bindings into one docker.PortMap. The debug bindings will have their
requested host ports validated against the port tracker, and modified if a port collision is found.
allocatePorts converts PortForwardResources into docker.PortSet objects, and combines them with
pre-configured debug bindings into one docker.PortMap. The debug bindings will have their
requested host ports validated against the port tracker, and modified if a port collision is found.
These ports are added to the provided container configuration's port set, and the bindings
are returned to be passed to ContainerCreate on Deploy to expose container ports on the host.
These ports are added to the provided container configuration's port set, and the bindings
are returned to be passed to ContainerCreate on Deploy to expose container ports on the host.
*/
func (pm *PortManager) AllocatePorts(containerName string, pf []*latest.PortForwardResource, cfg *container.Config, debugBindings nat.PortMap) (nat.PortMap, error) {
pm.lock.Lock()
Expand Down
3 changes: 1 addition & 2 deletions pkg/skaffold/filemon/changes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package filemon

import (
Expand Down
2 changes: 1 addition & 1 deletion pkg/skaffold/helm/bin.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func PrepareSkaffoldFilter(h Client, builds []graph.Artifact) (skaffoldBinary st
return
}

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

0 comments on commit dd2027c

Please sign in to comment.