diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index de6d2b63..b77c4015 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. diff --git a/pkg/endpoints/endpoints_test.go b/pkg/endpoints/endpoints_test.go index 608430cd..405679eb 100644 --- a/pkg/endpoints/endpoints_test.go +++ b/pkg/endpoints/endpoints_test.go @@ -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", @@ -130,4 +130,4 @@ func TestAddOrModify_ZeroEndpointsBehavior(t *testing.T) { } run(t, service, true, false, true, false) }) -} \ No newline at end of file +}