From d4783a9ab81a216643cc76bc843aa89c98313ddb Mon Sep 17 00:00:00 2001 From: cuisongliu Date: Sun, 1 May 2022 01:51:47 +0800 Subject: [PATCH 1/2] feature(main): change gomod sealyun to labring --- .goreleaser.yml | 12 ++++++------ Makefile | 2 +- README.md | 2 +- client/cep.go | 2 +- client/kube.go | 2 +- client/utils.go | 2 +- cmd/cepctl/app/client.go | 8 ++++---- cmd/cepctl/app/options/options.go | 2 +- cmd/cepctl/cepctl.go | 2 +- cmd/endpoints-operator/app/server.go | 6 +++--- cmd/endpoints-operator/endpoints-operator.go | 2 +- controllers/controller.go | 8 ++++---- controllers/helper.go | 2 +- controllers/install.go | 2 +- controllers/run_probe.go | 14 +++++++------- controllers/sync.go | 6 +++--- go.mod | 10 +++++----- library/controller/controller.go | 2 +- library/go.mod | 2 +- library/probe/exec/exec.go | 4 ++-- library/probe/exec/exec_test.go | 2 +- library/probe/grpc/grpc.go | 4 ++-- library/probe/grpc/grpc_test.go | 2 +- library/probe/http/http.go | 6 +++--- library/probe/http/http_test.go | 2 +- library/probe/tcp/tcp.go | 2 +- library/probe/tcp/tcp_test.go | 2 +- library/probe/udp/udp.go | 2 +- library/probe/udp/udp_test.go | 2 +- test/concurrent_test.go | 4 ++-- test/testhelper/kube.go | 4 ++-- 31 files changed, 62 insertions(+), 62 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index aaa52dd..eb32456 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -15,9 +15,9 @@ builds: - arm64 main: ./cmd/endpoints-operator ldflags: - - -X github.com/sealyun/endpoints-operator/library/version.gitVersion={{.Version}} - - -X github.com/sealyun/endpoints-operator/library/version.gitCommit={{.ShortCommit}} - - -X github.com/sealyun/endpoints-operator/library/version.buildDate={{.Date}} + - -X github.com/labring/endpoints-operator/library/version.gitVersion={{.Version}} + - -X github.com/labring/endpoints-operator/library/version.gitCommit={{.ShortCommit}} + - -X github.com/labring/endpoints-operator/library/version.buildDate={{.Date}} - -s -w - env: - CGO_ENABLED=0 @@ -31,9 +31,9 @@ builds: - arm64 main: ./cmd/cepctl ldflags: - - -X github.com/sealyun/endpoints-operator/library/version.gitVersion={{.Version}} - - -X github.com/sealyun/endpoints-operator/library/version.gitCommit={{.ShortCommit}} - - -X github.com/sealyun/endpoints-operator/library/version.buildDate={{.Date}} + - -X github.com/labring/endpoints-operator/library/version.gitVersion={{.Version}} + - -X github.com/labring/endpoints-operator/library/version.gitCommit={{.ShortCommit}} + - -X github.com/labring/endpoints-operator/library/version.buildDate={{.Date}} - -s -w #archives: # - replacements: diff --git a/Makefile b/Makefile index 2cadd60..801ea47 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,7 @@ install-deepcopy: ## check license if not exist install go-lint tools $(call go-get-tool,$(DEEPCOPY_BIN),k8s.io/code-generator/cmd/deepcopy-gen@latest) HEAD_FILE := hack/boilerplate.go.txt -INPUT_DIR := github.com/sealyun/endpoints-operator/api/network/v1beta1 +INPUT_DIR := github.com/labring/endpoints-operator/api/network/v1beta1 deepcopy:install-deepcopy $(DEEPCOPY_BIN) \ --input-dirs="$(INPUT_DIR)" \ diff --git a/README.md b/README.md index de2370b..cc15366 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ endpoints-operator是一个云原生、高可靠性、高性能、面向K8s内 ## 安装 ```bash -git clone https://github.com/sealyun/endpoints-operator.git +git clone https://github.com/labring/endpoints-operator.git cd endpoints-operator checkout v0.1.0 helm install -n kube-system endpoints-operator config/charts/endpoints-operator diff --git a/client/cep.go b/client/cep.go index 3020070..8a74d9a 100644 --- a/client/cep.go +++ b/client/cep.go @@ -16,7 +16,7 @@ package client import ( "context" - "github.com/sealyun/endpoints-operator/api/network/v1beta1" + "github.com/labring/endpoints-operator/api/network/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/dynamic" diff --git a/client/kube.go b/client/kube.go index c60e08c..0a85f38 100644 --- a/client/kube.go +++ b/client/kube.go @@ -15,7 +15,7 @@ package client import ( - "github.com/sealyun/endpoints-operator/library/file" + "github.com/labring/endpoints-operator/library/file" "k8s.io/client-go/dynamic" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" diff --git a/client/utils.go b/client/utils.go index a95d184..50e9c19 100644 --- a/client/utils.go +++ b/client/utils.go @@ -15,7 +15,7 @@ package client import ( - "github.com/sealyun/endpoints-operator/library/convert" + "github.com/labring/endpoints-operator/library/convert" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" ) diff --git a/cmd/cepctl/app/client.go b/cmd/cepctl/app/client.go index c2b94c2..70b6249 100644 --- a/cmd/cepctl/app/client.go +++ b/cmd/cepctl/app/client.go @@ -20,10 +20,10 @@ import ( "context" "errors" "fmt" - "github.com/sealyun/endpoints-operator/api/network/v1beta1" - "github.com/sealyun/endpoints-operator/client" - "github.com/sealyun/endpoints-operator/cmd/cepctl/app/options" - "github.com/sealyun/endpoints-operator/library/version" + "github.com/labring/endpoints-operator/api/network/v1beta1" + "github.com/labring/endpoints-operator/client" + "github.com/labring/endpoints-operator/cmd/cepctl/app/options" + "github.com/labring/endpoints-operator/library/version" "github.com/spf13/cobra" v1 "k8s.io/api/core/v1" v1opts "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/cmd/cepctl/app/options/options.go b/cmd/cepctl/app/options/options.go index 0c70239..1bc4af7 100644 --- a/cmd/cepctl/app/options/options.go +++ b/cmd/cepctl/app/options/options.go @@ -18,7 +18,7 @@ import ( "errors" "flag" "fmt" - "github.com/sealyun/endpoints-operator/library/file" + "github.com/labring/endpoints-operator/library/file" cliflag "k8s.io/component-base/cli/flag" "k8s.io/klog/v2" "path" diff --git a/cmd/cepctl/cepctl.go b/cmd/cepctl/cepctl.go index 41fcfc4..a6024be 100644 --- a/cmd/cepctl/cepctl.go +++ b/cmd/cepctl/cepctl.go @@ -17,7 +17,7 @@ limitations under the License. package main import ( - "github.com/sealyun/endpoints-operator/cmd/cepctl/app" + "github.com/labring/endpoints-operator/cmd/cepctl/app" "os" ) diff --git a/cmd/endpoints-operator/app/server.go b/cmd/endpoints-operator/app/server.go index b3ae759..c33a7ce 100644 --- a/cmd/endpoints-operator/app/server.go +++ b/cmd/endpoints-operator/app/server.go @@ -17,9 +17,9 @@ package app import ( "context" "fmt" - "github.com/sealyun/endpoints-operator/cmd/endpoints-operator/app/options" - "github.com/sealyun/endpoints-operator/controllers" - "github.com/sealyun/endpoints-operator/metrics" + "github.com/labring/endpoints-operator/cmd/endpoints-operator/app/options" + "github.com/labring/endpoints-operator/controllers" + "github.com/labring/endpoints-operator/metrics" "k8s.io/component-base/term" "net/http" "os" diff --git a/cmd/endpoints-operator/endpoints-operator.go b/cmd/endpoints-operator/endpoints-operator.go index bceb412..2b4bd68 100644 --- a/cmd/endpoints-operator/endpoints-operator.go +++ b/cmd/endpoints-operator/endpoints-operator.go @@ -17,7 +17,7 @@ limitations under the License. package main import ( - "github.com/sealyun/endpoints-operator/cmd/endpoints-operator/app" + "github.com/labring/endpoints-operator/cmd/endpoints-operator/app" "os" ) diff --git a/controllers/controller.go b/controllers/controller.go index 442340e..74cf7c0 100644 --- a/controllers/controller.go +++ b/controllers/controller.go @@ -18,13 +18,13 @@ package controllers import ( "context" - "github.com/sealyun/endpoints-operator/metrics" + "github.com/labring/endpoints-operator/metrics" "time" "github.com/go-logr/logr" - "github.com/sealyun/endpoints-operator/api/network/v1beta1" - "github.com/sealyun/endpoints-operator/library/controller" - "github.com/sealyun/endpoints-operator/library/convert" + "github.com/labring/endpoints-operator/api/network/v1beta1" + "github.com/labring/endpoints-operator/library/controller" + "github.com/labring/endpoints-operator/library/convert" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/controllers/helper.go b/controllers/helper.go index e70af13..5a5dcd9 100644 --- a/controllers/helper.go +++ b/controllers/helper.go @@ -20,7 +20,7 @@ import ( "context" "fmt" - "github.com/sealyun/endpoints-operator/api/network/v1beta1" + "github.com/labring/endpoints-operator/api/network/v1beta1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/install.go b/controllers/install.go index e9784de..de7bfee 100644 --- a/controllers/install.go +++ b/controllers/install.go @@ -17,7 +17,7 @@ limitations under the License. package controllers import ( - "github.com/sealyun/endpoints-operator/api/network/v1beta1" + "github.com/labring/endpoints-operator/api/network/v1beta1" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" k8sruntime "k8s.io/apimachinery/pkg/util/runtime" diff --git a/controllers/run_probe.go b/controllers/run_probe.go index 530e512..bffddbf 100644 --- a/controllers/run_probe.go +++ b/controllers/run_probe.go @@ -27,13 +27,13 @@ import ( "strings" "time" - libv1 "github.com/sealyun/endpoints-operator/library/api/core/v1" - "github.com/sealyun/endpoints-operator/library/probe" - execprobe "github.com/sealyun/endpoints-operator/library/probe/exec" - grpcprobe "github.com/sealyun/endpoints-operator/library/probe/grpc" - httpprobe "github.com/sealyun/endpoints-operator/library/probe/http" - tcpprobe "github.com/sealyun/endpoints-operator/library/probe/tcp" - udpprobe "github.com/sealyun/endpoints-operator/library/probe/udp" + libv1 "github.com/labring/endpoints-operator/library/api/core/v1" + "github.com/labring/endpoints-operator/library/probe" + execprobe "github.com/labring/endpoints-operator/library/probe/exec" + grpcprobe "github.com/labring/endpoints-operator/library/probe/grpc" + httpprobe "github.com/labring/endpoints-operator/library/probe/http" + tcpprobe "github.com/labring/endpoints-operator/library/probe/tcp" + udpprobe "github.com/labring/endpoints-operator/library/probe/udp" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/intstr" urutime "k8s.io/apimachinery/pkg/util/runtime" diff --git a/controllers/sync.go b/controllers/sync.go index a0b7dad..de42c5f 100644 --- a/controllers/sync.go +++ b/controllers/sync.go @@ -22,11 +22,11 @@ import ( "strconv" "sync" - "github.com/sealyun/endpoints-operator/metrics" + "github.com/labring/endpoints-operator/metrics" "k8s.io/klog" - "github.com/sealyun/endpoints-operator/api/network/v1beta1" - libv1 "github.com/sealyun/endpoints-operator/library/api/core/v1" + "github.com/labring/endpoints-operator/api/network/v1beta1" + libv1 "github.com/labring/endpoints-operator/library/api/core/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" diff --git a/go.mod b/go.mod index 30e0c3f..d64820f 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,13 @@ -module github.com/sealyun/endpoints-operator +module github.com/labring/endpoints-operator go 1.13 -replace github.com/sealyun/endpoints-operator/library => ./library +replace github.com/labring/endpoints-operator/library => ./library require ( github.com/go-logr/logr v0.4.0 - github.com/prometheus/client_golang v1.11.0 // indirect - github.com/sealyun/endpoints-operator/library v0.0.0-00010101000000-000000000000 + github.com/labring/endpoints-operator/library v0.0.0-00010101000000-000000000000 + github.com/prometheus/client_golang v1.11.0 github.com/spf13/cobra v1.1.1 github.com/spf13/pflag v1.0.5 k8s.io/api v0.21.1 @@ -17,5 +17,5 @@ require ( k8s.io/klog v1.0.0 k8s.io/klog/v2 v2.8.0 sigs.k8s.io/controller-runtime v0.9.0 - sigs.k8s.io/yaml v1.2.0 // indirect + sigs.k8s.io/yaml v1.2.0 ) diff --git a/library/controller/controller.go b/library/controller/controller.go index 78adcb8..6c311d5 100644 --- a/library/controller/controller.go +++ b/library/controller/controller.go @@ -23,7 +23,7 @@ import ( "strings" "github.com/go-logr/logr" - "github.com/sealyun/endpoints-operator/library/convert" + "github.com/labring/endpoints-operator/library/convert" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/tools/record" diff --git a/library/go.mod b/library/go.mod index 499e596..9208421 100644 --- a/library/go.mod +++ b/library/go.mod @@ -1,4 +1,4 @@ -module github.com/sealyun/endpoints-operator/library +module github.com/labring/endpoints-operator/library go 1.13 diff --git a/library/probe/exec/exec.go b/library/probe/exec/exec.go index 34eb3ad..ee6fa06 100644 --- a/library/probe/exec/exec.go +++ b/library/probe/exec/exec.go @@ -18,8 +18,8 @@ package exec import ( "bytes" - "github.com/sealyun/endpoints-operator/library/ioutils" - "github.com/sealyun/endpoints-operator/library/probe" + "github.com/labring/endpoints-operator/library/ioutils" + "github.com/labring/endpoints-operator/library/probe" "k8s.io/klog/v2" "k8s.io/utils/exec" diff --git a/library/probe/exec/exec_test.go b/library/probe/exec/exec_test.go index 3f99de9..95c16af 100644 --- a/library/probe/exec/exec_test.go +++ b/library/probe/exec/exec_test.go @@ -18,7 +18,7 @@ package exec import ( "fmt" - "github.com/sealyun/endpoints-operator/library/probe" + "github.com/labring/endpoints-operator/library/probe" "io" "strings" "testing" diff --git a/library/probe/grpc/grpc.go b/library/probe/grpc/grpc.go index 8ed6c2d..0c5ab9c 100644 --- a/library/probe/grpc/grpc.go +++ b/library/probe/grpc/grpc.go @@ -19,8 +19,8 @@ package grpc import ( "context" "fmt" - "github.com/sealyun/endpoints-operator/library/probe" - "github.com/sealyun/endpoints-operator/library/version" + "github.com/labring/endpoints-operator/library/probe" + "github.com/labring/endpoints-operator/library/version" "net" "time" diff --git a/library/probe/grpc/grpc_test.go b/library/probe/grpc/grpc_test.go index 17106e1..baaa3d6 100644 --- a/library/probe/grpc/grpc_test.go +++ b/library/probe/grpc/grpc_test.go @@ -19,7 +19,7 @@ package grpc import ( "context" "fmt" - "github.com/sealyun/endpoints-operator/library/probe" + "github.com/labring/endpoints-operator/library/probe" "net" "net/http" "net/http/httptest" diff --git a/library/probe/http/http.go b/library/probe/http/http.go index 8cf5dec..4e10400 100644 --- a/library/probe/http/http.go +++ b/library/probe/http/http.go @@ -20,9 +20,9 @@ import ( "crypto/tls" "errors" "fmt" - "github.com/sealyun/endpoints-operator/library/io" - "github.com/sealyun/endpoints-operator/library/probe" - "github.com/sealyun/endpoints-operator/library/version" + "github.com/labring/endpoints-operator/library/io" + "github.com/labring/endpoints-operator/library/probe" + "github.com/labring/endpoints-operator/library/version" "k8s.io/klog/v2" "net/http" "net/url" diff --git a/library/probe/http/http_test.go b/library/probe/http/http_test.go index e76d12e..5f060e3 100644 --- a/library/probe/http/http_test.go +++ b/library/probe/http/http_test.go @@ -19,7 +19,7 @@ package http import ( "bytes" "fmt" - "github.com/sealyun/endpoints-operator/library/probe" + "github.com/labring/endpoints-operator/library/probe" "net" "net/http" "net/http/httptest" diff --git a/library/probe/tcp/tcp.go b/library/probe/tcp/tcp.go index 4851751..381b3a7 100644 --- a/library/probe/tcp/tcp.go +++ b/library/probe/tcp/tcp.go @@ -17,7 +17,7 @@ limitations under the License. package tcp import ( - "github.com/sealyun/endpoints-operator/library/probe" + "github.com/labring/endpoints-operator/library/probe" "k8s.io/klog/v2" "net" "strconv" diff --git a/library/probe/tcp/tcp_test.go b/library/probe/tcp/tcp_test.go index e69c693..6afc62f 100644 --- a/library/probe/tcp/tcp_test.go +++ b/library/probe/tcp/tcp_test.go @@ -17,7 +17,7 @@ limitations under the License. package tcp import ( - "github.com/sealyun/endpoints-operator/library/probe" + "github.com/labring/endpoints-operator/library/probe" "net" "net/http" "net/http/httptest" diff --git a/library/probe/udp/udp.go b/library/probe/udp/udp.go index 4a188b6..df245a0 100644 --- a/library/probe/udp/udp.go +++ b/library/probe/udp/udp.go @@ -17,7 +17,7 @@ limitations under the License. package udp import ( - "github.com/sealyun/endpoints-operator/library/probe" + "github.com/labring/endpoints-operator/library/probe" "k8s.io/klog/v2" "net" "strconv" diff --git a/library/probe/udp/udp_test.go b/library/probe/udp/udp_test.go index a07552e..a65cf6b 100644 --- a/library/probe/udp/udp_test.go +++ b/library/probe/udp/udp_test.go @@ -15,7 +15,7 @@ package udp import ( - "github.com/sealyun/endpoints-operator/library/probe" + "github.com/labring/endpoints-operator/library/probe" "net" "strings" "testing" diff --git a/test/concurrent_test.go b/test/concurrent_test.go index fc15fec..0789be9 100644 --- a/test/concurrent_test.go +++ b/test/concurrent_test.go @@ -17,8 +17,8 @@ limitations under the License. package test import ( - "github.com/sealyun/endpoints-operator/api/network/v1beta1" - "github.com/sealyun/endpoints-operator/test/testhelper" + "github.com/labring/endpoints-operator/api/network/v1beta1" + "github.com/labring/endpoints-operator/test/testhelper" "testing" ) diff --git a/test/testhelper/kube.go b/test/testhelper/kube.go index 52bc437..ef886b5 100644 --- a/test/testhelper/kube.go +++ b/test/testhelper/kube.go @@ -17,8 +17,8 @@ package testhelper import ( "context" "fmt" - "github.com/sealyun/endpoints-operator/api/network/v1beta1" - "github.com/sealyun/endpoints-operator/client" + "github.com/labring/endpoints-operator/api/network/v1beta1" + "github.com/labring/endpoints-operator/client" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "sync" From b9d0110bc8f0790b9d40b3d82e7f5f19dbaae319 Mon Sep 17 00:00:00 2001 From: cuisongliu Date: Sun, 1 May 2022 01:54:22 +0800 Subject: [PATCH 2/2] feature(main): change gomod sealyun to labring --- controllers/helper.go | 36 ------------------------------------ controllers/run_probe.go | 1 + 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/controllers/helper.go b/controllers/helper.go index 5a5dcd9..9cb0a66 100644 --- a/controllers/helper.go +++ b/controllers/helper.go @@ -67,16 +67,6 @@ func (c *Reconciler) syncFinalStatus(cep *v1beta1.ClusterEndpoint) { c.updateCondition(cep, clusterReadyCondition) } -func convertAddress(addresses []string) []v1.EndpointAddress { - eas := make([]v1.EndpointAddress, 0) - for _, s := range addresses { - eas = append(eas, v1.EndpointAddress{ - IP: s, - }) - } - return eas -} - type healthyHostAndPort struct { sps []v1beta1.ServicePort host string @@ -117,19 +107,6 @@ func ToAggregate(list []error) utilerrors.Aggregate { return utilerrors.NewAggregate(errs) } -func convertPorts(sps []v1beta1.ServicePort) []v1.EndpointPort { - s := make([]v1.EndpointPort, 0) - for _, sp := range sps { - endPoint := v1.EndpointPort{ - Name: sp.Name, - Port: sp.TargetPort, - Protocol: sp.Protocol, - } - s = append(s, endPoint) - } - return s -} - func convertServicePorts(sps []v1beta1.ServicePort) []v1.ServicePort { s := make([]v1.ServicePort, 0) for _, sp := range sps { @@ -186,16 +163,3 @@ func (c *Reconciler) updateCondition(cep *v1beta1.ClusterEndpoint, condition v1b cep.Status.Conditions = append(cep.Status.Conditions, condition) } } -func (c *Reconciler) deleteCondition(cep *v1beta1.ClusterEndpoint, conditionType v1beta1.ConditionType) { - if cep.Status.Conditions == nil { - cep.Status.Conditions = make([]v1beta1.Condition, 0) - } - newConditions := make([]v1beta1.Condition, 0) - for _, cond := range cep.Status.Conditions { - if cond.Type == conditionType { - continue - } - newConditions = append(newConditions, cond) - } - cep.Status.Conditions = newConditions -} diff --git a/controllers/run_probe.go b/controllers/run_probe.go index bffddbf..72a7582 100644 --- a/controllers/run_probe.go +++ b/controllers/run_probe.go @@ -61,6 +61,7 @@ func (pb *prober) runProbeWithRetries(p *libv1.Probe, retries int) (probe.Result return result, output, err } +//nolint: errcheck func (w *work) doProbe() (keepGoing bool) { defer func() { recover() }() // Actually eat panics (HandleCrash takes care of logging) defer urutime.HandleCrash(func(_ interface{}) { keepGoing = true })