Merge pull request #14756 from minikube-bot/auto_bump_golint_version

bump golint version
pull/14757/head
Steven Powell 2022-08-08 10:02:28 -07:00 committed by GitHub
commit e9fe458c59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 61 additions and 46 deletions

View File

@ -76,7 +76,7 @@ MINIKUBE_RELEASES_URL=https://github.com/kubernetes/minikube/releases/download
KERNEL_VERSION ?= 5.10.57 KERNEL_VERSION ?= 5.10.57
# latest from https://github.com/golangci/golangci-lint/releases # latest from https://github.com/golangci/golangci-lint/releases
# update this only by running `make update-golint-version` # update this only by running `make update-golint-version`
GOLINT_VERSION ?= v1.47.2 GOLINT_VERSION ?= v1.48.0
# Limit number of default jobs, to avoid the CI builds running out of memory # Limit number of default jobs, to avoid the CI builds running out of memory
GOLINT_JOBS ?= 4 GOLINT_JOBS ?= 4
# see https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint # see https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint

View File

@ -37,9 +37,9 @@ func main() {
} }
// analyzePerformance is responsible for: // analyzePerformance is responsible for:
// 1. collecting PRs to run performance analysis on // 1. collecting PRs to run performance analysis on
// 2. running mkcmp against those PRs // 2. running mkcmp against those PRs
// 3. commenting results on those PRs // 3. commenting results on those PRs
func analyzePerformance(ctx context.Context) error { func analyzePerformance(ctx context.Context) error {
client := monitor.NewClient(ctx, monitor.GithubOwner, monitor.GithubRepo) client := monitor.NewClient(ctx, monitor.GithubOwner, monitor.GithubRepo)
prs, err := client.ListOpenPRsWithLabel(monitor.OkToTestLabel) prs, err := client.ListOpenPRsWithLabel(monitor.OkToTestLabel)

View File

@ -46,7 +46,8 @@ func getSHAFromURL(url string) (string, error) {
} }
// TestReleasesJSON checks if all *GA* releases // TestReleasesJSON checks if all *GA* releases
// enlisted in https://storage.googleapis.com/minikube/releases.json //
// enlisted in https://storage.googleapis.com/minikube/releases.json
// are available to download and have correct hashsum // are available to download and have correct hashsum
func TestReleasesJSON(t *testing.T) { func TestReleasesJSON(t *testing.T) {
releases, err := notify.AllVersionsFromURL(notify.GithubMinikubeReleasesURL) releases, err := notify.AllVersionsFromURL(notify.GithubMinikubeReleasesURL)
@ -57,7 +58,8 @@ func TestReleasesJSON(t *testing.T) {
} }
// TestBetaReleasesJSON checks if all *BETA* releases // TestBetaReleasesJSON checks if all *BETA* releases
// enlisted in https://storage.googleapis.com/minikube/releases-beta.json //
// enlisted in https://storage.googleapis.com/minikube/releases-beta.json
// are available to download and have correct hashsum // are available to download and have correct hashsum
func TestBetaReleasesJSON(t *testing.T) { func TestBetaReleasesJSON(t *testing.T) {
releases, err := notify.AllVersionsFromURL(notify.GithubMinikubeBetaReleasesURL) releases, err := notify.AllVersionsFromURL(notify.GithubMinikubeBetaReleasesURL)

View File

@ -58,13 +58,14 @@ func main() {
} }
// One entry of a test run. // One entry of a test run.
// Example: TestEntry { //
// name: "TestFunctional/parallel/LogsCmd", // Example: TestEntry {
// environment: "Docker_Linux", // name: "TestFunctional/parallel/LogsCmd",
// date: time.Now, // environment: "Docker_Linux",
// status: "Passed", // date: time.Now,
// duration: 0.1, // status: "Passed",
// } // duration: 0.1,
// }
type testEntry struct { type testEntry struct {
name string name string
environment string environment string

View File

@ -62,7 +62,6 @@ func main() {
update.Apply(schema, data) update.Apply(schema, data)
} }
//
// golintVersions returns stable version in semver format. // golintVersions returns stable version in semver format.
func golintVersion(ctx context.Context, owner, repo string) (stable string, err error) { func golintVersion(ctx context.Context, owner, repo string) (stable string, err error) {
// get Kubernetes versions from GitHub Releases // get Kubernetes versions from GitHub Releases

View File

@ -84,11 +84,13 @@ https://github.com/kubernetes/kubernetes/blob/063e7ff358fdc8b0916e6f39beedc0d025
// names on disk as opposed to the int32 values, and the serlialzed field names // names on disk as opposed to the int32 values, and the serlialzed field names
// have been made closer to core/v1 VolumeMount field names // have been made closer to core/v1 VolumeMount field names
// In yaml this looks like: // In yaml this looks like:
// containerPath: /foo //
// hostPath: /bar // containerPath: /foo
// readOnly: true // hostPath: /bar
// selinuxRelabel: false // readOnly: true
// propagation: None // selinuxRelabel: false
// propagation: None
//
// Propagation may be one of: None, HostToContainer, Bidirectional // Propagation may be one of: None, HostToContainer, Bidirectional
type Mount struct { type Mount struct {
// Path of the mount within the container. // Path of the mount within the container.
@ -158,9 +160,10 @@ func ParseMountString(spec string) (m Mount, err error) {
// PortMapping specifies a host port mapped into a container port. // PortMapping specifies a host port mapped into a container port.
// In yaml this looks like: // In yaml this looks like:
// containerPort: 80 //
// hostPort: 8000 // containerPort: 80
// listenAddress: 127.0.0.1 // hostPort: 8000
// listenAddress: 127.0.0.1
type PortMapping struct { type PortMapping struct {
// Port within the container. // Port within the container.
ContainerPort int32 `protobuf:"varint,1,opt,name=container_port,json=containerPort,proto3" json:"containerPort,omitempty"` ContainerPort int32 `protobuf:"varint,1,opt,name=container_port,json=containerPort,proto3" json:"containerPort,omitempty"`

View File

@ -43,10 +43,10 @@ const (
) )
// Enable follows these steps for enabling gvisor in minikube: // Enable follows these steps for enabling gvisor in minikube:
// 1. creates necessary directories for storing binaries and runsc logs // 1. creates necessary directories for storing binaries and runsc logs
// 2. downloads runsc and gvisor-containerd-shim // 2. downloads runsc and gvisor-containerd-shim
// 3. copies necessary containerd config files // 3. copies necessary containerd config files
// 4. restarts containerd // 4. restarts containerd
func Enable() error { func Enable() error {
if err := makeGvisorDirs(); err != nil { if err := makeGvisorDirs(); err != nil {
return errors.Wrap(err, "creating directories on node") return errors.Wrap(err, "creating directories on node")
@ -149,8 +149,9 @@ func downloadFileToDest(url, dest string) error {
} }
// Must write the following files: // Must write the following files:
// 1. gvisor-containerd-shim.toml // 1. gvisor-containerd-shim.toml
// 2. gvisor containerd config.toml // 2. gvisor containerd config.toml
//
// and save the default version of config.toml // and save the default version of config.toml
func copyConfigFiles() error { func copyConfigFiles() error {
log.Printf("Storing default config.toml at %s", storedContainerdConfigTomlPath) log.Printf("Storing default config.toml at %s", storedContainerdConfigTomlPath)

View File

@ -122,7 +122,8 @@ func recentReleases(n int) ([]string, error) {
return versions, nil return versions, nil
} }
/** /*
*
This test case has only 1 thing to test and that is the This test case has only 1 thing to test and that is the
networking/dnsDomain value networking/dnsDomain value
*/ */

View File

@ -41,7 +41,7 @@ const (
ExtraKey = "extra" ExtraKey = "extra"
) )
// vars related to the --wait flag // vars related to the --wait flag
var ( var (
// DefaultComponents is map of the the default components to wait for // DefaultComponents is map of the the default components to wait for
DefaultComponents = map[string]bool{APIServerWaitKey: true, SystemPodsWaitKey: true} DefaultComponents = map[string]bool{APIServerWaitKey: true, SystemPodsWaitKey: true}

View File

@ -29,6 +29,7 @@ import (
) )
// https://docs.projectcalico.org/manifests/calico.yaml // https://docs.projectcalico.org/manifests/calico.yaml
//
//go:embed calico.yaml //go:embed calico.yaml
var calicoYaml string var calicoYaml string

View File

@ -302,10 +302,11 @@ func cleanImageCacheDir() error {
// normalizeTagName automatically tag latest to image // normalizeTagName automatically tag latest to image
// Example: // Example:
// nginx -> nginx:latest //
// localhost:5000/nginx -> localhost:5000/nginx:latest // nginx -> nginx:latest
// localhost:5000/nginx:latest -> localhost:5000/nginx:latest // localhost:5000/nginx -> localhost:5000/nginx:latest
// docker.io/dotnet/core/sdk -> docker.io/dotnet/core/sdk:latest // localhost:5000/nginx:latest -> localhost:5000/nginx:latest
// docker.io/dotnet/core/sdk -> docker.io/dotnet/core/sdk:latest
func normalizeTagName(image string) string { func normalizeTagName(image string) string {
base := image base := image
tag := "latest" tag := "latest"

View File

@ -142,7 +142,7 @@ var (
cachedSystemMemoryErr *error cachedSystemMemoryErr *error
) )
// cachedSysMemLimit will return a cached limit for the system's virtual memory. // cachedSysMemLimit will return a cached limit for the system's virtual memory.
func cachedSysMemLimit() (*mem.VirtualMemoryStat, error) { func cachedSysMemLimit() (*mem.VirtualMemoryStat, error) {
if cachedSystemMemoryLimit == nil { if cachedSystemMemoryLimit == nil {
v, err := mem.VirtualMemory() v, err := mem.VirtualMemory()
@ -178,7 +178,7 @@ var (
cachedCPUErr *error cachedCPUErr *error
) )
// cachedCPUInfo will return a cached cpu info // cachedCPUInfo will return a cached cpu info
func cachedCPUInfo() ([]cpu.InfoStat, error) { func cachedCPUInfo() ([]cpu.InfoStat, error) {
if cachedCPU == nil { if cachedCPU == nil {
// one InfoStat per thread // one InfoStat per thread

View File

@ -139,7 +139,7 @@ Persistent Routes:
expectedRt := routingTable{ expectedRt := routingTable{
routingTableLine{ routingTableLine{
route: unsafeParseRoute("127.0.0.1", "10.96.0.0/12"), route: unsafeParseRoute("127.0.0.1", "10.96.0.0/12"),
line: " 10.96.0.0 255.240.0.0 127.0.0.1 127.0.0.1 281", line: " 10.96.0.0 255.240.0.0 127.0.0.1 127.0.0.1 281",
}, },
routingTableLine{ routingTableLine{
route: unsafeParseRoute("192.168.1.2", "10.211.55.0/24"), route: unsafeParseRoute("192.168.1.2", "10.211.55.0/24"),

View File

@ -80,8 +80,9 @@ type Interface struct {
// lookupInInterfaces iterates over all local network interfaces // lookupInInterfaces iterates over all local network interfaces
// and tries to match "ip" with associated networks // and tries to match "ip" with associated networks
// returns (network parameters, ip network, nil) if found // returns (network parameters, ip network, nil) if found
// (nil, nil, nil) it nof //
// (nil, nil, error) if any error happened // (nil, nil, nil) it nof
// (nil, nil, error) if any error happened
func lookupInInterfaces(ip net.IP) (*Parameters, *net.IPNet, error) { func lookupInInterfaces(ip net.IP) (*Parameters, *net.IPNet, error) {
// check local network interfaces // check local network interfaces
ifaces, err := net.Interfaces() ifaces, err := net.Interfaces()
@ -255,8 +256,9 @@ func FreeSubnet(startSubnet string, step, tries int) (*Parameters, error) {
} }
// reserveSubnet returns if subnet was successfully reserved for given period: // reserveSubnet returns if subnet was successfully reserved for given period:
// - false, if it already has unexpired reservation // - false, if it already has unexpired reservation
// - true, if new reservation was created or expired one renewed // - true, if new reservation was created or expired one renewed
//
// uses sync.Map to manage reservations thread-safe // uses sync.Map to manage reservations thread-safe
func reserveSubnet(subnet string, period time.Duration) bool { func reserveSubnet(subnet string, period time.Duration) bool {
// put 'zero' reservation{} Map value for subnet Map key // put 'zero' reservation{} Map value for subnet Map key

View File

@ -102,7 +102,7 @@ func TestJSONOutput(t *testing.T) {
} }
} }
// validateDistinctCurrentSteps makes sure each step has a distinct step number // validateDistinctCurrentSteps makes sure each step has a distinct step number
func validateDistinctCurrentSteps(ctx context.Context, t *testing.T, ces []*cloudEvent) { func validateDistinctCurrentSteps(ctx context.Context, t *testing.T, ces []*cloudEvent) {
steps := map[string]string{} steps := map[string]string{}
for _, ce := range ces { for _, ce := range ces {

View File

@ -445,11 +445,14 @@ func testPause(ctx context.Context, t *testing.T, profile string) {
// Remove container-specific prefixes for naming consistency // Remove container-specific prefixes for naming consistency
// for example in `docker` runtime we get this: // for example in `docker` runtime we get this:
// $ docker@minikube:~$ sudo crictl images -o json | grep dash //
// "kubernetesui/dashboard:vX.X.X" // $ docker@minikube:~$ sudo crictl images -o json | grep dash
// "kubernetesui/dashboard:vX.X.X"
//
// but for 'containerd' we get full name // but for 'containerd' we get full name
// $ docker@minikube:~$ sudo crictl images -o json | grep dash //
// "docker.io/kubernetesui/dashboard:vX.X.X" // $ docker@minikube:~$ sudo crictl images -o json | grep dash
// "docker.io/kubernetesui/dashboard:vX.X.X"
func trimImageName(name string) string { func trimImageName(name string) string {
name = strings.TrimPrefix(name, "docker.io/") name = strings.TrimPrefix(name, "docker.io/")
name = strings.TrimPrefix(name, "localhost/") name = strings.TrimPrefix(name, "localhost/")

View File

@ -19,5 +19,6 @@ package translations
import "embed" import "embed"
// Translations contains all translation JSON files. // Translations contains all translation JSON files.
//
//go:embed *.json //go:embed *.json
var Translations embed.FS var Translations embed.FS