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 linter and Kubernetes version #378

Merged
merged 2 commits into from
Feb 15, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: golangci/golangci-lint:v1.56.0
container: golangci/golangci-lint:v1.56.1
steps:
- uses: actions/cache@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GORUN=$(GOCMD) run
GOBUILD=$(GOCMD) build -v -ldflags $(LD_FLAGS) -trimpath

CC_TEST_REPORTER_ID=6e107e510c5479f40b0ce9166a254f3f1ee0bc547b3e48281bada1a5a32bb56d
GOLANGCI_LINT_VERSION=v1.56.0
GOLANGCI_LINT_VERSION=v1.56.1
BIN_PATH=$$HOME/bin

GO_PACKAGES=./...
Expand Down
10 changes: 5 additions & 5 deletions cli/flexkube/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ func (r *Resource) RunAPILoadBalancerPool(name string) error {
return fmt.Errorf("getting API Load Balancer pool %q from configuration: %w", name, err)
}

saveStateF := func(rs types.Resource) {
saveStateF := func(types.Resource) {
if r.State.APILoadBalancerPools == nil {
r.State.APILoadBalancerPools = map[string]*container.ContainersState{}
}
Expand All @@ -534,7 +534,7 @@ func (r *Resource) RunControlplane() error {
return fmt.Errorf("getting controlplane from the configuration: %w", err)
}

saveStateF := func(rs types.Resource) {
saveStateF := func(types.Resource) {
r.State.Controlplane = &controlplaneResource.Containers().ToExported().PreviousState
}

Expand All @@ -548,7 +548,7 @@ func (r *Resource) RunEtcd() error {
return fmt.Errorf("getting etcd from the configuration: %w", err)
}

saveStateF := func(rs types.Resource) {
saveStateF := func(types.Resource) {
r.State.Etcd = &etcdResource.Containers().ToExported().PreviousState
}

Expand All @@ -562,7 +562,7 @@ func (r *Resource) RunKubeletPool(name string) error {
return fmt.Errorf("getting kubelet pool %q from configuration: %w", name, err)
}

saveStateF := func(rs types.Resource) {
saveStateF := func(types.Resource) {
if r.State.KubeletPools == nil {
r.State.KubeletPools = map[string]*container.ContainersState{}
}
Expand Down Expand Up @@ -600,7 +600,7 @@ func (r *Resource) RunContainers(name string) error {
return fmt.Errorf("getting containers group %q from configuration: %w", name, err)
}

saveStateF := func(rs types.Resource) {
saveStateF := func(types.Resource) {
if r.State.Containers == nil {
r.State.Containers = map[string]*container.ContainersState{}
}
Expand Down
6 changes: 3 additions & 3 deletions e2e/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ func defaultE2EConfig(t *testing.T) e2eConfig {
Charts: charts{
KubeAPIServer: chart{
Source: "flexkube/kube-apiserver",
Version: "0.9.1",
Version: "0.9.2",
},
Kubernetes: chart{
Source: "flexkube/kubernetes",
Version: "0.10.1",
Version: "0.10.2",
},
KubeProxy: chart{
Source: "flexkube/kube-proxy",
Version: "0.9.1",
Version: "0.9.2",
},
TLSBootstrapping: chart{
Source: "flexkube/tls-bootstrapping",
Expand Down
22 changes: 11 additions & 11 deletions pkg/container/container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func TestStatus(t *testing.T) {
testContainer := &containerInstance{
base: base{
runtime: runtime.Fake{
StatusF: func(ID string) (types.ContainerStatus, error) {
StatusF: func(string) (types.ContainerStatus, error) {
return types.ContainerStatus{}, fmt.Errorf("checking status")
},
},
Expand Down Expand Up @@ -177,7 +177,7 @@ func TestContainerUpdateStatusFail(t *testing.T) {
testContainer := &container{
base: base{
runtime: runtime.Fake{
StatusF: func(ID string) (types.ContainerStatus, error) {
StatusF: func(string) (types.ContainerStatus, error) {
return types.ContainerStatus{}, fmt.Errorf("checking status")
},
},
Expand All @@ -203,7 +203,7 @@ func TestContainerUpdateStatus(t *testing.T) {
testContainer := &container{
base: base{
runtime: runtime.Fake{
StatusF: func(ID string) (types.ContainerStatus, error) {
StatusF: func(string) (types.ContainerStatus, error) {
return expectedStatus, nil
},
},
Expand Down Expand Up @@ -244,7 +244,7 @@ func TestContainerStartRuntimeError(t *testing.T) {
testContainer := &container{
base: base{
runtime: runtime.Fake{
StartF: func(ID string) error {
StartF: func(string) error {
return fmt.Errorf("starting container failed")
},
},
Expand All @@ -271,10 +271,10 @@ func TestContainerStart(t *testing.T) {
testContainer := &container{
base: base{
runtime: runtime.Fake{
StartF: func(ID string) error {
StartF: func(string) error {
return nil
},
StatusF: func(ID string) (types.ContainerStatus, error) {
StatusF: func(string) (types.ContainerStatus, error) {
return expectedStatus, nil
},
},
Expand Down Expand Up @@ -315,7 +315,7 @@ func TestContainerStopRuntimeError(t *testing.T) {
testContainer := &container{
base: base{
runtime: runtime.Fake{
StopF: func(ID string) error {
StopF: func(string) error {
return fmt.Errorf("starting container failed")
},
},
Expand All @@ -342,10 +342,10 @@ func TestContainerStop(t *testing.T) {
testContainer := &container{
base: base{
runtime: runtime.Fake{
StopF: func(ID string) error {
StopF: func(string) error {
return nil
},
StatusF: func(ID string) (types.ContainerStatus, error) {
StatusF: func(string) (types.ContainerStatus, error) {
return expectedStatus, nil
},
},
Expand Down Expand Up @@ -386,7 +386,7 @@ func TestContainerDeleteRuntimeError(t *testing.T) {
testContainer := &container{
base: base{
runtime: runtime.Fake{
DeleteF: func(ID string) error {
DeleteF: func(string) error {
return fmt.Errorf("starting container failed")
},
},
Expand All @@ -408,7 +408,7 @@ func TestContainerDelete(t *testing.T) {
testContainer := &container{
base: base{
runtime: runtime.Fake{
DeleteF: func(ID string) error {
DeleteF: func(string) error {
return nil
},
},
Expand Down
22 changes: 11 additions & 11 deletions pkg/container/containers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ func TestEnsureExistsFailCreate(t *testing.T) {
t.Parallel()

failingCreateRuntime := fakeRuntime()
failingCreateRuntime.CreateF = func(config *types.ContainerConfig) (string, error) {
failingCreateRuntime.CreateF = func(*types.ContainerConfig) (string, error) {
return "", fmt.Errorf("create fail")
}

Expand Down Expand Up @@ -1173,13 +1173,13 @@ func TestEnsureConfiguredNoStateUpdateOnFail(t *testing.T) {
},
runtimeConfig: &runtime.FakeConfig{
Runtime: &runtime.Fake{
CreateF: func(config *types.ContainerConfig) (string, error) {
CreateF: func(*types.ContainerConfig) (string, error) {
return testContainerID, nil
},
StatusF: func(id string) (types.ContainerStatus, error) {
StatusF: func(string) (types.ContainerStatus, error) {
return types.ContainerStatus{}, nil
},
CopyF: func(id string, files []*types.File) error {
CopyF: func(string, []*types.File) error {
return fmt.Errorf("fail")
},
},
Expand Down Expand Up @@ -1340,15 +1340,15 @@ func TestUpdateExistingContainersRemoveAllOld(t *testing.T) {
t.Parallel()

fooRuntime := fakeRuntime()
fooRuntime.StatusF = func(id string) (types.ContainerStatus, error) {
fooRuntime.StatusF = func(string) (types.ContainerStatus, error) {
return types.ContainerStatus{
Status: "running",
ID: "foo",
}, nil
}

barRuntime := fakeRuntime()
barRuntime.StatusF = func(id string) (types.ContainerStatus, error) {
barRuntime.StatusF = func(string) (types.ContainerStatus, error) {
return types.ContainerStatus{
Status: "running",
ID: "bar",
Expand Down Expand Up @@ -1480,21 +1480,21 @@ func TestEnsureCurrentContainerNonExisting(t *testing.T) {

func fakeRuntime() *runtime.Fake {
return &runtime.Fake{
CreateF: func(config *types.ContainerConfig) (string, error) {
CreateF: func(*types.ContainerConfig) (string, error) {
return testContainerID, nil
},
StatusF: func(id string) (types.ContainerStatus, error) {
StatusF: func(string) (types.ContainerStatus, error) {
return types.ContainerStatus{
ID: testAnotherContainerID,
}, nil
},
DeleteF: func(id string) error {
DeleteF: func(string) error {
return nil
},
StartF: func(id string) error {
StartF: func(string) error {
return nil
},
StopF: func(id string) error {
StopF: func(string) error {
return nil
},
}
Expand Down
22 changes: 11 additions & 11 deletions pkg/container/containersstate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func TestContainersStateCheckStateFailStatus(t *testing.T) {
base: base{
runtimeConfig: &runtime.FakeConfig{
Runtime: &runtime.Fake{
StatusF: func(id string) (types.ContainerStatus, error) {
StatusF: func(string) (types.ContainerStatus, error) {
return types.ContainerStatus{}, fmt.Errorf("fail")
},
},
Expand Down Expand Up @@ -100,13 +100,13 @@ func TestContainersStateCheckStateGone(t *testing.T) {
base: base{
runtimeConfig: &runtime.FakeConfig{
Runtime: &runtime.Fake{
CreateF: func(config *types.ContainerConfig) (string, error) {
CreateF: func(*types.ContainerConfig) (string, error) {
return testContainerID, nil
},
DeleteF: func(id string) error {
DeleteF: func(string) error {
return nil
},
StatusF: func(id string) (types.ContainerStatus, error) {
StatusF: func(string) (types.ContainerStatus, error) {
return types.ContainerStatus{}, nil
},
},
Expand Down Expand Up @@ -143,7 +143,7 @@ func TestRemoveContainerDontStopStopped(t *testing.T) {
t.Parallel()

failingStopRuntime := failingStopRuntime()
failingStopRuntime.StatusF = func(id string) (types.ContainerStatus, error) {
failingStopRuntime.StatusF = func(string) (types.ContainerStatus, error) {
return types.ContainerStatus{
Status: "stopped",
ID: "foo",
Expand Down Expand Up @@ -188,10 +188,10 @@ func TestRemoveContainerDontRemoveMissing(t *testing.T) {
},
runtimeConfig: &runtime.FakeConfig{
Runtime: &runtime.Fake{
DeleteF: func(id string) error {
DeleteF: func(string) error {
return fmt.Errorf("deleting failed")
},
StopF: func(id string) error {
StopF: func(string) error {
return nil
},
},
Expand All @@ -210,7 +210,7 @@ func TestRemoveContainerPropagateStopError(t *testing.T) {
t.Parallel()

failingStopRuntime := failingStopRuntime()
failingStopRuntime.StatusF = func(id string) (types.ContainerStatus, error) {
failingStopRuntime.StatusF = func(string) (types.ContainerStatus, error) {
return types.ContainerStatus{
Status: "running",
ID: "foo",
Expand Down Expand Up @@ -255,16 +255,16 @@ func TestRemoveContainerPropagateDeleteError(t *testing.T) {
},
runtimeConfig: &runtime.FakeConfig{
Runtime: &runtime.Fake{
DeleteF: func(id string) error {
DeleteF: func(string) error {
return fmt.Errorf("deleting failed")
},
StatusF: func(id string) (types.ContainerStatus, error) {
StatusF: func(string) (types.ContainerStatus, error) {
return types.ContainerStatus{
Status: "running",
ID: "foo",
}, nil
},
StopF: func(id string) error {
StopF: func(string) error {
return nil
},
},
Expand Down
Loading
Loading