Merge pull request #14756 from minikube-bot/auto_bump_golint_version
bump golint versionpull/14757/head
commit
e9fe458c59
2
Makefile
2
Makefile
|
@ -76,7 +76,7 @@ MINIKUBE_RELEASES_URL=https://github.com/kubernetes/minikube/releases/download
|
|||
KERNEL_VERSION ?= 5.10.57
|
||||
# latest from https://github.com/golangci/golangci-lint/releases
|
||||
# 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
|
||||
GOLINT_JOBS ?= 4
|
||||
# see https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint
|
||||
|
|
|
@ -37,9 +37,9 @@ func main() {
|
|||
}
|
||||
|
||||
// analyzePerformance is responsible for:
|
||||
// 1. collecting PRs to run performance analysis on
|
||||
// 2. running mkcmp against those PRs
|
||||
// 3. commenting results on those PRs
|
||||
// 1. collecting PRs to run performance analysis on
|
||||
// 2. running mkcmp against those PRs
|
||||
// 3. commenting results on those PRs
|
||||
func analyzePerformance(ctx context.Context) error {
|
||||
client := monitor.NewClient(ctx, monitor.GithubOwner, monitor.GithubRepo)
|
||||
prs, err := client.ListOpenPRsWithLabel(monitor.OkToTestLabel)
|
||||
|
|
|
@ -46,7 +46,8 @@ func getSHAFromURL(url string) (string, error) {
|
|||
}
|
||||
|
||||
// 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
|
||||
func TestReleasesJSON(t *testing.T) {
|
||||
releases, err := notify.AllVersionsFromURL(notify.GithubMinikubeReleasesURL)
|
||||
|
@ -57,7 +58,8 @@ func TestReleasesJSON(t *testing.T) {
|
|||
}
|
||||
|
||||
// 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
|
||||
func TestBetaReleasesJSON(t *testing.T) {
|
||||
releases, err := notify.AllVersionsFromURL(notify.GithubMinikubeBetaReleasesURL)
|
||||
|
|
|
@ -58,13 +58,14 @@ func main() {
|
|||
}
|
||||
|
||||
// One entry of a test run.
|
||||
// Example: TestEntry {
|
||||
// name: "TestFunctional/parallel/LogsCmd",
|
||||
// environment: "Docker_Linux",
|
||||
// date: time.Now,
|
||||
// status: "Passed",
|
||||
// duration: 0.1,
|
||||
// }
|
||||
//
|
||||
// Example: TestEntry {
|
||||
// name: "TestFunctional/parallel/LogsCmd",
|
||||
// environment: "Docker_Linux",
|
||||
// date: time.Now,
|
||||
// status: "Passed",
|
||||
// duration: 0.1,
|
||||
// }
|
||||
type testEntry struct {
|
||||
name string
|
||||
environment string
|
||||
|
|
|
@ -62,7 +62,6 @@ func main() {
|
|||
update.Apply(schema, data)
|
||||
}
|
||||
|
||||
//
|
||||
// golintVersions returns stable version in semver format.
|
||||
func golintVersion(ctx context.Context, owner, repo string) (stable string, err error) {
|
||||
// get Kubernetes versions from GitHub Releases
|
||||
|
|
|
@ -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
|
||||
// have been made closer to core/v1 VolumeMount field names
|
||||
// In yaml this looks like:
|
||||
// containerPath: /foo
|
||||
// hostPath: /bar
|
||||
// readOnly: true
|
||||
// selinuxRelabel: false
|
||||
// propagation: None
|
||||
//
|
||||
// containerPath: /foo
|
||||
// hostPath: /bar
|
||||
// readOnly: true
|
||||
// selinuxRelabel: false
|
||||
// propagation: None
|
||||
//
|
||||
// Propagation may be one of: None, HostToContainer, Bidirectional
|
||||
type Mount struct {
|
||||
// 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.
|
||||
// In yaml this looks like:
|
||||
// containerPort: 80
|
||||
// hostPort: 8000
|
||||
// listenAddress: 127.0.0.1
|
||||
//
|
||||
// containerPort: 80
|
||||
// hostPort: 8000
|
||||
// listenAddress: 127.0.0.1
|
||||
type PortMapping struct {
|
||||
// Port within the container.
|
||||
ContainerPort int32 `protobuf:"varint,1,opt,name=container_port,json=containerPort,proto3" json:"containerPort,omitempty"`
|
||||
|
|
|
@ -43,10 +43,10 @@ const (
|
|||
)
|
||||
|
||||
// Enable follows these steps for enabling gvisor in minikube:
|
||||
// 1. creates necessary directories for storing binaries and runsc logs
|
||||
// 2. downloads runsc and gvisor-containerd-shim
|
||||
// 3. copies necessary containerd config files
|
||||
// 4. restarts containerd
|
||||
// 1. creates necessary directories for storing binaries and runsc logs
|
||||
// 2. downloads runsc and gvisor-containerd-shim
|
||||
// 3. copies necessary containerd config files
|
||||
// 4. restarts containerd
|
||||
func Enable() error {
|
||||
if err := makeGvisorDirs(); err != nil {
|
||||
return errors.Wrap(err, "creating directories on node")
|
||||
|
@ -149,8 +149,9 @@ func downloadFileToDest(url, dest string) error {
|
|||
}
|
||||
|
||||
// Must write the following files:
|
||||
// 1. gvisor-containerd-shim.toml
|
||||
// 2. gvisor containerd config.toml
|
||||
// 1. gvisor-containerd-shim.toml
|
||||
// 2. gvisor containerd config.toml
|
||||
//
|
||||
// and save the default version of config.toml
|
||||
func copyConfigFiles() error {
|
||||
log.Printf("Storing default config.toml at %s", storedContainerdConfigTomlPath)
|
||||
|
|
|
@ -122,7 +122,8 @@ func recentReleases(n int) ([]string, error) {
|
|||
return versions, nil
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
*
|
||||
This test case has only 1 thing to test and that is the
|
||||
networking/dnsDomain value
|
||||
*/
|
||||
|
|
|
@ -41,7 +41,7 @@ const (
|
|||
ExtraKey = "extra"
|
||||
)
|
||||
|
||||
// vars related to the --wait flag
|
||||
// vars related to the --wait flag
|
||||
var (
|
||||
// DefaultComponents is map of the the default components to wait for
|
||||
DefaultComponents = map[string]bool{APIServerWaitKey: true, SystemPodsWaitKey: true}
|
||||
|
|
|
@ -29,6 +29,7 @@ import (
|
|||
)
|
||||
|
||||
// https://docs.projectcalico.org/manifests/calico.yaml
|
||||
//
|
||||
//go:embed calico.yaml
|
||||
var calicoYaml string
|
||||
|
||||
|
|
|
@ -302,10 +302,11 @@ func cleanImageCacheDir() error {
|
|||
|
||||
// normalizeTagName automatically tag latest to image
|
||||
// Example:
|
||||
// nginx -> nginx:latest
|
||||
// localhost:5000/nginx -> localhost:5000/nginx:latest
|
||||
// localhost:5000/nginx:latest -> localhost:5000/nginx:latest
|
||||
// docker.io/dotnet/core/sdk -> docker.io/dotnet/core/sdk:latest
|
||||
//
|
||||
// nginx -> nginx:latest
|
||||
// localhost:5000/nginx -> localhost:5000/nginx: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 {
|
||||
base := image
|
||||
tag := "latest"
|
||||
|
|
|
@ -142,7 +142,7 @@ var (
|
|||
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) {
|
||||
if cachedSystemMemoryLimit == nil {
|
||||
v, err := mem.VirtualMemory()
|
||||
|
@ -178,7 +178,7 @@ var (
|
|||
cachedCPUErr *error
|
||||
)
|
||||
|
||||
// cachedCPUInfo will return a cached cpu info
|
||||
// cachedCPUInfo will return a cached cpu info
|
||||
func cachedCPUInfo() ([]cpu.InfoStat, error) {
|
||||
if cachedCPU == nil {
|
||||
// one InfoStat per thread
|
||||
|
|
|
@ -139,7 +139,7 @@ Persistent Routes:
|
|||
expectedRt := routingTable{
|
||||
routingTableLine{
|
||||
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{
|
||||
route: unsafeParseRoute("192.168.1.2", "10.211.55.0/24"),
|
||||
|
|
|
@ -80,8 +80,9 @@ type Interface struct {
|
|||
// lookupInInterfaces iterates over all local network interfaces
|
||||
// and tries to match "ip" with associated networks
|
||||
// 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) {
|
||||
// check local network 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:
|
||||
// - false, if it already has unexpired reservation
|
||||
// - true, if new reservation was created or expired one renewed
|
||||
// - false, if it already has unexpired reservation
|
||||
// - true, if new reservation was created or expired one renewed
|
||||
//
|
||||
// uses sync.Map to manage reservations thread-safe
|
||||
func reserveSubnet(subnet string, period time.Duration) bool {
|
||||
// put 'zero' reservation{} Map value for subnet Map key
|
||||
|
|
|
@ -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) {
|
||||
steps := map[string]string{}
|
||||
for _, ce := range ces {
|
||||
|
|
|
@ -445,11 +445,14 @@ func testPause(ctx context.Context, t *testing.T, profile string) {
|
|||
|
||||
// Remove container-specific prefixes for naming consistency
|
||||
// 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
|
||||
// $ 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 {
|
||||
name = strings.TrimPrefix(name, "docker.io/")
|
||||
name = strings.TrimPrefix(name, "localhost/")
|
||||
|
|
|
@ -19,5 +19,6 @@ package translations
|
|||
import "embed"
|
||||
|
||||
// Translations contains all translation JSON files.
|
||||
//
|
||||
//go:embed *.json
|
||||
var Translations embed.FS
|
||||
|
|
Loading…
Reference in New Issue