Skip to content

Commit

Permalink
feature(main): change gomod sealyun to labring (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
cuisongliu authored May 1, 2022
1 parent 2f3e971 commit c6c0de8
Show file tree
Hide file tree
Showing 31 changed files with 63 additions and 98 deletions.
12 changes: 6 additions & 6 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)" \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion client/cep.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion client/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion client/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
8 changes: 4 additions & 4 deletions cmd/cepctl/app/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion cmd/cepctl/app/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion cmd/cepctl/cepctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
6 changes: 3 additions & 3 deletions cmd/endpoints-operator/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion cmd/endpoints-operator/endpoints-operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
8 changes: 4 additions & 4 deletions controllers/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
38 changes: 1 addition & 37 deletions controllers/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion controllers/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
15 changes: 8 additions & 7 deletions controllers/run_probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 })
Expand Down
6 changes: 3 additions & 3 deletions controllers/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
)
2 changes: 1 addition & 1 deletion library/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion library/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/sealyun/endpoints-operator/library
module github.com/labring/endpoints-operator/library

go 1.13

Expand Down
4 changes: 2 additions & 2 deletions library/probe/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion library/probe/exec/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions library/probe/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion library/probe/grpc/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions library/probe/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion library/probe/http/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion library/probe/tcp/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion library/probe/tcp/tcp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion library/probe/udp/udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion library/probe/udp/udp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package udp

import (
"github.com/sealyun/endpoints-operator/library/probe"
"github.com/labring/endpoints-operator/library/probe"
"net"
"strings"
"testing"
Expand Down
Loading

0 comments on commit c6c0de8

Please sign in to comment.