Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Go version to 1.19 #7355

Merged
merged 7 commits into from
Aug 12, 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 .github/workflows/cd-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@b22fbbc2921299758641fab08929b4ac52b32923 # v2
with:
go-version: 1.17.0
go-version: 1.19.0

- name: Setup NodeJS
uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048 # v2.1.2
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@b22fbbc2921299758641fab08929b4ac52b32923 # v2
with:
go-version: 1.17.0
go-version: 1.19.0

- name: Setup NodeJS
uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048 # v2.1.2
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@b22fbbc2921299758641fab08929b4ac52b32923 # v2
with:
go-version: 1.17.0
go-version: 1.19.0

- name: Setup NodeJS
uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048 # v2.1.2
Expand All @@ -74,7 +74,7 @@ jobs:
- name: Install Dependencies
shell: bash
run: |
[ ! -d "node_modules" ] && npm ci || node aio/scripts/version.mjs && command -v golangci-lint >/dev/null 2>&1 || { curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.41.1; } && go mod download
[ ! -d "node_modules" ] && npm ci || node aio/scripts/version.mjs && command -v golangci-lint >/dev/null 2>&1 || { curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.48.0; } && go mod download

- name: Check Code
shell: bash
Expand All @@ -101,7 +101,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@b22fbbc2921299758641fab08929b4ac52b32923 # v2
with:
go-version: 1.17.0
go-version: 1.19.0

- name: Setup NodeJS
uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048 # v2.1.2
Expand All @@ -120,7 +120,7 @@ jobs:
shell: bash
run: |
export GOPATH=$(go env GOPATH)/bin
[ ! -d "node_modules" ] && npm ci || node aio/scripts/version.mjs && command -v golangci-lint >/dev/null 2>&1 || { curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.41.1; } && go mod download
[ ! -d "node_modules" ] && npm ci || node aio/scripts/version.mjs && command -v golangci-lint >/dev/null 2>&1 || { curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.48.0; } && go mod download

- name: Run Frontend Unit Tests
run: make coverage-frontend
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@b22fbbc2921299758641fab08929b4ac52b32923 # v2
with:
go-version: 1.17.0
go-version: 1.19.0

- name: Setup NodeJS
uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048 # v2.1.2
Expand All @@ -176,7 +176,7 @@ jobs:
- name: Install Dependencies
shell: bash
run: |
[ ! -d "node_modules" ] && npm ci && npm install cypress || node aio/scripts/version.mjs && command -v golangci-lint >/dev/null 2>&1 || { curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.41.1; } && go mod download
[ ! -d "node_modules" ] && npm ci && npm install cypress || node aio/scripts/version.mjs && command -v golangci-lint >/dev/null 2>&1 || { curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.48.0; } && go mod download

- name: Run E2E Tests
run: make e2e
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ ROOT_DIRECTORY := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
COVERAGE_DIRECTORY = $(ROOT_DIRECTORY)/coverage
GO_COVERAGE_FILE = $(ROOT_DIRECTORY)/coverage/go.txt
AIR_BINARY := $(shell which air)
CODEGEN_VERSION := v0.24.0
CODEGEN_VERSION := v0.24.1
CODEGEN_BIN := $(GOPATH)/pkg/mod/k8s.io/code-generator@$(CODEGEN_VERSION)/generate-groups.sh
GOLANGCILINT_VERSION := v1.45.2
GOLANGCILINT_VERSION := v1.48.0
GOLANGCILINT_BINARY := $(shell which golangci-lint)
GO_MAJOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
GO_MINOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
MIN_GO_MAJOR_VERSION = 1
MIN_GO_MINOR_VERSION = 17
MIN_GO_MINOR_VERSION = 19
GO_BINARY := $(shell which go)
MAIN_PACKAGE = github.com/kubernetes/dashboard/src/app/backend
KUBECONFIG ?= $(HOME)/.kube/config
Expand Down
2 changes: 1 addition & 1 deletion aio/develop/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# golang is based on debian:jessie
# Specify version to clarify which version we use.
FROM golang:1.17.0-bullseye
FROM golang:1.19.0-bullseye

# Install Node.js. Go is already installed.
# A small tweak, apt-get update is already run by the nodejs setup script,
Expand Down
6 changes: 3 additions & 3 deletions aio/scripts/conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ ARCH=$(uname | awk '{print tolower($0)}')
# Local cluster configuration (check start-cluster.sh script for more details).
HEAPSTER_VERSION="v1.5.4"
HEAPSTER_PORT=8082
KIND_VERSION="v0.11.1"
K8S_VERSION="v1.21.1"
KIND_VERSION="v0.14.0"
K8S_VERSION="v1.24.3"
KIND_BIN=${CACHE_DIR}/kind-${KIND_VERSION}
CODEGEN_VERSION="v0.24.0"
CODEGEN_VERSION="v0.24.1"
CODEGEN_BIN=${GOPATH}/pkg/mod/k8s.io/code-generator@${CODEGEN_VERSION}/generate-groups.sh

# Setup logger.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/kubernetes/dashboard

go 1.17
go 1.19

