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

fix lint errors in featuregates and package-tools modules #3441

Merged
merged 1 commit into from
Sep 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions featuregates/client/pkg/featuregateclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ func getCurrentClusterConfig() (*rest.Config, error) {
}

// getRestConfigWithContext returns config using the passed context
func getRestConfigWithContext(context, kubeconfigPath string) (*rest.Config, error) {
func getRestConfigWithContext(ctx, kubeconfigPath string) (*rest.Config, error) {
return clientcmd.NewNonInteractiveDeferredLoadingClientConfig(
&clientcmd.ClientConfigLoadingRules{ExplicitPath: kubeconfigPath},
&clientcmd.ConfigOverrides{
CurrentContext: context,
CurrentContext: ctx,
}).ClientConfig()
}
2 changes: 1 addition & 1 deletion featuregates/client/pkg/featuregateclient/doc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2021 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

// Package client provides methods to interact with Feature and FeatureGate resources
// Package featuregateclient provides methods to interact with Feature and FeatureGate resources
package featuregateclient
2 changes: 1 addition & 1 deletion hack/packages/package-tools/cmd/carvelTools.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ type CarvelTools struct {
type Tool struct {
Name string `yaml:"name"`
Version string `yaml:"version"`
Url string `yaml:"url"`
URL string `yaml:"url"`
}
10 changes: 8 additions & 2 deletions hack/packages/package-tools/cmd/prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package cmd

import (
"bytes"
"context"
_ "embed" // required to embed file
"fmt"
"io"
Expand Down Expand Up @@ -77,7 +78,7 @@ func downloadCarvelBinaries() error {
fmt.Printf("Downloading %q binary, version: %q \n", tool.Name, tool.Version)

// resolve the url template and get the url
t, err := template.New("url").Parse(tool.Url)
t, err := template.New("url").Parse(tool.URL)
if err != nil {
return err
}
Expand All @@ -95,7 +96,12 @@ func downloadCarvelBinaries() error {
return err
}

resp, err := http.Get(url.String())
httpClient := &http.Client{}
req, err := http.NewRequestWithContext(context.Background(), http.MethodGet, url.String(), nil)
if err != nil {
return fmt.Errorf("couldn't download %s binary: %w", tool.Name, err)
}
resp, err := httpClient.Do(req)
if err != nil {
return fmt.Errorf("couldn't download %s binary: %w", tool.Name, err)
}
Expand Down
3 changes: 1 addition & 2 deletions hack/packages/package-tools/cmd/vendir-sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ func runPackageVendirSync(cmd *cobra.Command, args []string) error {

var g errgroup.Group

outer:
for _, file := range files {
if !file.IsDir() {
continue
Expand All @@ -66,7 +65,7 @@ outer:
if _, err := os.Stat(filepath.Join(packagePath, "vendir.yml")); err != nil {
if os.IsNotExist(err) {
fmt.Printf("No vendir.yml found in package %q. Skipping vendir sync...\n", file.Name())
continue outer
break
} else {
return err
}
Expand Down
Empty file modified packages/cliplugins/vendir.lock.yml
100755 → 100644
Empty file.
Empty file modified packages/featuregates/vendir.lock.yml
100755 → 100644
Empty file.