Skip to content
This repository was archived by the owner on Oct 10, 2023. It is now read-only.

Commit 432ae78

Browse files
committed
fix lint errors in featuregates and package-tools modules
1 parent df3e07a commit 432ae78

File tree

7 files changed

+13
-8
lines changed

7 files changed

+13
-8
lines changed

featuregates/client/pkg/featuregateclient/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,10 @@ func getCurrentClusterConfig() (*rest.Config, error) {
189189
}
190190

191191
// getRestConfigWithContext returns config using the passed context
192-
func getRestConfigWithContext(context, kubeconfigPath string) (*rest.Config, error) {
192+
func getRestConfigWithContext(ctx, kubeconfigPath string) (*rest.Config, error) {
193193
return clientcmd.NewNonInteractiveDeferredLoadingClientConfig(
194194
&clientcmd.ClientConfigLoadingRules{ExplicitPath: kubeconfigPath},
195195
&clientcmd.ConfigOverrides{
196-
CurrentContext: context,
196+
CurrentContext: ctx,
197197
}).ClientConfig()
198198
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2021 VMware, Inc. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
// Package client provides methods to interact with Feature and FeatureGate resources
4+
// Package featuregateclient provides methods to interact with Feature and FeatureGate resources
55
package featuregateclient

hack/packages/package-tools/cmd/carvelTools.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ type CarvelTools struct {
1212
type Tool struct {
1313
Name string `yaml:"name"`
1414
Version string `yaml:"version"`
15-
Url string `yaml:"url"`
15+
URL string `yaml:"url"`
1616
}

hack/packages/package-tools/cmd/prepare.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package cmd
55

66
import (
77
"bytes"
8+
"context"
89
_ "embed" // required to embed file
910
"fmt"
1011
"io"
@@ -77,7 +78,7 @@ func downloadCarvelBinaries() error {
7778
fmt.Printf("Downloading %q binary, version: %q \n", tool.Name, tool.Version)
7879

7980
// resolve the url template and get the url
80-
t, err := template.New("url").Parse(tool.Url)
81+
t, err := template.New("url").Parse(tool.URL)
8182
if err != nil {
8283
return err
8384
}
@@ -95,7 +96,12 @@ func downloadCarvelBinaries() error {
9596
return err
9697
}
9798

98-
resp, err := http.Get(url.String())
99+
httpClient := &http.Client{}
100+
req, err := http.NewRequestWithContext(context.Background(), http.MethodGet, url.String(), nil)
101+
if err != nil {
102+
return fmt.Errorf("couldn't download %s binary: %w", tool.Name, err)
103+
}
104+
resp, err := httpClient.Do(req)
99105
if err != nil {
100106
return fmt.Errorf("couldn't download %s binary: %w", tool.Name, err)
101107
}

hack/packages/package-tools/cmd/vendir-sync.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ func runPackageVendirSync(cmd *cobra.Command, args []string) error {
5353

5454
var g errgroup.Group
5555

56-
outer:
5756
for _, file := range files {
5857
if !file.IsDir() {
5958
continue
@@ -66,7 +65,7 @@ outer:
6665
if _, err := os.Stat(filepath.Join(packagePath, "vendir.yml")); err != nil {
6766
if os.IsNotExist(err) {
6867
fmt.Printf("No vendir.yml found in package %q. Skipping vendir sync...\n", file.Name())
69-
continue outer
68+
break
7069
} else {
7170
return err
7271
}

packages/cliplugins/vendir.lock.yml

100755100644
File mode changed.

packages/featuregates/vendir.lock.yml

100755100644
File mode changed.

0 commit comments

Comments
 (0)