require (
github.com/docker/distribution v2.8.1+incompatible
Expand Down
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx2
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA=
github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
Expand Down
8 changes: 4 additions & 4 deletions src/app/backend/auth/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ type TokenManager interface {
}

// Authenticator represents authentication methods supported by Dashboard. Currently supported types are:
// - Token based - Any bearer token accepted by apiserver
// - Basic - Username and password based authentication. Requires that apiserver has basic auth enabled also
// - Kubeconfig based - Authenticates user based on kubeconfig file. Only token/basic modes are supported within
// the kubeconfig file.
// - Token based - Any bearer token accepted by apiserver
// - Basic - Username and password based authentication. Requires that apiserver has basic auth enabled also
// - Kubeconfig based - Authenticates user based on kubeconfig file. Only token/basic modes are supported within
// the kubeconfig file.
type Authenticator interface {
// GetAuthInfo returns filled AuthInfo structure that can be used for K8S api client creation.
GetAuthInfo() (api.AuthInfo, error)
Expand Down
4 changes: 2 additions & 2 deletions src/app/backend/auth/jwe/keyholder.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ type rsaKeyHolder struct {

// Encrypter implements key holder interface. See KeyHolder for more information.
// Used encryption algorithms:
// - Content encryption: AES-GCM (256)
// - Key management: RSA-OAEP-SHA256
// - Content encryption: AES-GCM (256)
// - Key management: RSA-OAEP-SHA256
func (self *rsaKeyHolder) Encrypter() jose.Encrypter {
publicKey := &self.Key().PublicKey
encrypter, err := jose.NewEncrypter(jose.A256GCM, jose.Recipient{Algorithm: jose.RSA_OAEP_256, Key: publicKey}, nil)
Expand Down
5 changes: 3 additions & 2 deletions src/app/backend/errors/localizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ const (
// partialsToErrorsMap map structure:
// Key - unique partial string that can be used to differentiate error messages
// Value - unique error code string that frontend can use to localize error message created using
// pattern MSG_<VIEW>_<CAUSE_OF_ERROR>_ERROR
// <VIEW> - optional
//
// pattern MSG_<VIEW>_<CAUSE_OF_ERROR>_ERROR
// <VIEW> - optional
var partialsToErrorsMap = map[string]string{
"does not match the namespace": MsgDeployNamespaceMismatchError,
"empty namespace may not be set": MsgDeployEmptyNamespaceError,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/app/backend/resource/common/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import api "k8s.io/api/core/v1"

// NamespaceQuery is a query for namespaces of a list of objects.
// There's three cases:
// 1. No namespace selected: this means "user namespaces" query, i.e., all except kube-system
// 2. Single namespace selected: this allows for optimizations when querying backends
// 3. More than one namespace selected: resources from all namespaces are queried and then
// filtered here.
// 1. No namespace selected: this means "user namespaces" query, i.e., all except kube-system
// 2. Single namespace selected: this allows for optimizations when querying backends
// 3. More than one namespace selected: resources from all namespaces are queried and then
// filtered here.
type NamespaceQuery struct {
namespaces []string
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/backend/resource/common/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func GetNonduplicateInitContainerNames(podList []v1.Pod) []string {
return initContainerNames
}

//noStringInSlice checks if string in array
// noStringInSlice checks if string in array
func noStringInSlice(str string, array []string) bool {
for _, alreadystr := range array {
if alreadystr == str {
Expand Down
2 changes: 1 addition & 1 deletion src/app/backend/resource/cronjob/jobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestTriggerCronJobWithInvalidName(t *testing.T) {
}
}

//create a job from a cronjob which has a 52 character name (max length)
// create a job from a cronjob which has a 52 character name (max length)
func TestTriggerCronJobWithLongName(t *testing.T) {
longName := strings.Repeat("test", 13)

Expand Down
2 changes: 1 addition & 1 deletion src/app/backend/resource/deployment/oldreplicasets.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
client "k8s.io/client-go/kubernetes"
)

//GetDeploymentOldReplicaSets returns old replica sets targeting Deployment with given name
// GetDeploymentOldReplicaSets returns old replica sets targeting Deployment with given name
func GetDeploymentOldReplicaSets(client client.Interface, dsQuery *dataselect.DataSelectQuery,
namespace string, deploymentName string) (*replicaset.ReplicaSetList, error) {

Expand Down
4 changes: 2 additions & 2 deletions src/app/backend/resource/horizontalpodautoscaler/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ var (
}
)

//func GetHorizontalPodAutoscalerList(client k8sClient.Interface, nsQuery *api.NamespaceQuery) (*HorizontalPodAutoscalerList, error) {
// func GetHorizontalPodAutoscalerList(client k8sClient.Interface, nsQuery *api.NamespaceQuery) (*HorizontalPodAutoscalerList, error) {
func TestGetHorizontalPodAutoscalerList(t *testing.T) {
cases := []struct {
expectedActions []string
Expand Down Expand Up @@ -165,7 +165,7 @@ func TestGetHorizontalPodAutoscalerList(t *testing.T) {
}
}

//func GetHorizontalPodAutoscalerListForResource(client k8sClient.Interface, namespace, kind, name string) (*HorizontalPodAutoscalerList, error) {
// func GetHorizontalPodAutoscalerListForResource(client k8sClient.Interface, namespace, kind, name string) (*HorizontalPodAutoscalerList, error) {
func TestGetHorizontalPodAutoscalerListForResource(t *testing.T) {
cases := []struct {
kind, name string
Expand Down
2 changes: 1 addition & 1 deletion src/app/backend/resource/node/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
v1 "k8s.io/api/core/v1"
)

//getContainerImages returns container image strings from the given node.
// getContainerImages returns container image strings from the given node.
func getContainerImages(node v1.Node) []string {
var containerImages []string
for _, image := range node.Status.Images {
Expand Down