mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/kube-vip/kube-vip.git
synced 2026-09-20 08:03:47 +08:00
chore: Fixed lint issues and updated CONTRIBUTING docs to reflect actual make entries
Signed-off-by: Yannick Wahner <thenabsku@gmail.com>
This commit is contained in:
@@ -113,8 +113,8 @@ and *merged* sorts of commits.
|
||||
To make it easier for reviewers to review your PR, consider the following:
|
||||
|
||||
1. Follow the golang [coding conventions](https://github.com/golang/go/wiki/CodeReviewComments).
|
||||
2. Format your code with `make golangci-fix`; if the [linters](ci/README.md) flag an issue that
|
||||
cannot be fixed automatically, an error message will be displayed so you can address the issue.
|
||||
2. Format your code with `make simplify` to automatically fix formatting issues.
|
||||
2. Lint your code with `make check`; if the linters flag an issue that cannot be fixed automatically, an error message will be displayed so you can address the issue.
|
||||
3. Follow [git commit](https://chris.beams.io/posts/git-commit/) guidelines.
|
||||
4. Follow [logging](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md) guidelines.
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/kube-vip/kube-vip/pkg/kubevip"
|
||||
"github.com/kube-vip/kube-vip/pkg/servicecontext"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
discoveryv1 "k8s.io/api/discovery/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
)
|
||||
@@ -35,9 +36,8 @@ func TestShouldAllowReconcileWithoutEndpoints(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
type fakeWorker struct {
|
||||
endpoints []string
|
||||
endpoints []string
|
||||
clearCalled bool
|
||||
processCalled bool
|
||||
}
|
||||
@@ -69,7 +69,7 @@ func TestAddOrModify_ZeroEndpointsBehavior(t *testing.T) {
|
||||
worker := &fakeWorker{endpoints: []string{}}
|
||||
p := &Processor{
|
||||
config: &kubevip.Config{},
|
||||
provider: providers.NewEndpoints(),
|
||||
provider: providers.NewEndpointslices(),
|
||||
worker: worker,
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ func TestAddOrModify_ZeroEndpointsBehavior(t *testing.T) {
|
||||
|
||||
restart, err := p.AddOrModify(
|
||||
svcCtx,
|
||||
watch.Event{Type: watch.Modified, Object: &v1.Endpoints{}},
|
||||
watch.Event{Type: watch.Modified, Object: &discoveryv1.EndpointSlice{}},
|
||||
new(string),
|
||||
service,
|
||||
"node-1",
|
||||
|
||||
Reference in New Issue
Block a user